summaryrefslogtreecommitdiff
path: root/Source/WebKit2/WebProcess
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit2/WebProcess')
-rw-r--r--Source/WebKit2/WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp3
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp5
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h1
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp12
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h1
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebPage.cpp2
-rw-r--r--Source/WebKit2/WebProcess/mac/WebProcessMac.mm6
-rw-r--r--Source/WebKit2/WebProcess/mac/WebProcessServiceEntryPoints.h (renamed from Source/WebKit2/WebProcess/mac/WebProcessXPCServiceMain.h)15
-rw-r--r--Source/WebKit2/WebProcess/mac/WebProcessServiceEntryPoints.mm (renamed from Source/WebKit2/WebProcess/mac/WebProcessXPCServiceMain.mm)20
9 files changed, 34 insertions, 31 deletions
diff --git a/Source/WebKit2/WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp b/Source/WebKit2/WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp
index d6bdb8e15..7013fcdc6 100644
--- a/Source/WebKit2/WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp
+++ b/Source/WebKit2/WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp
@@ -73,8 +73,9 @@ void GeolocationPermissionRequestManager::cancelRequestForGeolocation(Geolocatio
if (it == m_geolocationToIDMap.end())
return;
+ uint64_t geolocationID = it->second;
m_geolocationToIDMap.remove(it);
- m_idToGeolocationMap.remove(it->second);
+ m_idToGeolocationMap.remove(geolocationID);
}
void GeolocationPermissionRequestManager::didReceiveGeolocationPermissionDecision(uint64_t geolocationID, bool allowed)
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp
index 276f7d3cb..2085253ba 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp
+++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp
@@ -162,11 +162,6 @@ void WKBundleSetPluginsEnabled(WKBundleRef bundleRef, WKBundlePageGroupRef pageG
toImpl(bundleRef)->setPluginsEnabled(toImpl(pageGroupRef), enabled);
}
-void WKBundleSetGeolocationPermission(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, bool enabled)
-{
- toImpl(bundleRef)->setGeoLocationPermission(toImpl(pageGroupRef), enabled);
-}
-
void WKBundleSetJavaScriptCanAccessClipboard(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, bool enabled)
{
toImpl(bundleRef)->setJavaScriptCanAccessClipboard(toImpl(pageGroupRef), enabled);
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h
index 3a1512aaf..f032c6222 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h
+++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h
@@ -60,7 +60,6 @@ WK_EXPORT void WKBundleSetAllowFileAccessFromFileURLs(WKBundleRef bundle, WKBund
WK_EXPORT void WKBundleSetMinimumLogicalFontSize(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, int size);
WK_EXPORT void WKBundleSetFrameFlatteningEnabled(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
WK_EXPORT void WKBundleSetPluginsEnabled(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
-WK_EXPORT void WKBundleSetGeolocationPermission(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
WK_EXPORT void WKBundleSetJavaScriptCanAccessClipboard(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
WK_EXPORT void WKBundleSetPrivateBrowsingEnabled(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
WK_EXPORT void WKBundleSetPopupBlockingEnabled(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
index 206f47ee6..470d39b17 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
+++ b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
@@ -248,18 +248,6 @@ void InjectedBundle::setPluginsEnabled(WebPageGroupProxy* pageGroup, bool enable
(*iter)->settings()->setPluginsEnabled(enabled);
}
-void InjectedBundle::setGeoLocationPermission(WebPageGroupProxy* pageGroup, bool enabled)
-{
-#if ENABLE(GEOLOCATION)
- const HashSet<Page*>& pages = PageGroup::pageGroup(pageGroup->identifier())->pages();
- for (HashSet<Page*>::iterator iter = pages.begin(); iter != pages.end(); ++iter)
- static_cast<GeolocationClientMock*>(GeolocationController::from(*iter)->client())->setPermission(enabled);
-#else
- UNUSED_PARAM(pageGroup);
- UNUSED_PARAM(enabled);
-#endif // ENABLE(GEOLOCATION)
-}
-
void InjectedBundle::setJavaScriptCanAccessClipboard(WebPageGroupProxy* pageGroup, bool enabled)
{
const HashSet<Page*>& pages = PageGroup::pageGroup(pageGroup->identifier())->pages();
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h
index 404a50593..1197256d5 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h
+++ b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h
@@ -111,7 +111,6 @@ public:
void setMinimumLogicalFontSize(WebPageGroupProxy*, int size);
void setFrameFlatteningEnabled(WebPageGroupProxy*, bool);
void setPluginsEnabled(WebPageGroupProxy*, bool);
- void setGeoLocationPermission(WebPageGroupProxy*, bool);
void setJavaScriptCanAccessClipboard(WebPageGroupProxy*, bool);
void setPrivateBrowsingEnabled(WebPageGroupProxy*, bool);
void setPopupBlockingEnabled(WebPageGroupProxy*, bool);
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
index 750983169..b6143e649 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -2795,7 +2795,7 @@ void WebPage::SandboxExtensionTracker::willPerformLoadDragDestinationAction(Pass
void WebPage::SandboxExtensionTracker::beginLoad(WebFrame* frame, const SandboxExtension::Handle& handle)
{
- ASSERT(frame->isMainFrame());
+ ASSERT_UNUSED(frame, frame->isMainFrame());
setPendingProvisionalSandboxExtension(SandboxExtension::create(handle));
}
diff --git a/Source/WebKit2/WebProcess/mac/WebProcessMac.mm b/Source/WebKit2/WebProcess/mac/WebProcessMac.mm
index 1ac69ce81..738e0d881 100644
--- a/Source/WebKit2/WebProcess/mac/WebProcessMac.mm
+++ b/Source/WebKit2/WebProcess/mac/WebProcessMac.mm
@@ -203,10 +203,12 @@ void WebProcess::initializeSandbox(const String& clientIdentifier)
setenv("TMPDIR", temporaryDirectory, 1);
#endif
+ NSBundle *webkit2Bundle = [NSBundle bundleForClass:NSClassFromString(@"WKView")];
+
Vector<const char*> sandboxParameters;
// These are read-only.
- appendReadonlySandboxDirectory(sandboxParameters, "WEBKIT2_FRAMEWORK_DIR", [[[NSBundle bundleForClass:NSClassFromString(@"WKView")] bundlePath] stringByDeletingLastPathComponent]);
+ appendReadonlySandboxDirectory(sandboxParameters, "WEBKIT2_FRAMEWORK_DIR", [[webkit2Bundle bundlePath] stringByDeletingLastPathComponent]);
// These are read-write getconf paths.
appendReadwriteConfDirectory(sandboxParameters, "DARWIN_USER_TEMP_DIR", _CS_DARWIN_USER_TEMP_DIR);
@@ -217,7 +219,7 @@ void WebProcess::initializeSandbox(const String& clientIdentifier)
sandboxParameters.append(static_cast<const char*>(0));
- const char* profilePath = [[[NSBundle mainBundle] pathForResource:@"com.apple.WebProcess" ofType:@"sb"] fileSystemRepresentation];
+ const char* profilePath = [[webkit2Bundle pathForResource:@"com.apple.WebProcess" ofType:@"sb"] fileSystemRepresentation];
char* errorBuf;
if (sandbox_init_with_parameters(profilePath, SANDBOX_NAMED_EXTERNAL, sandboxParameters.data(), &errorBuf)) {
diff --git a/Source/WebKit2/WebProcess/mac/WebProcessXPCServiceMain.h b/Source/WebKit2/WebProcess/mac/WebProcessServiceEntryPoints.h
index ff3feb029..949154a57 100644
--- a/Source/WebKit2/WebProcess/mac/WebProcessXPCServiceMain.h
+++ b/Source/WebKit2/WebProcess/mac/WebProcessServiceEntryPoints.h
@@ -23,8 +23,8 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WebProcessXPCServiceMain_h
-#define WebProcessXPCServiceMain_h
+#ifndef WebProcessServiceEntryPoints_h
+#define WebProcessServiceEntryPoints_h
#if HAVE(XPC)
@@ -34,7 +34,14 @@
extern "C" {
#endif
-WK_EXPORT int WebProcessXPCServiceMain(int argc, char** argv);
+// This entry point is used for the installed WebProcessService, which does not
+// need to be re-execed, or mess around with DYLD.
+WK_EXPORT int WebProcessServiceMain(int argc, char** argv);
+
+// This entry point is used for the WebProcessServiceForWebKitDevelopment
+// which needs to be re-exec, and can't link directly to WebKit2 requiring
+// some DYLD fiddling.
+WK_EXPORT void InitializeWebProcessForWebProcessServiceForWebKitDevelopment(const char* clientIdentifer, xpc_connection_t connection, mach_port_t serverPort);
#ifdef __cplusplus
}; // extern "C"
@@ -42,4 +49,4 @@ WK_EXPORT int WebProcessXPCServiceMain(int argc, char** argv);
#endif // HAVE(XPC)
-#endif // WebProcessXPCServiceMain_h
+#endif // WebProcessServiceEntryPoints_h
diff --git a/Source/WebKit2/WebProcess/mac/WebProcessXPCServiceMain.mm b/Source/WebKit2/WebProcess/mac/WebProcessServiceEntryPoints.mm
index b870f1d12..f282fb462 100644
--- a/Source/WebKit2/WebProcess/mac/WebProcessXPCServiceMain.mm
+++ b/Source/WebKit2/WebProcess/mac/WebProcessServiceEntryPoints.mm
@@ -24,12 +24,15 @@
*/
#import "config.h"
-#import "WebProcessXPCServiceMain.h"
+#import "WebProcessServiceEntryPoints.h"
#if HAVE(XPC)
#import "EnvironmentUtilities.h"
#import "WebProcessInitialization.h"
+
+#import "EnvironmentUtilities.h"
+#import "WebProcessInitialization.h"
#import <stdio.h>
#import <stdlib.h>
#import <xpc/xpc.h>
@@ -38,7 +41,7 @@ extern "C" mach_port_t xpc_dictionary_copy_mach_send(xpc_object_t, const char*);
namespace WebKit {
-static void WebKit2ServiceEventHandler(xpc_connection_t peer)
+static void WebProcessServiceEventHandler(xpc_connection_t peer)
{
xpc_connection_set_target_queue(peer, dispatch_get_main_queue());
xpc_connection_set_event_handler(peer, ^(xpc_object_t event) {
@@ -67,14 +70,23 @@ static void WebKit2ServiceEventHandler(xpc_connection_t peer)
} // namespace WebKit
-int WebProcessXPCServiceMain(int argc, char** argv)
+int WebProcessServiceMain(int argc, char** argv)
{
// Remove the WebProcess shim from the DYLD_INSERT_LIBRARIES environment variable so any processes spawned by
// the WebProcess don't try to insert the shim and crash.
WebKit::EnvironmentUtilities::stripValuesEndingWithString("DYLD_INSERT_LIBRARIES", "/WebProcessShim.dylib");
- xpc_main(WebKit::WebKit2ServiceEventHandler);
+ xpc_main(WebKit::WebProcessServiceEventHandler);
return 0;
}
+void InitializeWebProcessForWebProcessServiceForWebKitDevelopment(const char* clientIdentifer, xpc_connection_t connection, mach_port_t serverPort)
+{
+ // Remove the WebProcess shim from the DYLD_INSERT_LIBRARIES environment variable so any processes spawned by
+ // the WebProcess don't try to insert the shim and crash.
+ WebKit::EnvironmentUtilities::stripValuesEndingWithString("DYLD_INSERT_LIBRARIES", "/WebProcessShim.dylib");
+
+ WebKit::InitializeWebProcess(String(clientIdentifer), CoreIPC::Connection::Identifier(serverPort, connection));
+}
+
#endif // HAVE(XPC)