[GTK] [CMake] Add support for building the WebKit injected bundle
authormrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Dec 2013 16:43:25 +0000 (16:43 +0000)
committermrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Dec 2013 16:43:25 +0000 (16:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=116373

Reviewed by Gustavo Noronha Silva.

* PlatformGTK.cmake: Add support for building the InjectedBundle and link the WebKit2
shared library against the GObject DOM bindings.
* WebProcess/gtk/WebGtkExtensionManager.h: Properly export symbols used by the InjectedBundle.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160368 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/PlatformGTK.cmake
Source/WebKit2/WebProcess/gtk/WebGtkExtensionManager.h

index 31f02ad..929bc70 100644 (file)
@@ -1,3 +1,14 @@
+2013-12-10  Martin Robinson  <mrobinson@igalia.com>
+
+        [GTK] [CMake] Add support for building the WebKit injected bundle
+        https://bugs.webkit.org/show_bug.cgi?id=116373
+
+        Reviewed by Gustavo Noronha Silva.
+
+        * PlatformGTK.cmake: Add support for building the InjectedBundle and link the WebKit2
+        shared library against the GObject DOM bindings.
+        * WebProcess/gtk/WebGtkExtensionManager.h: Properly export symbols used by the InjectedBundle.
+
 2013-12-10  Kwang Yul Seo  <skyul@company100.net>
 
         [WK2][SOUP] WebContext::setIgnoreTLSErrors should send SetIgnoreTLSErrors to the network process when network process is enabled
index 0e63f35..1e073fd 100644 (file)
@@ -1,3 +1,4 @@
+set(DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR ${DERIVED_SOURCES_DIR}/webkitdom)
 set(DERIVED_SOURCES_WEBKIT2GTK_DIR ${DERIVED_SOURCES_DIR}/webkit2gtk)
 set(WEBKIT2_BUILT_API_DIR ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/webkit2)
 set(WEBKIT2_FORWARDING_HEADERS_DIR ${DERIVED_SOURCES_DIR}/ForwardingHeaders/webkit2gtk)
@@ -363,6 +364,7 @@ list(APPEND WebKit2_MESSAGES_IN_FILES
 # This is necessary because of a conflict between the GTK+ API WebKitVersion.h and one generated by WebCore.
 list(INSERT WebKit2_INCLUDE_DIRECTORIES 0
     "${WEBKIT2_FORWARDING_HEADERS_DIR}"
+    "${WEBKIT2_FORWARDING_HEADERS_DIR}/webkit2extension"
     "${WEBKIT2_BUILT_API_DIR}"
     "${DERIVED_SOURCES_WEBKIT2GTK_DIR}"
 )
@@ -385,6 +387,7 @@ list(APPEND WebKit2_INCLUDE_DIRECTORIES
     "${WEBKIT2_DIR}/UIProcess/API/gtk"
     "${WEBKIT2_DIR}/UIProcess/gtk"
     "${WEBKIT2_DIR}/UIProcess/soup"
+    "${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk"
     "${WEBKIT2_DIR}/WebProcess/gtk"
     "${WEBKIT2_DIR}/WebProcess/soup"
     "${WEBKIT2_DIR}/WebProcess/WebCoreSupport/gtk"
@@ -434,6 +437,11 @@ add_custom_target(fake-installed-headers
     COMMAND ln -n -s -f ${WEBKIT2_DIR}/UIProcess/API/gtk ${WEBKIT2_FORWARDING_HEADERS_DIR}/webkit2
 )
 
+add_custom_target(fake-installed-webextension-headers
+    mkdir -p ${WEBKIT2_FORWARDING_HEADERS_DIR}/webkit2extension
+    COMMAND ln -n -s -f ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk ${WEBKIT2_FORWARDING_HEADERS_DIR}/webkit2extension/webkit2
+)
+
 add_custom_target(gtk-forwarding-headers
     COMMAND ${PERL_EXECUTABLE} ${WEBKIT2_DIR}/Scripts/generate-forwarding-headers.pl ${WEBKIT2_DIR} ${DERIVED_SOURCES_WEBKIT2_DIR}/include gtk
 )
@@ -446,6 +454,7 @@ set(WEBKIT2_EXTRA_DEPENDENCIES
      fake-installed-headers
      gtk-forwarding-headers
      soup-forwarding-headers
+     fake-installed-webextension-headers
 )
 
 if (ENABLE_PLUGIN_PROCESS)
@@ -470,3 +479,23 @@ if (ENABLE_PLUGIN_PROCESS)
     target_link_libraries(${PluginProcess_EXECUTABLE_NAME} ${PluginProcess_LIBRARIES})
     install(TARGETS ${PluginProcess_EXECUTABLE_NAME} DESTINATION "${EXEC_INSTALL_DIR}")
 endif () # ENABLE_PLUGIN_PROCESS
+
+# Commands for building the built-in injected bundle.
+include_directories(
+    "${WEBKIT2_DIR}/Platform"
+    "${WEBKIT2_DIR}/Shared"
+    "${WEBKIT2_DIR}/Shared/API/c"
+    "${WEBKIT2_DIR}/UIProcess/API/C"
+    "${WEBKIT2_DIR}/WebProcess/InjectedBundle"
+    "${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/c"
+    "${DERIVED_SOURCES_DIR}"
+    "${DERIVED_SOURCES_DIR}/InjectedBundle"
+    "${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}"
+    "${DERIVED_SOURCES_WEBKIT2_DIR}/include"
+)
+
+add_library(webkit2gtkinjectedbundle MODULE
+    "${WEBKIT2_DIR}/WebProcess/gtk/WebGtkInjectedBundleMain.cpp"
+)
+add_dependencies(webkit2gtkinjectedbundle GObjectDOMBindings)
+list(APPEND WebKit2_LIBRARIES GObjectDOMBindings)
index 30f6de1..d72d45a 100644 (file)
@@ -38,9 +38,9 @@ class WebGtkExtensionManager {
     WTF_MAKE_NONCOPYABLE(WebGtkExtensionManager);
 
 public:
-    static WebGtkExtensionManager& shared();
+    WK_EXPORT static WebGtkExtensionManager& shared();
 
-    void initialize(WKBundleRef, WKTypeRef);
+    WK_EXPORT void initialize(WKBundleRef, WKTypeRef);
 
 private:
     WebGtkExtensionManager();