Diff
Modified: trunk/Source/WebKit2/CMakeLists.txt (138095 => 138096)
--- trunk/Source/WebKit2/CMakeLists.txt 2012-12-19 02:04:12 UTC (rev 138095)
+++ trunk/Source/WebKit2/CMakeLists.txt 2012-12-19 02:11:13 UTC (rev 138096)
@@ -254,6 +254,7 @@
UIProcess/WebColorPickerResultListenerProxy.cpp
UIProcess/WebConnectionToWebProcess.cpp
UIProcess/WebContext.cpp
+ UIProcess/WebContextClient.cpp
UIProcess/WebContextConnectionClient.cpp
UIProcess/WebContextInjectedBundleClient.cpp
UIProcess/WebContextMenuProxy.cpp
Modified: trunk/Source/WebKit2/ChangeLog (138095 => 138096)
--- trunk/Source/WebKit2/ChangeLog 2012-12-19 02:04:12 UTC (rev 138095)
+++ trunk/Source/WebKit2/ChangeLog 2012-12-19 02:11:13 UTC (rev 138096)
@@ -1,3 +1,35 @@
+2012-12-18 Jon Lee <jon...@apple.com>
+
+ [WK2] Create a context client
+ https://bugs.webkit.org/show_bug.cgi?id=105316
+ <rdar://problem/12901762>
+
+ Reviewed by Brady Eidson.
+
+ Web contexts already have clients related to downloads or history.
+ Miscellaneous callbacks can be grouped into a generic client for the
+ web context.
+
+ * UIProcess/API/C/WKContext.cpp:
+ (WKContextSetClient): Set the client for the context.
+ * UIProcess/API/C/WKContext.h: Define a new, empty WKContextClient.
+
+ * UIProcess/WebContext.cpp:
+ (WebKit::WebContext::initializeClient):
+ * UIProcess/WebContext.h: Add a variable for the new client. Move the
+ download client so that all the clients are grouped together.
+ (WebKit::WebContext::client): Returns the context client.
+ * UIProcess/WebContextClient.cpp: Added. Currently empty, but will be
+ filled out in a pending patch.
+ * UIProcess/WebContextClient.h: Added.
+
+ Add WebContextClient.{h,cpp}.
+ * CMakeLists.txt:
+ * GNUmakefile.list.am:
+ * Target.pri:
+ * WebKit2.xcodeproj/project.pbxproj:
+ * win/WebKit2.vcproj:
+
2012-12-18 Ivan Krstić <i...@apple.com>
<rdar://problem/12720539> per-pid private temporary directories for sandboxed webkit2 plugins
Modified: trunk/Source/WebKit2/GNUmakefile.list.am (138095 => 138096)
--- trunk/Source/WebKit2/GNUmakefile.list.am 2012-12-19 02:04:12 UTC (rev 138095)
+++ trunk/Source/WebKit2/GNUmakefile.list.am 2012-12-19 02:11:13 UTC (rev 138096)
@@ -858,6 +858,8 @@
Source/WebKit2/UIProcess/WebConnectionToWebProcess.h \
Source/WebKit2/UIProcess/WebContext.cpp \
Source/WebKit2/UIProcess/WebContext.h \
+ Source/WebKit2/UIProcess/WebContextClient.cpp \
+ Source/WebKit2/UIProcess/WebContextClient.h \
Source/WebKit2/UIProcess/WebContextConnectionClient.cpp \
Source/WebKit2/UIProcess/WebContextConnectionClient.h \
Source/WebKit2/UIProcess/WebContextInjectedBundleClient.cpp \
Modified: trunk/Source/WebKit2/Target.pri (138095 => 138096)
--- trunk/Source/WebKit2/Target.pri 2012-12-19 02:04:12 UTC (rev 138095)
+++ trunk/Source/WebKit2/Target.pri 2012-12-19 02:11:13 UTC (rev 138096)
@@ -245,6 +245,7 @@
UIProcess/WebColorPickerResultListenerProxy.h \
UIProcess/WebConnectionToWebProcess.h \
UIProcess/WebContext.h \
+ UIProcess/WebContextClient.h \
UIProcess/WebContextConnectionClient.h \
UIProcess/WebContextInjectedBundleClient.h \
UIProcess/WebContextMenuProxy.h \
@@ -607,6 +608,7 @@
UIProcess/WebColorPickerResultListenerProxy.cpp \
UIProcess/WebConnectionToWebProcess.cpp \
UIProcess/WebContext.cpp \
+ UIProcess/WebContextClient.cpp \
UIProcess/WebContextConnectionClient.cpp \
UIProcess/WebContextInjectedBundleClient.cpp \
UIProcess/WebContextMenuProxy.cpp \
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp (138095 => 138096)
--- trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp 2012-12-19 02:04:12 UTC (rev 138095)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp 2012-12-19 02:11:13 UTC (rev 138096)
@@ -62,6 +62,11 @@
return toAPI(context.release().leakRef());
}
+void WKContextSetClient(WKContextRef contextRef, const WKContextClient* wkClient)
+{
+ toImpl(contextRef)->initializeClient(wkClient);
+}
+
void WKContextSetInjectedBundleClient(WKContextRef contextRef, const WKContextInjectedBundleClient* wkClient)
{
toImpl(contextRef)->initializeInjectedBundleClient(wkClient);
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKContext.h (138095 => 138096)
--- trunk/Source/WebKit2/UIProcess/API/C/WKContext.h 2012-12-19 02:04:12 UTC (rev 138095)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKContext.h 2012-12-19 02:11:13 UTC (rev 138096)
@@ -39,6 +39,15 @@
};
typedef uint32_t WKCacheModel;
+// Context Client
+struct WKContextClient {
+ int version;
+ const void * clientInfo;
+};
+typedef struct WKContextClient WKContextClient;
+
+enum { kWKContextClientCurrentVersion = 0 };
+
// Injected Bundle Client
typedef void (*WKContextDidReceiveMessageFromInjectedBundleCallback)(WKContextRef page, WKStringRef messageName, WKTypeRef messageBody, const void *clientInfo);
typedef void (*WKContextDidReceiveSynchronousMessageFromInjectedBundleCallback)(WKContextRef page, WKStringRef messageName, WKTypeRef messageBody, WKTypeRef* returnData, const void *clientInfo);
@@ -134,6 +143,7 @@
WK_EXPORT WKContextRef WKContextCreate();
WK_EXPORT WKContextRef WKContextCreateWithInjectedBundlePath(WKStringRef path);
+WK_EXPORT void WKContextSetClient(WKContextRef context, const WKContextClient* client);
WK_EXPORT void WKContextSetInjectedBundleClient(WKContextRef context, const WKContextInjectedBundleClient* client);
WK_EXPORT void WKContextSetHistoryClient(WKContextRef context, const WKContextHistoryClient* client);
WK_EXPORT void WKContextSetDownloadClient(WKContextRef context, const WKContextDownloadClient* client);
Modified: trunk/Source/WebKit2/UIProcess/WebContext.cpp (138095 => 138096)
--- trunk/Source/WebKit2/UIProcess/WebContext.cpp 2012-12-19 02:04:12 UTC (rev 138095)
+++ trunk/Source/WebKit2/UIProcess/WebContext.cpp 2012-12-19 02:11:13 UTC (rev 138096)
@@ -260,6 +260,11 @@
#endif
}
+void WebContext::initializeClient(const WKContextClient* client)
+{
+ m_client.initialize(client);
+}
+
void WebContext::initializeInjectedBundleClient(const WKContextInjectedBundleClient* client)
{
m_injectedBundleClient.initialize(client);
Modified: trunk/Source/WebKit2/UIProcess/WebContext.h (138095 => 138096)
--- trunk/Source/WebKit2/UIProcess/WebContext.h 2012-12-19 02:04:12 UTC (rev 138095)
+++ trunk/Source/WebKit2/UIProcess/WebContext.h 2012-12-19 02:11:13 UTC (rev 138096)
@@ -35,6 +35,7 @@
#include "PluginInfoStore.h"
#include "ProcessModel.h"
#include "VisitedLinkProvider.h"
+#include "WebContextClient.h"
#include "WebContextConnectionClient.h"
#include "WebContextInjectedBundleClient.h"
#include "WebDownloadClient.h"
@@ -102,6 +103,7 @@
bool dispatchMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
bool dispatchSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);
+ void initializeClient(const WKContextClient*);
void initializeInjectedBundleClient(const WKContextInjectedBundleClient*);
void initializeConnectionClient(const WKContextConnectionClient*);
void initializeHistoryClient(const WKContextHistoryClient*);
@@ -186,6 +188,7 @@
WebDownloadClient& downloadClient() { return m_downloadClient; }
WebHistoryClient& historyClient() { return m_historyClient; }
+ WebContextClient& client() { return m_client; }
static HashSet<String, CaseFoldingHash> pdfAndPostScriptMIMETypes();
@@ -367,8 +370,9 @@
String m_injectedBundlePath;
WebContextInjectedBundleClient m_injectedBundleClient;
+ WebContextClient m_client;
WebContextConnectionClient m_connectionClient;
-
+ WebDownloadClient m_downloadClient;
WebHistoryClient m_historyClient;
#if ENABLE(NETSCAPE_PLUGIN_API)
@@ -398,8 +402,6 @@
CacheModel m_cacheModel;
- WebDownloadClient m_downloadClient;
-
bool m_memorySamplerEnabled;
double m_memorySamplerInterval;
Added: trunk/Source/WebKit2/UIProcess/WebContextClient.cpp (0 => 138096)
--- trunk/Source/WebKit2/UIProcess/WebContextClient.cpp (rev 0)
+++ trunk/Source/WebKit2/UIProcess/WebContextClient.cpp 2012-12-19 02:11:13 UTC (rev 138096)
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebContextClient.h"
+
+namespace WebKit {
+
+} // namespace WebKit
Added: trunk/Source/WebKit2/UIProcess/WebContextClient.h (0 => 138096)
--- trunk/Source/WebKit2/UIProcess/WebContextClient.h (rev 0)
+++ trunk/Source/WebKit2/UIProcess/WebContextClient.h 2012-12-19 02:11:13 UTC (rev 138096)
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebContextClient_h
+#define WebContextClient_h
+
+#include "APIClient.h"
+#include "WKContext.h"
+
+namespace WebKit {
+
+class WebContextClient : public APIClient<WKContextClient, kWKContextClientCurrentVersion> {
+};
+
+} // namespace WebKit
+
+#endif // WebContextClient_h
Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (138095 => 138096)
--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj 2012-12-19 02:04:12 UTC (rev 138095)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj 2012-12-19 02:11:13 UTC (rev 138096)
@@ -323,6 +323,8 @@
31A2EC5614899C0900810D71 /* NotificationPermissionRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 31A2EC531489982500810D71 /* NotificationPermissionRequest.h */; };
31A2EC74148D59CA00810D71 /* WKNotificationPermissionRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 31A2EC72148D59BB00810D71 /* WKNotificationPermissionRequest.h */; settings = {ATTRIBUTES = (Private, ); }; };
31A2EC77148D662E00810D71 /* WKNotificationPermissionRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31A2EC75148D65BB00810D71 /* WKNotificationPermissionRequest.cpp */; };
+ 31A505F91680025500A930EB /* WebContextClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31A505F71680025500A930EB /* WebContextClient.cpp */; };
+ 31A505FA1680025500A930EB /* WebContextClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 31A505F81680025500A930EB /* WebContextClient.h */; };
31A67E0C165B2A99006CBA66 /* PlugInAutoStartProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31A67E0A165B2A99006CBA66 /* PlugInAutoStartProvider.cpp */; };
31A67E0D165B2A99006CBA66 /* PlugInAutoStartProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 31A67E0B165B2A99006CBA66 /* PlugInAutoStartProvider.h */; };
31BA924D148831260062EDB5 /* WebNotificationManagerMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31BA9248148830810062EDB5 /* WebNotificationManagerMessageReceiver.cpp */; };
@@ -1551,6 +1553,8 @@
31A2EC541489982E00810D71 /* NotificationPermissionRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NotificationPermissionRequest.cpp; sourceTree = "<group>"; };
31A2EC72148D59BB00810D71 /* WKNotificationPermissionRequest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKNotificationPermissionRequest.h; sourceTree = "<group>"; };
31A2EC75148D65BB00810D71 /* WKNotificationPermissionRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKNotificationPermissionRequest.cpp; sourceTree = "<group>"; };
+ 31A505F71680025500A930EB /* WebContextClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebContextClient.cpp; sourceTree = "<group>"; };
+ 31A505F81680025500A930EB /* WebContextClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebContextClient.h; sourceTree = "<group>"; };
31A67E0A165B2A99006CBA66 /* PlugInAutoStartProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlugInAutoStartProvider.cpp; sourceTree = "<group>"; };
31A67E0B165B2A99006CBA66 /* PlugInAutoStartProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlugInAutoStartProvider.h; sourceTree = "<group>"; };
31BA9248148830810062EDB5 /* WebNotificationManagerMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebNotificationManagerMessageReceiver.cpp; sourceTree = "<group>"; };
@@ -3518,6 +3522,8 @@
BCB9E2421120DACA00A137E0 /* WebContext.cpp */,
BCB9E2411120DACA00A137E0 /* WebContext.h */,
BCEE7D0912846AED009827DA /* WebContext.messages.in */,
+ 31A505F71680025500A930EB /* WebContextClient.cpp */,
+ 31A505F81680025500A930EB /* WebContextClient.h */,
BC09B8F6147460F7005F5625 /* WebContextConnectionClient.cpp */,
BC09B8F7147460F7005F5625 /* WebContextConnectionClient.h */,
BCDE059A11CDA8AE00E41AF1 /* WebContextInjectedBundleClient.cpp */,
@@ -5016,6 +5022,7 @@
31D5929F166E060000E6BF02 /* WebPlugInClient.h in Headers */,
1AD25E96167AB08100EA9BCD /* DownloadProxyMap.h in Headers */,
2989A414167D184B004F96D2 /* CustomProtocolManager.h in Headers */,
+ 31A505FA1680025500A930EB /* WebContextClient.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -5990,6 +5997,7 @@
1AD25E95167AB08100EA9BCD /* DownloadProxyMap.cpp in Sources */,
BCF18638167D071E00A1A85A /* CacheModel.cpp in Sources */,
2989A411167D1834004F96D2 /* CustomProtocolManagerMac.mm in Sources */,
+ 31A505F91680025500A930EB /* WebContextClient.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Modified: trunk/Source/WebKit2/win/WebKit2.vcproj (138095 => 138096)
--- trunk/Source/WebKit2/win/WebKit2.vcproj 2012-12-19 02:04:12 UTC (rev 138095)
+++ trunk/Source/WebKit2/win/WebKit2.vcproj 2012-12-19 02:11:13 UTC (rev 138096)
@@ -2963,6 +2963,14 @@
>
</File>
<File
+ RelativePath="..\UIProcess\WebContextClient.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\UIProcess\WebContextClient.h"
+ >
+ </File>
+ <File
RelativePath="..\UIProcess\WebContextConnectionClient.cpp"
>
</File>