[GTK] Add support for loading web process extensions
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Jan 2013 11:27:49 +0000 (11:27 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Jan 2013 11:27:49 +0000 (11:27 +0000)
commit54145f40f2de733af63e303d3cba01ea03375e0c
tree77417abd0301e99d87fbfb6e803cacf025493031
parent645654f0165fa179c402ae94cb29f935562babc9
[GTK] Add support for loading web process extensions
https://bugs.webkit.org/show_bug.cgi?id=105631

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2013-01-10
Reviewed by Gustavo Noronha Silva.

.:

* GNUmakefile.am: Add webkit2_web_extension_h_api.
* Source/autotools/symbols.filter: Export WebGtkExtensionManager
symbols required by the injected bundle lib.

Source/WebKit2:

* GNUmakefile.am: Link to libWebCoreDOM.la and build injected
bundle lib.
* GNUmakefile.list.am: Add new files to compilation.
* UIProcess/API/gtk/WebKitWebContext.cpp:
(injectedBundleDirectory): Helper funtion to get the injected
bundle directory.
(injectedBundleFilename): Helper funtion to get the injected undle
library full path.
(createDefaultWebContext): Create the WebContext with an injected
bundle path.
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkit_web_view_get_page_id): Return the identifier of the web
page associated to the web view.
* UIProcess/API/gtk/WebKitWebView.h:
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new chapter for
web extensions.
* UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbols.
* UIProcess/API/gtk/docs/webkit2gtk.types: Add new types.
* UIProcess/API/gtk/tests/GNUmakefile.am: Add new files to compilation.
* UIProcess/API/gtk/tests/TestMain.cpp:
(main):
* UIProcess/API/gtk/tests/TestWebExtensions.cpp: Added.
(testWebExtension):
(beforeAll):
(afterAll):
* UIProcess/API/gtk/tests/WebExtensionTest.cpp: Added.
(methodCallCallback):
(webkit_web_extension_initialize):
* UIProcess/API/gtk/tests/WebKitTestBus.cpp: Added.
(WebKitTestBus::WebKitTestBus):
(WebKitTestBus::run):
(WebKitTestBus::~WebKitTestBus):
(WebKitTestBus::connection):
(onNameAppeared):
(WebKitTestBus::createProxy):
* UIProcess/API/gtk/tests/WebKitTestBus.h: Added.
(WebKitTestBus):
* WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp: Added.
(_WebKitWebExtensionPrivate):
(webkitWebExtensionPageCreated): Create a WebKitWebPage for the
newly crated page and emit WebKitWebExtension::page-created
signals.
(webkitWebExtensionPageDestroy): Remove the page from the map.
(didCreatePage): Call webkitWebExtensionPageCreated().
(willDestroyPage): Call webkitWebExtensionPageDestroy().
(webkitWebExtensionCreate): Create a new WebKitWebExtension and
initialize the injected bundle client.
(webkit_web_extension_get_page): Return the WebKitWebPage for the
given page identifier.
* WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.h: Added.
(_WebKitWebExtension):
(_WebKitWebExtensionClass):
* WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionDefines.h: Added.
* WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionPrivate.h: Added.
* WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp: Added.
(_WebKitWebPagePrivate):
(webkit_web_page_class_init):
(webkitWebPageCreate): Create a new WebKitWebPage.
(webkit_web_page_get_dom_document): Return the WebKitDOMDocument
loaded in the WebKitWebPage.
* WebProcess/InjectedBundle/API/gtk/WebKitWebPage.h: Added.
(_WebKitWebPage):
(_WebKitWebPageClass):
* WebProcess/InjectedBundle/API/gtk/WebKitWebPagePrivate.h: Added.
* WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h: Added.
* WebProcess/gtk/WebGtkExtensionManager.cpp: Added.
(WebKit::WebGtkExtensionManager::shared): Return the global shared
instance.
(WebKit::WebGtkExtensionManager::WebGtkExtensionManager):
(WebKit::WebGtkExtensionManager::appendModuleDirectories): Add
directories to scan for modules.
(WebKit::WebGtkExtensionManager::scanModules): Scan for modules.
(WebKit::WebGtkExtensionManager::initialize): Load and initialize
the modules found.
* WebProcess/gtk/WebGtkExtensionManager.h: Added.
* WebProcess/gtk/WebGtkInjectedBundleMain.cpp: Added.
(WKBundleInitialize): Initialize WebGtkExtensionManager.

Tools:

* MiniBrowser/gtk/GNUmakefile.am:
* MiniBrowser/gtk/main.c:
(main): Set WEBKIT_INJECTED_BUNDLE env var to use the injected
bundle lib from build dir.
* Scripts/webkitpy/style/checker.py: Add exceptions for GTK+ API
located in WebProcess/InjectedBundle/API/gtk.
* gtk/generate-gtkdoc:
(get_webkit2_options): Scan also files in
WebProcess/InjectedBundle/API/gtk to generate API docs.
(get_webkit2_options.injected_bundle_src_path): Helper function to
build paths in WebProcess/InjectedBundle/API/gtk.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@139305 268f45cc-cd09-0410-ab3c-d52691b4dbfc
34 files changed:
ChangeLog
GNUmakefile.am
Source/WebKit2/ChangeLog
Source/WebKit2/GNUmakefile.am
Source/WebKit2/GNUmakefile.list.am
Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h
Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml
Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt
Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk.types
Source/WebKit2/UIProcess/API/gtk/tests/GNUmakefile.am
Source/WebKit2/UIProcess/API/gtk/tests/TestMain.cpp
Source/WebKit2/UIProcess/API/gtk/tests/TestWebExtensions.cpp [new file with mode: 0644]
Source/WebKit2/UIProcess/API/gtk/tests/WebExtensionTest.cpp [new file with mode: 0644]
Source/WebKit2/UIProcess/API/gtk/tests/WebKitTestBus.cpp [new file with mode: 0644]
Source/WebKit2/UIProcess/API/gtk/tests/WebKitTestBus.h [new file with mode: 0644]
Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp [new file with mode: 0644]
Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.h [new file with mode: 0644]
Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionDefines.h [new file with mode: 0644]
Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionPrivate.h [new file with mode: 0644]
Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp [new file with mode: 0644]
Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPage.h [new file with mode: 0644]
Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPagePrivate.h [new file with mode: 0644]
Source/WebKit2/WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h [new file with mode: 0644]
Source/WebKit2/WebProcess/gtk/WebGtkExtensionManager.cpp [new file with mode: 0644]
Source/WebKit2/WebProcess/gtk/WebGtkExtensionManager.h [new file with mode: 0644]
Source/WebKit2/WebProcess/gtk/WebGtkInjectedBundleMain.cpp [new file with mode: 0644]
Source/autotools/symbols.filter
Tools/ChangeLog
Tools/MiniBrowser/gtk/GNUmakefile.am
Tools/MiniBrowser/gtk/main.c
Tools/Scripts/webkitpy/style/checker.py
Tools/gtk/generate-gtkdoc