Diff
Modified: trunk/Source/WebKit2/ChangeLog (100377 => 100378)
--- trunk/Source/WebKit2/ChangeLog 2011-11-16 01:29:22 UTC (rev 100377)
+++ trunk/Source/WebKit2/ChangeLog 2011-11-16 01:35:14 UTC (rev 100378)
@@ -1,3 +1,23 @@
+2011-11-15 Sam Weinig <s...@webkit.org>
+
+ Add a connection client to the WKContext, to notify when new connections to the WebProcess are established
+ https://bugs.webkit.org/show_bug.cgi?id=72433
+
+ Reviewed by Anders Carlsson.
+
+ * UIProcess/API/C/WKContext.cpp:
+ (WKContextSetConnectionClient):
+ * UIProcess/API/C/WKContext.h:
+ * UIProcess/WebContext.cpp:
+ (WebKit::WebContext::initializeConnectionClient):
+ * UIProcess/WebContext.h:
+ Add connection client API.
+
+ * UIProcess/WebContextConnectionClient.cpp: Added.
+ (WebKit::WebContextConnectionClient::didCreateConnection):
+ * UIProcess/WebContextConnectionClient.h: Added.
+ Add basic implementation of the client. It is currently never triggered.
+
2011-11-15 Jongseok Yang <js45.y...@samsung.com>
[SOUP][WK2] Add initial WebCookieManagerSoup.cpp for webkit2
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp (100377 => 100378)
--- trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp 2011-11-16 01:29:22 UTC (rev 100377)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp 2011-11-16 01:35:14 UTC (rev 100378)
@@ -86,6 +86,11 @@
toImpl(contextRef)->initializeDownloadClient(wkClient);
}
+void WKContextSetConnectionClient(WKContextRef contextRef, const WKContextConnectionClient* wkClient)
+{
+ toImpl(contextRef)->initializeConnectionClient(wkClient);
+}
+
WKDownloadRef WKContextDownloadURLRequest(WKContextRef contextRef, const WKURLRequestRef requestRef)
{
return toAPI(toImpl(contextRef)->download(0, toImpl(requestRef)->resourceRequest()));
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKContext.h (100377 => 100378)
--- trunk/Source/WebKit2/UIProcess/API/C/WKContext.h 2011-11-16 01:29:22 UTC (rev 100377)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKContext.h 2011-11-16 01:35:14 UTC (rev 100378)
@@ -105,6 +105,18 @@
enum { kWKContextDownloadClientCurrentVersion = 0 };
+// Connection Client
+typedef void (*WKContextDidCreateConnection)(WKContextRef context, WKConnectionRef connection, const void* clientInfo);
+
+struct WKContextConnectionClient {
+ int version;
+ const void * clientInfo;
+ WKContextDidCreateConnection didCreateConnection;
+};
+typedef struct WKContextConnectionClient WKContextConnectionClient;
+
+enum { kWKContextConnectionClientCurrentVersion = 0 };
+
WK_EXPORT WKTypeID WKContextGetTypeID();
WK_EXPORT WKContextRef WKContextCreate();
@@ -114,6 +126,7 @@
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);
+WK_EXPORT void WKContextSetConnectionClient(WKContextRef context, const WKContextConnectionClient* client);
WK_EXPORT WKDownloadRef WKContextDownloadURLRequest(WKContextRef context, const WKURLRequestRef request);
Modified: trunk/Source/WebKit2/UIProcess/WebContext.cpp (100377 => 100378)
--- trunk/Source/WebKit2/UIProcess/WebContext.cpp 2011-11-16 01:29:22 UTC (rev 100377)
+++ trunk/Source/WebKit2/UIProcess/WebContext.cpp 2011-11-16 01:35:14 UTC (rev 100378)
@@ -202,6 +202,11 @@
m_injectedBundleClient.initialize(client);
}
+void WebContext::initializeConnectionClient(const WKContextConnectionClient* client)
+{
+ m_connectionClient.initialize(client);
+}
+
void WebContext::initializeHistoryClient(const WKContextHistoryClient* client)
{
m_historyClient.initialize(client);
Modified: trunk/Source/WebKit2/UIProcess/WebContext.h (100377 => 100378)
--- trunk/Source/WebKit2/UIProcess/WebContext.h 2011-11-16 01:29:22 UTC (rev 100377)
+++ trunk/Source/WebKit2/UIProcess/WebContext.h 2011-11-16 01:35:14 UTC (rev 100378)
@@ -32,6 +32,7 @@
#include "ProcessModel.h"
#include "VisitedLinkProvider.h"
#include "WebContextInjectedBundleClient.h"
+#include "WebContextConnectionClient.h"
#include "WebDownloadClient.h"
#include "WebHistoryClient.h"
#include "WebProcessProxy.h"
@@ -74,6 +75,7 @@
static const Vector<WebContext*>& allContexts();
void initializeInjectedBundleClient(const WKContextInjectedBundleClient*);
+ void initializeConnectionClient(const WKContextConnectionClient*);
void initializeHistoryClient(const WKContextHistoryClient*);
void initializeDownloadClient(const WKContextDownloadClient*);
@@ -249,6 +251,8 @@
String m_injectedBundlePath;
WebContextInjectedBundleClient m_injectedBundleClient;
+ WebContextConnectionClient m_connectionClient;
+
WebHistoryClient m_historyClient;
PluginInfoStore m_pluginInfoStore;
Added: trunk/Source/WebKit2/UIProcess/WebContextConnectionClient.cpp (0 => 100378)
--- trunk/Source/WebKit2/UIProcess/WebContextConnectionClient.cpp (rev 0)
+++ trunk/Source/WebKit2/UIProcess/WebContextConnectionClient.cpp 2011-11-16 01:35:14 UTC (rev 100378)
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2011 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 "WebContextConnectionClient.h"
+
+#include "WKAPICast.h"
+
+namespace WebKit {
+
+void WebContextConnectionClient::didCreateConnection(WebContext* context, WebConnection* connection)
+{
+ if (!m_client.didCreateConnection)
+ return;
+
+ m_client.didCreateConnection(toAPI(context), toAPI(connection), m_client.clientInfo);
+}
+
+} // namespace WebKit
Added: trunk/Source/WebKit2/UIProcess/WebContextConnectionClient.h (0 => 100378)
--- trunk/Source/WebKit2/UIProcess/WebContextConnectionClient.h (rev 0)
+++ trunk/Source/WebKit2/UIProcess/WebContextConnectionClient.h 2011-11-16 01:35:14 UTC (rev 100378)
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2011 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 WebContextConnectionClient_h
+#define WebContextConnectionClient_h
+
+#include "APIClient.h"
+#include "WKContext.h"
+
+namespace WebKit {
+
+class WebConnection;
+class WebContext;
+
+class WebContextConnectionClient : public APIClient<WKContextConnectionClient, kWKContextConnectionClientCurrentVersion> {
+public:
+ void didCreateConnection(WebContext*, WebConnection*);
+};
+
+} // namespace WebKit
+
+#endif // WebContextConnectionClient_h