crosswalk-project/crosswalk — pull request #708 by yongsheng (2013-09-18 09:00:26+00:00)
Title: Implement APIs for external extensions

Similar to native extensions system, we need to allow web developers
or others to write their own extensions. Due to the shared mode, there
are some client classes in runtime client side which are used by
external extensions.

1. XWalkExtensionClient: the base class for external extensions.
2. XWalkExtensionContextClient: the context to be used by extensions to
help get the context.
3. Configuration system: define a configuration system to specify what
kind of extensions to be loaded and created by crosswalk.

So for web developers, an external extension is implemented with below steps:
1. Write the JavaScript code stub same as the native extension system.
2. A new class inherited from XWalkExtensionClient implements the methods
used by JavaScript.
3. Configure the extension in extensions-config.json, like:
[
{
"name": "myextension",
"class": "com.example.MyExtension",
"js_api": "myextension.js"
}
}

Web developers don't have to create and register their extensions. Instead,
crosswalk runtime will load and create them according to the configuration
system.