[GTK] Add WebKit2 API for isolated worlds
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Aug 2013 15:09:22 +0000 (15:09 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Aug 2013 15:09:22 +0000 (15:09 +0000)
commitf4bbf8fdf9b15afd1c9179012bae57bd85fa6fe9
treee4fee46fffe80eb7d83ecd09f66f7372e04bf5f3
parentd6e9e61984096bbd08f8cceb926c6af831d0f1a0
[GTK] Add WebKit2 API for isolated worlds
https://bugs.webkit.org/show_bug.cgi?id=103377

Reviewed by Anders Carlsson.

* GNUmakefile.list.am: Add new files to compilation.
* UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbols.
* UIProcess/API/gtk/tests/TestWebExtensions.cpp:
(testWebExtensionWindowObjectCleared):
(scriptDialogCallback):
(runJavaScriptInIsolatedWorldFinishedCallback):
(testWebExtensionIsolatedWorld):
(beforeAll):
* UIProcess/API/gtk/tests/WebExtensionTest.cpp:
(echoCallback):
(windowObjectCleared):
(getWebPage):
(methodCallCallback):
* WebProcess/InjectedBundle/API/gtk/WebKitFrame.cpp:
(webkit_frame_get_javascript_context_for_script_world): New public
method to tget the JavaScript execution context for a given script
world.
* WebProcess/InjectedBundle/API/gtk/WebKitFrame.h:
* WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.cpp: Added.
(scriptWorlds): Global WebKitScriptWorld map.
(_WebKitScriptWorldPrivate::~_WebKitScriptWorldPrivate):
(webkitScriptWorldGet): Get the WebKitScriptWorld wrapping the
given injected bundle script world.
(webkitScriptWorldGetInjectedBundleScriptWorld): Get the injected
bundle script world wrapped by the given WebKitScriptWorld.
(webkitScriptWorldWindowObjectCleared): Emit
WebKitScriptWorld::window-object-cleared signal.
(webkitScriptWorldCreate): Create a new WebKitScriptWorld wrapping
the given injected bundle script world.
(createDefaultScriptWorld): Create the default WebKitScriptWorld
wrapping the normal world.
(webkit_script_world_get_default): Return the default WebKitScriptWorld.
(webkit_script_world_new): Create a new isolated WebKitScriptWorld.
* WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.h: Added.
* WebProcess/InjectedBundle/API/gtk/WebKitScriptWorldPrivate.h: Added.
* WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
(didClearWindowObjectForFrame): Call webkitScriptWorldWindowObjectCleared().
(webkitWebPageCreate): Add implementation for callback
didClearWindowObjectForFrame in injected bundle loader client.
* WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h:
Include WebKitScriptWorld.h.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154603 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/GNUmakefile.list.am
Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt
Source/WebKit2/UIProcess/API/gtk/tests/TestWebExtensions.cpp
Source/WebKit2/UIProcess/API/gtk/tests/WebExtensionTest.cpp
Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitFrame.cpp
Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitFrame.h
Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.cpp [new file with mode: 0644]
Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.h [new file with mode: 0644]
Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitScriptWorldPrivate.h [new file with mode: 0644]
Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp
Source/WebKit2/WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h