[Android] Refactor Java extension system

The commit is to decouple the extension from XWalkRuntimeViewProvider
and simplify the interfaces exposed by XWalkRuntimeViewProvider. Now it
is easy to use the extension system by creating a new
XWalkExtensionManager.

The backend implementation for XWalkExtension is abstracted as
XWalkExtensionBridge interface. Currently, one backend implementation
based on xwalk core is provided as default.

BUG=https://crosswalk-project.org/jira/browse/XWALK-148
[Android] Add content scheme support

The content scheme is for the Uris used by android content
provider. They are commonly used on android to retrieve
resources.

For detail information of android content provider, please referring
http://developer.android.com/guide/topics/providers/content-providers.html.

BUG=https://crosswalk-project.org/jira/browse/XWALK-165
TEST=org.xwalk.core.xwview.test.LoadUrlTest#testContentUrl
[Android] Add extension JS files to runtime client embedded shell

Fixes bug that runtime client embedded shell can not find Javascript
stubs of runtime internal extensions.

BUG=https://crosswalk-project.org/jira/browse/XWALK-126
[Android] Fix the issue that geolocation information can't be fetched.

The geolocation related Web API can't work due to the problem of crosswalk.
The root cause is that the activity status is not initialized so that
internal features like location provider can't get the correct status.
Fix it by passing the application to content layer and add the permissions
in AndroidManifest.xml.

BUG=https://crosswalk-project.org/jira/browse/XWALK-151
[SysApps] Add Raw Sockets stub

Just the skeleton to serve as base for the interfaces implementation. No API is
currently exposed.
[SysApps] Add the TCPSocket implementation

This is the initial implementation of the W3C's Raw Sockets TCPSocket interface.
It is not complete but is fully functional. Some issues with the spec are being
worked with the standardization body, like the fact that the send() method is
technically sync (although we implement as async always returning true).

A notable missing feature is the throwing of exceptions on invalid parameters,
but the error callback is still called under these circumstances.

We also add the RawSocketObject class. This class is going to concentrate all
the shared code among the different interfaces of the Raw Socket API. Currently only
the ReadyState is shared.
[SysApps] Make it possible to create a TCPSocket from a connected socket

The TCPServerSocket will need to create a TCPSocket from incoming connections.
This patch makes it possible to create an object in the native side first and
handle the identifier to the JavaScript context.
[SysApps] Add TCPServerSocket implementation

Added an incomplete but functional implementation of the
Raw Sockets TCPServerSocket interface.
[SysApps] Add browser tests for the Raw Socket JavaScript API

Tests if the objects are leaky and if the basic functionality like
send and receive data works. These tests are not API conformance tests.
Merge pull request #1059 from tmpsantos/raw_socket3

[SysApps] Raw Socket API implementation
[Android] Refine the test case about onPause and onResume.

This patch refined the test case about onPause and onResume on
embedded and shared mode. It's for the runtime client.
Invoke onPause or onResume on main thread, wait for some seconds
to ensure that action is done, get the first title. Then wait for
some milliseconds, get the title again. Compare the two titles.

We can not use the TimerTask directly, because it creates an external
thread which was not executed when the main thread exits.

For embedded client test:
1. install XWalkRuntimeClientEmbeddedShell.apk
2. python build/android/test_runner.py instrumentation \
--test-apk=XWalkRuntimeClientEmbeddedTest -v -f testPauseResume

For shared client test:
1. install XWalkRuntimeLib.apk
2. install XWalkRuntimeClientShell.apk
3. python build/android/test_runner.py instrumentation \
--test-apk=XWalkRuntimeClientTest -v -f testPauseResume
Merge pull request #1074 from hmin/extension-refactor

[Android] Refactor Java extension system
[Android] Allow geolocation context permission for crosswalk.

Geolocation context permission has to be handled in crosswalk for Android
port. It's used to allow geolocation access for origins. This fix is to allow
requests from different origins for geolocation information with the
in-memory cache mechanism.
Currently we allow all origins to access the geolocation information
if the web app is granted with the permission.

