Changeset 139305 in webkit
- Timestamp:
- Jan 10, 2013 3:27:49 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 12 added
- 19 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r139291 r139305 1 2013-01-10 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Add support for loading web process extensions 4 https://bugs.webkit.org/show_bug.cgi?id=105631 5 6 Reviewed by Gustavo Noronha Silva. 7 8 * GNUmakefile.am: Add webkit2_web_extension_h_api. 9 * Source/autotools/symbols.filter: Export WebGtkExtensionManager 10 symbols required by the injected bundle lib. 11 1 12 2013-01-10 Christophe Dumez <christophe.dumez@intel.com> 2 13 -
trunk/GNUmakefile.am
r138595 r139305 99 99 webkit2gtk_h_api := 100 100 webkit2gtk_built_sources := 101 webkit2_web_extension_h_api := 101 102 webkit2_plugin_process_sources := 102 103 webkit2_plugin_process_built_sources := -
trunk/Source/WebKit2/ChangeLog
r139300 r139305 1 2013-01-10 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Add support for loading web process extensions 4 https://bugs.webkit.org/show_bug.cgi?id=105631 5 6 Reviewed by Gustavo Noronha Silva. 7 8 * GNUmakefile.am: Link to libWebCoreDOM.la and build injected 9 bundle lib. 10 * GNUmakefile.list.am: Add new files to compilation. 11 * UIProcess/API/gtk/WebKitWebContext.cpp: 12 (injectedBundleDirectory): Helper funtion to get the injected 13 bundle directory. 14 (injectedBundleFilename): Helper funtion to get the injected undle 15 library full path. 16 (createDefaultWebContext): Create the WebContext with an injected 17 bundle path. 18 * UIProcess/API/gtk/WebKitWebView.cpp: 19 (webkit_web_view_get_page_id): Return the identifier of the web 20 page associated to the web view. 21 * UIProcess/API/gtk/WebKitWebView.h: 22 * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new chapter for 23 web extensions. 24 * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbols. 25 * UIProcess/API/gtk/docs/webkit2gtk.types: Add new types. 26 * UIProcess/API/gtk/tests/GNUmakefile.am: Add new files to compilation. 27 * UIProcess/API/gtk/tests/TestMain.cpp: 28 (main): 29 * UIProcess/API/gtk/tests/TestWebExtensions.cpp: Added. 30 (testWebExtension): 31 (beforeAll): 32 (afterAll): 33 * UIProcess/API/gtk/tests/WebExtensionTest.cpp: Added. 34 (methodCallCallback): 35 (webkit_web_extension_initialize): 36 * UIProcess/API/gtk/tests/WebKitTestBus.cpp: Added. 37 (WebKitTestBus::WebKitTestBus): 38 (WebKitTestBus::run): 39 (WebKitTestBus::~WebKitTestBus): 40 (WebKitTestBus::connection): 41 (onNameAppeared): 42 (WebKitTestBus::createProxy): 43 * UIProcess/API/gtk/tests/WebKitTestBus.h: Added. 44 (WebKitTestBus): 45 * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp: Added. 46 (_WebKitWebExtensionPrivate): 47 (webkitWebExtensionPageCreated): Create a WebKitWebPage for the 48 newly crated page and emit WebKitWebExtension::page-created 49 signals. 50 (webkitWebExtensionPageDestroy): Remove the page from the map. 51 (didCreatePage): Call webkitWebExtensionPageCreated(). 52 (willDestroyPage): Call webkitWebExtensionPageDestroy(). 53 (webkitWebExtensionCreate): Create a new WebKitWebExtension and 54 initialize the injected bundle client. 55 (webkit_web_extension_get_page): Return the WebKitWebPage for the 56 given page identifier. 57 * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.h: Added. 58 (_WebKitWebExtension): 59 (_WebKitWebExtensionClass): 60 * WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionDefines.h: Added. 61 * WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionPrivate.h: Added. 62 * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp: Added. 63 (_WebKitWebPagePrivate): 64 (webkit_web_page_class_init): 65 (webkitWebPageCreate): Create a new WebKitWebPage. 66 (webkit_web_page_get_dom_document): Return the WebKitDOMDocument 67 loaded in the WebKitWebPage. 68 * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.h: Added. 69 (_WebKitWebPage): 70 (_WebKitWebPageClass): 71 * WebProcess/InjectedBundle/API/gtk/WebKitWebPagePrivate.h: Added. 72 * WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h: Added. 73 * WebProcess/gtk/WebGtkExtensionManager.cpp: Added. 74 (WebKit::WebGtkExtensionManager::shared): Return the global shared 75 instance. 76 (WebKit::WebGtkExtensionManager::WebGtkExtensionManager): 77 (WebKit::WebGtkExtensionManager::appendModuleDirectories): Add 78 directories to scan for modules. 79 (WebKit::WebGtkExtensionManager::scanModules): Scan for modules. 80 (WebKit::WebGtkExtensionManager::initialize): Load and initialize 81 the modules found. 82 * WebProcess/gtk/WebGtkExtensionManager.h: Added. 83 * WebProcess/gtk/WebGtkInjectedBundleMain.cpp: Added. 84 (WKBundleInitialize): Initialize WebGtkExtensionManager. 85 1 86 2013-01-10 Huang Dongsung <luxtella@company100.net> 2 87 -
trunk/Source/WebKit2/GNUmakefile.am
r139046 r139305 24 24 25 25 libwebkit2gtkinclude_HEADERS = \ 26 $(webkit2gtk_h_api) 26 $(webkit2gtk_h_api) \ 27 $(webkit2_web_extension_h_api) 27 28 28 29 nodist_libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOURCES = \ … … 88 89 -I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle/API \ 89 90 -I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle/API/c \ 91 -I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle/API/gtk \ 90 92 -I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle/DOM \ 91 93 -I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle/gtk \ … … 104 106 -I$(srcdir)/Source/WebKit2/WebProcess/WebCoreSupport/soup \ 105 107 -I$(srcdir)/Source/WebKit2/WebProcess/WebPage \ 106 108 -I$(srcdir)/Source/WebKit2/WebProcess/WebPage/atk \ 107 109 -I$(srcdir)/Source/WebKit2/WebProcess/WebPage/gtk \ 108 110 -I$(top_builddir)/DerivedSources/WebKit2 \ … … 111 113 -I$(top_builddir)/DerivedSources/WebKit2/webkit2gtk/include \ 112 114 -I$(top_builddir)/DerivedSources/WebKit2/webkit2gtk/webkit2 \ 115 -I$(top_builddir)/DerivedSources/WebKit2/webkit2extension/include \ 113 116 -I$(top_builddir)/DerivedSources/WebKit2/include/JavaScriptCore \ 114 117 -I$(top_builddir)/DerivedSources/WebKit2/include/WebCore \ 115 118 -I$(top_builddir)/DerivedSources/WebKit2/include/WebKit2 \ 119 -I$(top_builddir)/DerivedSources/webkitdom \ 116 120 -DLIBEXECDIR=\""$(libexecdir)"\" \ 121 -DLIBDIR=\""$(libdir)"\" \ 122 -DBUILDING_WEBKIT \ 117 123 -DWEBKIT2_COMPILATION \ 118 124 -DENABLE_PLUGIN_PROCESS=1 \ … … 178 184 libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_LIBADD += \ 179 185 libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \ 186 libWebCoreDOM.la \ 180 187 libWebCoreGtk.la \ 181 188 $(CAIRO_LIBS) \ … … 283 290 && ln -n -s -f ${shell pwd}/$(WebKit2)/UIProcess/API/gtk $@ 284 291 285 BUILT_SOURCES += $(GENSOURCES_WEBKIT2)/webkit2gtk/include/webkit2 292 $(GENSOURCES_WEBKIT2)/webkit2extension/include/webkit2: $(libwebkit2gtkinclude_HEADERS) 293 $(AM_V_GEN)mkdir -p $(GENSOURCES_WEBKIT2)/webkit2extension/include \ 294 && ln -n -s -f ${shell pwd}/$(WebKit2)/WebProcess/InjectedBundle/API/gtk $@ 295 296 BUILT_SOURCES += \ 297 $(GENSOURCES_WEBKIT2)/webkit2extension/include/webkit2 \ 298 $(GENSOURCES_WEBKIT2)/webkit2gtk/include/webkit2 286 299 287 300 vpath %.messages.in = \ … … 478 491 $(XRENDER_CFLAGS) \ 479 492 $(XT_CFLAGS) 493 494 # Injected Bundle 495 injectedbundledir = $(libdir)/webkit2gtk-3.0/injected-bundle 496 injectedbundle_LTLIBRARIES = libwebkit2gtkinjectedbundle.la 497 498 libwebkit2gtkinjectedbundle_la_SOURCES = \ 499 Source/WebKit2/WebProcess/gtk/WebGtkInjectedBundleMain.cpp 500 501 libwebkit2gtkinjectedbundle_la_LDFLAGS = \ 502 $(no_undefined) \ 503 -module \ 504 -avoid-version 505 506 libwebkit2gtkinjectedbundle_la_CPPFLAGS = \ 507 -fno-strict-aliasing \ 508 -I$(srcdir)/Source/WebKit2/Platform \ 509 -I$(srcdir)/Source/WebKit2/Shared \ 510 -I$(srcdir)/Source/WebKit2/Shared/API/c \ 511 -I$(srcdir)/Source/WebKit2/UIProcess/API/C \ 512 -I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle \ 513 -I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle/API/c \ 514 -I$(top_builddir)/DerivedSources/InjectedBundle \ 515 -I$(top_builddir)/DerivedSources/WebKit2/include \ 516 $(global_cppflags) \ 517 $(javascriptcore_cppflags) \ 518 $(GLIB_CFLAGS) 480 519 481 520 # Serialize linking of the plugin process with both webkit libraries. -
trunk/Source/WebKit2/GNUmakefile.list.am
r139184 r139305 132 132 $(WebKit2)/UIProcess/API/gtk/WebKitWindowProperties.h \ 133 133 $(WebKit2)/UIProcess/API/gtk/webkit2.h 134 135 webkit2_web_extension_h_api += \ 136 $(WebKit2)/WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.h \ 137 $(WebKit2)/WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionDefines.h \ 138 $(WebKit2)/WebProcess/InjectedBundle/API/gtk/WebKitWebPage.h \ 139 $(WebKit2)/WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h 134 140 135 141 webkit2_built_sources += \ … … 992 998 Source/WebKit2/WebProcess/Geolocation/WebGeolocationManager.cpp \ 993 999 Source/WebKit2/WebProcess/Geolocation/WebGeolocationManager.h \ 1000 Source/WebKit2/WebProcess/gtk/WebGtkExtensionManager.cpp \ 1001 Source/WebKit2/WebProcess/gtk/WebGtkExtensionManager.h \ 994 1002 Source/WebKit2/WebProcess/gtk/WebProcessMainGtk.cpp \ 995 1003 Source/WebKit2/WebProcess/gtk/WebProcessMainGtk.h \ … … 1034 1042 Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp \ 1035 1043 Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.h \ 1044 Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp \ 1045 Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.h \ 1046 Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionPrivate.h \ 1047 Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionDefines.h \ 1048 Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp \ 1049 Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPage.h \ 1050 Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPagePrivate.h \ 1051 Source/WebKit2/WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h \ 1036 1052 Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp \ 1037 1053 Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h \ … … 1186 1202 Source/WebKit2/WebProcess/WebPage/TapHighlightController.cpp \ 1187 1203 Source/WebKit2/WebProcess/WebPage/TapHighlightController.h \ 1188 1189 1204 Source/WebKit2/WebProcess/WebPage/atk/WebPageAccessibilityObject.h \ 1205 Source/WebKit2/WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp \ 1190 1206 Source/WebKit2/WebProcess/WebPage/gtk/WebInspectorGtk.cpp \ 1191 1207 Source/WebKit2/WebProcess/WebPage/gtk/WebPageGtk.cpp \ -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp
r138783 r139305 167 167 } 168 168 169 static CString injectedBundleDirectory() 170 { 171 if (const char* bundleDirectory = g_getenv("WEBKIT_INJECTED_BUNDLE_PATH")) 172 return bundleDirectory; 173 174 static const char* injectedBundlePath = LIBDIR""G_DIR_SEPARATOR_S"webkit2gtk-"WEBKITGTK_API_VERSION_STRING""G_DIR_SEPARATOR_S"injected-bundle"G_DIR_SEPARATOR_S; 175 return injectedBundlePath; 176 } 177 178 static CString injectedBundleFilename() 179 { 180 GOwnPtr<char> bundleFilename(g_build_filename(injectedBundleDirectory().data(), "libwebkit2gtkinjectedbundle.so", NULL)); 181 return bundleFilename.get(); 182 } 183 169 184 static gpointer createDefaultWebContext(gpointer) 170 185 { … … 172 187 WebKitWebContextPrivate* priv = webContext->priv; 173 188 174 priv->context = WebContext::create( String());189 priv->context = WebContext::create(WebCore::filenameToString(injectedBundleFilename().data())); 175 190 priv->requestManager = webContext->priv->context->supplement<WebSoupRequestManagerProxy>(); 176 191 priv->context->setCacheModel(CacheModelPrimaryWebBrowser); -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
r138622 r139305 1846 1846 1847 1847 getPage(webView)->loadURLRequest(WebURLRequest::create(webkitURIRequestGetResourceRequest(request)).leakRef()); 1848 } 1849 1850 /** 1851 * webkit_web_view_get_page_id: 1852 * @web_view: a #WebKitWebView 1853 * 1854 * Get the identifier of the #WebKitWebPage corresponding to 1855 * the #WebKitWebView 1856 * 1857 * Returns: the page ID of @web_view. 1858 */ 1859 guint64 webkit_web_view_get_page_id(WebKitWebView* webView) 1860 { 1861 g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), 0); 1862 1863 return getPage(webView)->pageID(); 1848 1864 } 1849 1865 -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h
r138593 r139305 262 262 webkit_web_view_is_loading (WebKitWebView *web_view); 263 263 264 WEBKIT_API guint64 265 webkit_web_view_get_page_id (WebKitWebView *web_view); 266 264 267 WEBKIT_API const gchar * 265 268 webkit_web_view_get_title (WebKitWebView *web_view); -
trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml
r137469 r139305 44 44 </chapter> 45 45 46 <chapter> 47 <title>Web Extensions</title> 48 <xi:include href="xml/WebKitWebExtension.xml"/> 49 <xi:include href="xml/WebKitWebPage.xml"/> 50 </chapter> 51 46 52 <index id="index-all"> 47 53 <title>Index</title> -
trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt
r138593 r139305 97 97 webkit_web_view_go_forward 98 98 webkit_web_view_get_title 99 webkit_web_view_get_page_id 99 100 webkit_web_view_reload 100 101 webkit_web_view_reload_bypass_cache … … 928 929 webkit_security_manager_get_type 929 930 </SECTION> 931 932 <SECTION> 933 <FILE>WebKitWebExtension</FILE> 934 WebKitWebExtension 935 WebKitWebExtensionInitializeFunction 936 webkit_web_extension_get_page 937 938 <SUBSECTION Standard> 939 WebKitWebExtensionClass 940 WEBKIT_TYPE_WEB_EXTENSION 941 WEBKIT_WEB_EXTENSION 942 WEBKIT_IS_WEB_EXTENSION 943 WEBKIT_WEB_EXTENSION_CLASS 944 WEBKIT_IS_WEB_EXTENSION_CLASS 945 WEBKIT_WEB_EXTENSION_GET_CLASS 946 947 <SUBSECTION Private> 948 WebKitWebExtensionPrivate 949 webkit_web_extension_get_type 950 </SECTION> 951 952 <SECTION> 953 <FILE>WebKitWebPage</FILE> 954 WebKitWebPage 955 webkit_web_page_get_dom_document 956 957 <SUBSECTION Standard> 958 WebKitWebPageClass 959 WEBKIT_TYPE_WEB_PAGE 960 WEBKIT_WEB_PAGE 961 WEBKIT_IS_WEB_PAGE 962 WEBKIT_WEB_PAGE_CLASS 963 WEBKIT_IS_WEB_PAGE_CLASS 964 WEBKIT_WEB_PAGE_GET_CLASS 965 966 <SUBSECTION Private> 967 WebKitWebPagePrivate 968 webkit_web_page_get_type 969 </SECTION> -
trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk.types
r121093 r139305 22 22 webkit_context_menu_get_type 23 23 webkit_context_menu_item_get_type 24 webkit_web_extension_get_type 25 webkit_web_page_get_type -
trunk/Source/WebKit2/UIProcess/API/gtk/tests/GNUmakefile.am
r134600 r139305 13 13 Programs/WebKit2APITests/TestResources \ 14 14 Programs/WebKit2APITests/TestSSL \ 15 Programs/WebKit2APITests/TestWebExtensions \ 15 16 Programs/WebKit2APITests/TestWebKitVersion \ 16 17 Programs/WebKit2APITests/TestWebKitFaviconDatabase \ … … 35 36 -DWEBKIT_DERIVED_SRC_DIR=\"${shell pwd}/${top_builddir}/DerivedSources\" \ 36 37 -DWEBKIT_TEST_PLUGIN_DIR=\"${shell pwd}/${top_builddir}/TestNetscapePlugin/.libs\" \ 38 -DWEBKIT_TEST_WEB_EXTENSIONS_DIR=\"${shell pwd}/${top_builddir}/Libraries/WebExtensions/.libs\" \ 39 -DWEBKIT_INJECTED_BUNDLE_PATH=\"${shell pwd}/$(top_builddir)/.libs\" \ 37 40 $(javascriptcore_cppflags) \ 38 41 -I$(srcdir)/Source/JavaScriptCore \ … … 71 74 Source/WebKit2/UIProcess/API/gtk/tests/LoadTrackingTest.cpp \ 72 75 Source/WebKit2/UIProcess/API/gtk/tests/LoadTrackingTest.h \ 76 Source/WebKit2/UIProcess/API/gtk/tests/WebKitTestBus.cpp \ 77 Source/WebKit2/UIProcess/API/gtk/tests/WebKitTestBus.h \ 73 78 Source/WebKit2/UIProcess/API/gtk/tests/WebKitTestServer.cpp \ 74 79 Source/WebKit2/UIProcess/API/gtk/tests/WebKitTestServer.h \ … … 79 84 Libraries_libWebKit2APITestCore_la_CPPFLAGS = $(webkit2_tests_cppflags) 80 85 86 noinst_LTLIBRARIES += Libraries/WebExtensions/libWebExtensionTest.la 87 Libraries_WebExtensions_libWebExtensionTest_la_SOURCES = \ 88 Source/WebKit2/UIProcess/API/gtk/tests/WebExtensionTest.cpp 89 90 Libraries_WebExtensions_libWebExtensionTest_la_LDFLAGS = \ 91 -rpath ${shell pwd}/$(top_builddir)/Libraries/WebExtensions/.libs \ 92 $(no_undefined) \ 93 -avoid-version \ 94 -module 95 96 Libraries_WebExtensions_libWebExtensionTest_la_CPPFLAGS = \ 97 -I$(srcdir)/Source/WebKit2/WebProcess/InjectedBundle/API/gtk \ 98 -I$(top_builddir)/DerivedSources \ 99 -I$(top_builddir)/DerivedSources/WebKit2/webkit2extension/include \ 100 -DWEBKIT2_COMPILATION \ 101 $(webkit2_tests_cppflags) 102 103 Libraries_WebExtensions_libWebExtensionTest_la_CXXFLAGS = \ 104 $(global_cxxflags) 105 106 Libraries_WebExtensions_libWebExtensionTest_la_CFLAGS = \ 107 $(global_cflags) 108 109 81 110 EXTRA_DIST += \ 82 111 Source/WebKit2/UIProcess/API/gtk/tests/resources/test-cert.pem \ … … 215 244 Programs_WebKit2APITests_TestSSL_LDFLAGS = $(webkit2_tests_ldflags) 216 245 246 Programs_WebKit2APITests_TestWebExtensions_SOURCES = \ 247 Source/WebKit2/UIProcess/API/gtk/tests/TestWebExtensions.cpp 248 Programs_WebKit2APITests_TestWebExtensions_CPPFLAGS = $(webkit2_tests_cppflags) 249 Programs_WebKit2APITests_TestWebExtensions_LDADD = $(webkit2_tests_ldadd) 250 Programs_WebKit2APITests_TestWebExtensions_LDFLAGS = $(webkit2_tests_ldflags) 251 217 252 endif # ENABLE_WEBKIT2 -
trunk/Source/WebKit2/UIProcess/API/gtk/tests/TestMain.cpp
r132870 r139305 40 40 gtk_test_init(&argc, &argv, 0); 41 41 g_setenv("WEBKIT_EXEC_PATH", WEBKIT_EXEC_PATH, FALSE); 42 g_setenv("WEBKIT_INJECTED_BUNDLE_PATH", WEBKIT_INJECTED_BUNDLE_PATH, FALSE); 42 43 g_test_bug_base("https://bugs.webkit.org/"); 43 44 -
trunk/Source/WebKit2/UIProcess/API/gtk/tests/WebKitTestBus.h
r139304 r139305 1 1 /* 2 * Copyright (C) 201 1Igalia S.L.2 * Copyright (C) 2012 Igalia S.L. 3 3 * 4 4 * This library is free software; you can redistribute it and/or … … 18 18 */ 19 19 20 #i nclude "config.h"21 # include "TestMain.h"20 #ifndef WebKitTestBus_h 21 #define WebKitTestBus_h 22 22 23 #include <gtk/gtk.h> 23 #include <gio/gio.h> 24 #include <wtf/gobject/GRefPtr.h> 25 #include <wtf/text/CString.h> 24 26 25 void beforeAll(); 26 void afterAll(); 27 class WebKitTestBus { 28 public: 29 WebKitTestBus(); 30 virtual ~WebKitTestBus(); 27 31 28 static void registerGResource(void) 29 { 30 GOwnPtr<char> resourcesPath(g_build_filename(WEBKIT_EXEC_PATH, "resources", "webkit2gtk-tests-resources.gresource", NULL)); 31 GResource* resource = g_resource_load(resourcesPath.get(), 0); 32 g_assert(resource); 32 bool run(); 33 GDBusProxy* createProxy(const char* serviceName, const char* objectPath, const char* interfaceName, GMainLoop*); 33 34 34 g_resources_register(resource); 35 g_resource_unref(resource); 36 } 35 private: 36 GDBusConnection* connection(); 37 37 38 int main(int argc, char** argv) 39 { 40 gtk_test_init(&argc, &argv, 0); 41 g_setenv("WEBKIT_EXEC_PATH", WEBKIT_EXEC_PATH, FALSE); 42 g_test_bug_base("https://bugs.webkit.org/"); 38 pid_t m_pid; 39 CString m_address; 40 GRefPtr<GDBusConnection> m_connection; 41 }; 43 42 44 registerGResource(); 45 46 beforeAll(); 47 int returnValue = g_test_run(); 48 afterAll(); 49 50 return returnValue; 51 } 43 #endif // WebKitTestBus_h -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionPrivate.h
r139304 r139305 1 1 /* 2 * Copyright (C) 201 1Igalia S.L.2 * Copyright (C) 2012 Igalia S.L. 3 3 * 4 4 * This library is free software; you can redistribute it and/or … … 18 18 */ 19 19 20 #i nclude "config.h"21 # include "TestMain.h"20 #ifndef WebKitWebExtensionPrivate_h 21 #define WebKitWebExtensionPrivate_h 22 22 23 #include <gtk/gtk.h> 23 #include "InjectedBundle.h" 24 #include "WebKitWebExtension.h" 24 25 25 void beforeAll(); 26 void afterAll(); 26 WebKitWebExtension* webkitWebExtensionCreate(WebKit::InjectedBundle*); 27 27 28 static void registerGResource(void) 29 { 30 GOwnPtr<char> resourcesPath(g_build_filename(WEBKIT_EXEC_PATH, "resources", "webkit2gtk-tests-resources.gresource", NULL)); 31 GResource* resource = g_resource_load(resourcesPath.get(), 0); 32 g_assert(resource); 33 34 g_resources_register(resource); 35 g_resource_unref(resource); 36 } 37 38 int main(int argc, char** argv) 39 { 40 gtk_test_init(&argc, &argv, 0); 41 g_setenv("WEBKIT_EXEC_PATH", WEBKIT_EXEC_PATH, FALSE); 42 g_test_bug_base("https://bugs.webkit.org/"); 43 44 registerGResource(); 45 46 beforeAll(); 47 int returnValue = g_test_run(); 48 afterAll(); 49 50 return returnValue; 51 } 28 #endif // WebKitWebExtensionPrivate_h -
trunk/Source/WebKit2/WebProcess/gtk/WebGtkExtensionManager.h
r139304 r139305 1 1 /* 2 * Copyright (C) 201 1Igalia S.L.2 * Copyright (C) 2012 Igalia S.L. 3 3 * 4 4 * This library is free software; you can redistribute it and/or … … 18 18 */ 19 19 20 #i nclude "config.h"21 # include "TestMain.h"20 #ifndef WebGtkExtensionManager_h 21 #define WebGtkExtensionManager_h 22 22 23 #include <gtk/gtk.h> 23 #include "Module.h" 24 #include "WKBundle.h" 25 #include <wtf/Noncopyable.h> 26 #include <wtf/Vector.h> 27 #include <wtf/gobject/GRefPtr.h> 24 28 25 void beforeAll(); 26 void afterAll(); 29 typedef struct _WebKitWebExtension WebKitWebExtension; 27 30 28 static void registerGResource(void) 29 { 30 GOwnPtr<char> resourcesPath(g_build_filename(WEBKIT_EXEC_PATH, "resources", "webkit2gtk-tests-resources.gresource", NULL)); 31 GResource* resource = g_resource_load(resourcesPath.get(), 0); 32 g_assert(resource); 33 34 g_resources_register(resource); 35 g_resource_unref(resource); 31 namespace WTF { 32 class String; 36 33 } 37 34 38 int main(int argc, char** argv) 39 { 40 gtk_test_init(&argc, &argv, 0); 41 g_setenv("WEBKIT_EXEC_PATH", WEBKIT_EXEC_PATH, FALSE); 42 g_test_bug_base("https://bugs.webkit.org/"); 35 namespace WebKit { 43 36 44 registerGResource(); 37 class WebGtkExtensionManager { 38 WTF_MAKE_NONCOPYABLE(WebGtkExtensionManager); 45 39 46 beforeAll(); 47 int returnValue = g_test_run(); 48 afterAll(); 40 public: 41 static WebGtkExtensionManager& shared(); 49 42 50 return returnValue; 51 } 43 void initialize(WKBundleRef); 44 45 private: 46 WebGtkExtensionManager(); 47 48 void appendModuleDirectories(Vector<String>&); 49 void scanModules(Vector<String>&); 50 51 Vector<Module*> m_extensionModules; 52 GRefPtr<WebKitWebExtension> m_extension; 53 }; 54 55 } // namespace WebKit 56 57 #endif // WebGtkExtensionManager_h -
trunk/Source/WebKit2/WebProcess/gtk/WebGtkInjectedBundleMain.cpp
r139304 r139305 1 1 /* 2 * Copyright (C) 201 1Igalia S.L.2 * Copyright (C) 2013 Igalia S.L. 3 3 * 4 4 * This library is free software; you can redistribute it and/or … … 19 19 20 20 #include "config.h" 21 #include "TestMain.h"22 21 23 #include <gtk/gtk.h> 22 #include "WebGtkExtensionManager.h" 23 #include <WebKit2/WKBundleInitialize.h> 24 24 25 void beforeAll(); 26 void afterAll(); 25 using namespace WebKit; 27 26 28 static void registerGResource(void) 27 #if defined(WIN32) || defined(_WIN32) 28 extern "C" __declspec(dllexport) 29 #else 30 extern "C" 31 #endif 32 void WKBundleInitialize(WKBundleRef bundle, WKTypeRef) 29 33 { 30 GOwnPtr<char> resourcesPath(g_build_filename(WEBKIT_EXEC_PATH, "resources", "webkit2gtk-tests-resources.gresource", NULL)); 31 GResource* resource = g_resource_load(resourcesPath.get(), 0); 32 g_assert(resource); 33 34 g_resources_register(resource); 35 g_resource_unref(resource); 34 WebGtkExtensionManager::shared().initialize(bundle); 36 35 } 37 38 int main(int argc, char** argv)39 {40 gtk_test_init(&argc, &argv, 0);41 g_setenv("WEBKIT_EXEC_PATH", WEBKIT_EXEC_PATH, FALSE);42 g_test_bug_base("https://bugs.webkit.org/");43 44 registerGResource();45 46 beforeAll();47 int returnValue = g_test_run();48 afterAll();49 50 return returnValue;51 } -
trunk/Source/autotools/symbols.filter
r139269 r139305 238 238 _ZN7WebCore28DocumentStyleSheetCollection14addAuthorSheetEN3WTF10PassRefPtrINS_18StyleSheetContentsEEE; 239 239 _ZN7WebCore4KURL10invalidateEv; 240 _ZN6WebKit22WebGtkExtensionManager10initializeEPK14OpaqueWKBundle; 241 _ZN6WebKit22WebGtkExtensionManager6sharedEv; 240 242 241 243 local: -
trunk/Tools/ChangeLog
r139303 r139305 1 2013-01-10 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Add support for loading web process extensions 4 https://bugs.webkit.org/show_bug.cgi?id=105631 5 6 Reviewed by Gustavo Noronha Silva. 7 8 * MiniBrowser/gtk/GNUmakefile.am: 9 * MiniBrowser/gtk/main.c: 10 (main): Set WEBKIT_INJECTED_BUNDLE env var to use the injected 11 bundle lib from build dir. 12 * Scripts/webkitpy/style/checker.py: Add exceptions for GTK+ API 13 located in WebProcess/InjectedBundle/API/gtk. 14 * gtk/generate-gtkdoc: 15 (get_webkit2_options): Scan also files in 16 WebProcess/InjectedBundle/API/gtk to generate API docs. 17 (get_webkit2_options.injected_bundle_src_path): Helper function to 18 build paths in WebProcess/InjectedBundle/API/gtk. 19 1 20 2013-01-10 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> 2 21 -
trunk/Tools/MiniBrowser/gtk/GNUmakefile.am
r115301 r139305 10 10 -I$(top_builddir)/DerivedSources/WebKit2/webkit2gtk/include \ 11 11 -DWEBKIT_EXEC_PATH=\"${shell pwd}/$(top_builddir)/Programs/\" \ 12 -DWEBKIT_INJECTED_BUNDLE_PATH=\"${shell pwd}/$(top_builddir)/.libs\" \ 12 13 $(global_cppflags) \ 13 14 $(javascriptcore_cppflags) \ -
trunk/Tools/MiniBrowser/gtk/main.c
r131072 r139305 227 227 g_setenv("WEBKIT_INSPECTOR_PATH", WEBKIT_EXEC_PATH "resources/inspector", FALSE); 228 228 #endif /* WEBKIT_EXEC_PATH */ 229 g_setenv("WEBKIT_INJECTED_BUNDLE_PATH", WEBKIT_INJECTED_BUNDLE_PATH, FALSE); 229 230 230 231 // Enable the favicon database, by specifying the default directory. -
trunk/Tools/Scripts/webkitpy/style/checker.py
r137450 r139305 181 181 ([# The GTK+ API use upper case, underscore separated, words in 182 182 # certain types of enums (e.g. signals, properties). 183 "Source/WebKit2/UIProcess/API/gtk"], 183 "Source/WebKit2/UIProcess/API/gtk", 184 "Source/WebKit2/WebProcess/InjectedBundle/API/gtk"], 184 185 ["-readability/enum_casing"]), 185 186 … … 330 331 # which differ greatly from WebKit coding style. 331 332 re.compile(r'Source/WebKit2/UIProcess/API/gtk/WebKit(?!.*Private\.h).*\.h$'), 332 'Source/WebKit2/UIProcess/API/gtk/webkit2.h'] 333 re.compile(r'Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKit(?!.*Private\.h).*\.h$'), 334 'Source/WebKit2/UIProcess/API/gtk/webkit2.h', 335 'Source/WebKit2/WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h'] 333 336 334 337 # Files to skip that are more common or obvious. -
trunk/Tools/gtk/generate-gtkdoc
r139048 r139305 78 78 def src_path(*args): 79 79 return common.top_level_path(*(('Source', 'WebKit2', 'UIProcess', 'API', 'gtk') + args)) 80 def injected_bundle_src_path(*args): 81 return common.top_level_path(*(('Source', 'WebKit2', 'WebProcess', 'InjectedBundle', 'API', 'gtk') + args)) 80 82 81 83 xref_deps = get_common_xref_deps().copy() … … 89 91 'doc_dir' : src_path('docs'), 90 92 'output_dir' : common.build_path('Documentation', 'webkit2gtk'), 91 'source_dirs' : [src_path(), derived_sources_path('webkit2gtk', 'webkit2') ],93 'source_dirs' : [src_path(), derived_sources_path('webkit2gtk', 'webkit2'), injected_bundle_src_path()], 92 94 'cflags' : ' -I' + derived_sources_path('webkit2gtk', 'include') + \ 93 95 ' -I' + derived_sources_path('webkit2gtk') + \ … … 97 99 'cross_reference_deps' : get_gtkdoc_module_paths(xref_deps), 98 100 'ignored_files': glob.glob(src_path('*Private.h')) + \ 101 glob.glob(injected_bundle_src_path('*Private.h')) + \ 99 102 glob.glob(src_path('*Client*')) + \ 100 103 glob.glob(src_path('WebKit2GtkAuthenticationDialog.*')) + \
Note: See TracChangeset
for help on using the changeset viewer.