Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add support for the WebExtensions

  • Loading branch information...
commit 68ab7095e2772e48e605a9501c29705fdf957bb4 1 parent 860f602
@mrobinson authored
View
1  Source/WebKit2/CMakeLists.txt
@@ -704,6 +704,7 @@ add_library(WebKit2 ${WebKit2_LIBRARY_TYPE} ${WebKit2_SOURCES})
add_dependencies(WebKit2 WebCore)
add_dependencies(WebKit2 ${WEBKIT2_EXTRA_DEPENDENCIES})
+add_dependencies(WebKit2 GObjectDOMBindings)
target_link_libraries(WebKit2 ${WebKit2_LIBRARIES})
set_target_properties(WebKit2 PROPERTIES FOLDER "WebKit")
set_target_properties(WebKit2 PROPERTIES LINK_INTERFACE_LIBRARIES "")
View
29 Source/WebKit2/PlatformGTK.cmake
@@ -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)
@@ -361,6 +362,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}"
)
@@ -383,6 +385,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"
@@ -432,6 +435,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
)
@@ -444,6 +452,7 @@ set(WEBKIT2_EXTRA_DEPENDENCIES
fake-installed-headers
gtk-forwarding-headers
soup-forwarding-headers
+ fake-installed-webextension-headers
)
if (ENABLE_PLUGIN_PROCESS)
@@ -468,3 +477,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)
View
4 Source/WebKit2/WebProcess/gtk/WebGtkExtensionManager.h
@@ -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();
Please sign in to comment.
Something went wrong with that request. Please try again.