BUG=https://crosswalk-project.org/jira/browse/XWALK-151
Merge pull request #1088 from wang16/content_scheme

[Android] Add content scheme support
Merge pull request #1103 from DonnaWuDongxia/embed

[Android] Add extension JS files to runtime client embedded shell
Merge pull request #1117 from wuhengzhi/pauseResume

[Android] Refine the test case about onPause and onResume.
Merge pull request #1113 from yongsheng/xwalk151

[Android] Allow geolocation context permission for crosswalk.
[Packaging] Introduce gbp-flat-tree.sh to simplify the Tizen build process.

TL;DR: one can simply do the following to build an RPM:
  cd /path/to/src/xwalk
  gbs build -A i586

We can get rid of the need for a separate git tree and the
generate-flat-tree.sh script by relying on the hooks provided by
git-buildpackage: the postexport hook that we use is called right after the
git repository's sources have been exported with `git archive`.

In this hook, we execute a new script, `gbp-flat-tree.sh`. It does pretty
much the same thing as generate-flat-script.sh, but automatically. That is,
it removes the tarball generated by `git archive` (since gbs build should be
called from xwalk/, it would only contain Crosswalk's contents anyway) and
replaces it with a new one with the contents of src/.

Since it is called at a stage in the whole build process that immediately
precedes the call to `/usr/bin/build`, we do not need to keep a separate
flat git tree with all our sources anymore; we are effectively bypassing
git-buildpackage's default export mechanism.

The downside of this approach (which is shared by the previous one with
`generate-flat-tree.sh`, anyway) is that all files in src/ are archived,
even if they are not part of any commit. In other words, we end up acting as
if "--include-all" was always passed to `gbs build`.

(Fun fact: the whole dance of calling `gclient recursive` twice with
different arguments and everything was unnecessary; one of the entries
reported by those calls is src/ itself, so we always ended up archiving
everything under it)
[Packaging] Accept other build directories to support incremental builds.

TL;DR: Specify a directory outside the RPM build area with the BUILDDIR_NAME
macro to have incremental builds:
  cd /path/to/src/xwalk
  gbs build -A i586 --define 'BUILDDIR_NAME /tmp/crosswalk-builddir'

A full rebuild was being performed in every call to `gbs build` due to two
issues:

1. rpmbuild erases the RPM build directory by default in the %setup stage of
   the spec file. This can be solved by passing -D to %setup, but...
2. osc-build (`/usr/bin/build`) removes the whole RPM build area (that is,
   `/home/abuild/rpmbuild`) by default unless we pass "--incremental" to
   `gbs build`. Unfortunately, suffice it to say that the implementation of
   that option in gbs leaves a lot to be desired and does not solve our
   problem.

This can be solved by exploiting the way gyp generates Makefiles: it is
possible to override the default value "out" of the `builddir_name` variable
and have out-of-source builds. We can thus point it to a location outside
`/home/abuild/rpmbuild` in the chroot and automatically preserve it across
builds, as the rest of the buildroot is kept by gbs by default.

We then allow the user to specify a different build directory with the
`BUILDDIR_NAME` RPM macro that can be passed to gbs as explained in the
beginning of the commit message. One of Chromium's tools, grit, also had to
be fixed to allow out-of-source builds to work correctly, which explains the
addition in DEPS.xwalk.

Another thing worth mentioning is that we now use the `-n` option of the
%setup macro in the spec file as the root directory of the source tarballs
do not have Crosswalk's version anymore: even if those two problems related
to the removal of the build directory above are worked around, a full
rebuild is triggered if the source directory gets changed (think of a
version number bump, for example). While at this, it is also worth bearing
in mind that a change in CFLAGS or CXXFLAGS also triggers a rebuild, so
calling make directly from inside the gbs chroot without using the same
compiler flags as the RPM build will also cause problems.

Last but not least, the generate-flat-tree.sh script and its instructions in
the README will be removed in a later commit, once we get more people to
test the new solution.
[Packaging] Update the README after the last two commits.