Convert more classes to be WebContextSupplements
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Jan 2013 04:19:28 +0000 (04:19 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Jan 2013 04:19:28 +0000 (04:19 +0000)
https://bugs.webkit.org/show_bug.cgi?id=105890

Reviewed by Dan Bernstein.

* UIProcess/API/C/WKContext.cpp:
(WKContextGetCookieManager):
(WKContextGetDatabaseManager):
(WKContextGetGeolocationManager):
(WKContextGetKeyValueStorageManager):
(WKContextGetMediaCacheManager):
(WKContextGetNotificationManager):
(WKContextGetResourceCacheManager):
* UIProcess/API/efl/ewk_context.cpp:
(EwkContext::cookieManager):
(EwkContext::clearResourceCache):
* UIProcess/API/efl/ewk_database_manager_private.h:
(EwkDatabaseManager::create):
* UIProcess/API/efl/ewk_storage_manager_private.h:
(EwkStorageManager::create):
* UIProcess/API/gtk/WebKitWebContext.cpp:
(createDefaultWebContext):
(webkit_web_context_clear_cache):
(webkit_web_context_get_cookie_manager):
* UIProcess/Notifications/WebNotificationManagerProxy.cpp:
(WebKit::WebNotificationManagerProxy::supplementName):
(WebKit):
(WebKit::WebNotificationManagerProxy::WebNotificationManagerProxy):
(WebKit::WebNotificationManagerProxy::initializeProvider):
(WebKit::WebNotificationManagerProxy::contextDestroyed):
(WebKit::WebNotificationManagerProxy::processDidClose):
(WebKit::WebNotificationManagerProxy::refWebContextSupplement):
(WebKit::WebNotificationManagerProxy::derefWebContextSupplement):
(WebKit::WebNotificationManagerProxy::didReceiveMessage):
(WebKit::WebNotificationManagerProxy::providerDidShowNotification):
(WebKit::WebNotificationManagerProxy::providerDidClickNotification):
(WebKit::WebNotificationManagerProxy::providerDidCloseNotifications):
(WebKit::WebNotificationManagerProxy::providerDidUpdateNotificationPolicy):
(WebKit::WebNotificationManagerProxy::providerDidRemoveNotificationPolicies):
* UIProcess/Notifications/WebNotificationManagerProxy.h:
(WebNotificationManagerProxy):
* UIProcess/WebContext.cpp:
(WebKit::WebContext::WebContext):
(WebKit::WebContext::~WebContext):
(WebKit::WebContext::removeNetworkProcessProxy):
(WebKit::WebContext::createNewWebProcess):
(WebKit::WebContext::shouldTerminate):
(WebKit::WebContext::disconnectProcess):
* UIProcess/WebContext.h:
(WebKit):
(WebContext):
(WebKit::WebContext::iconDatabase):
* UIProcess/WebContextSupplement.h:
(WebKit):
(WebKit::WebContextSupplement::contextDestroyed):
(WebKit::WebContextSupplement::processDidClose):
(WebContextSupplement):
(WebKit::WebContextSupplement::shouldTerminate):
(WebKit::WebContextSupplement::ref):
(WebKit::WebContextSupplement::deref):
* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::supplementName):
(WebKit):
(WebKit::WebCookieManagerProxy::WebCookieManagerProxy):
(WebKit::WebCookieManagerProxy::initializeClient):
(WebKit::WebCookieManagerProxy::contextDestroyed):
(WebKit::WebCookieManagerProxy::processDidClose):
(WebKit::WebCookieManagerProxy::shouldTerminate):
(WebKit::WebCookieManagerProxy::refWebContextSupplement):
(WebKit::WebCookieManagerProxy::derefWebContextSupplement):
(WebKit::WebCookieManagerProxy::getHostnamesWithCookies):
(WebKit::WebCookieManagerProxy::deleteCookiesForHostname):
(WebKit::WebCookieManagerProxy::deleteAllCookies):
(WebKit::WebCookieManagerProxy::startObservingCookieChanges):
(WebKit::WebCookieManagerProxy::stopObservingCookieChanges):
(WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
(WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
* UIProcess/WebCookieManagerProxy.h:
(WebCookieManagerProxy):
* UIProcess/WebDatabaseManagerProxy.cpp:
(WebKit::WebDatabaseManagerProxy::supplementName):
(WebKit):
(WebKit::WebDatabaseManagerProxy::WebDatabaseManagerProxy):
(WebKit::WebDatabaseManagerProxy::initializeClient):
(WebKit::WebDatabaseManagerProxy::contextDestroyed):
(WebKit::WebDatabaseManagerProxy::processDidClose):
(WebKit::WebDatabaseManagerProxy::refWebContextSupplement):
(WebKit::WebDatabaseManagerProxy::derefWebContextSupplement):
(WebKit::WebDatabaseManagerProxy::didReceiveMessage):
(WebKit::WebDatabaseManagerProxy::getDatabasesByOrigin):
(WebKit::WebDatabaseManagerProxy::getDatabaseOrigins):
(WebKit::WebDatabaseManagerProxy::deleteDatabaseWithNameForOrigin):
(WebKit::WebDatabaseManagerProxy::deleteDatabasesForOrigin):
(WebKit::WebDatabaseManagerProxy::deleteAllDatabases):
(WebKit::WebDatabaseManagerProxy::setQuotaForOrigin):
* UIProcess/WebDatabaseManagerProxy.h:
(WebDatabaseManagerProxy):
* UIProcess/WebGeolocationManagerProxy.cpp:
(WebKit::WebGeolocationManagerProxy::supplementName):
(WebKit):
(WebKit::WebGeolocationManagerProxy::WebGeolocationManagerProxy):
(WebKit::WebGeolocationManagerProxy::initializeProvider):
(WebKit::WebGeolocationManagerProxy::contextDestroyed):
(WebKit::WebGeolocationManagerProxy::processDidClose):
(WebKit::WebGeolocationManagerProxy::refWebContextSupplement):
(WebKit::WebGeolocationManagerProxy::derefWebContextSupplement):
(WebKit::WebGeolocationManagerProxy::didReceiveMessage):
(WebKit::WebGeolocationManagerProxy::providerDidChangePosition):
(WebKit::WebGeolocationManagerProxy::providerDidFailToDeterminePosition):
* UIProcess/WebGeolocationManagerProxy.h:
(WebGeolocationManagerProxy):
* UIProcess/WebKeyValueStorageManagerProxy.cpp:
(WebKit::WebKeyValueStorageManagerProxy::supplementName):
(WebKit):
(WebKit::WebKeyValueStorageManagerProxy::WebKeyValueStorageManagerProxy):
(WebKit::WebKeyValueStorageManagerProxy::contextDestroyed):
(WebKit::WebKeyValueStorageManagerProxy::processDidClose):
(WebKit::WebKeyValueStorageManagerProxy::refWebContextSupplement):
(WebKit::WebKeyValueStorageManagerProxy::derefWebContextSupplement):
(WebKit::WebKeyValueStorageManagerProxy::getKeyValueStorageOrigins):
(WebKit::WebKeyValueStorageManagerProxy::deleteEntriesForOrigin):
(WebKit::WebKeyValueStorageManagerProxy::deleteAllEntries):
* UIProcess/WebKeyValueStorageManagerProxy.h:
(WebKeyValueStorageManagerProxy):
* UIProcess/WebMediaCacheManagerProxy.cpp:
(WebKit::WebMediaCacheManagerProxy::supplementName):
(WebKit):
(WebKit::WebMediaCacheManagerProxy::WebMediaCacheManagerProxy):
(WebKit::WebMediaCacheManagerProxy::contextDestroyed):
(WebKit::WebMediaCacheManagerProxy::processDidClose):
(WebKit::WebMediaCacheManagerProxy::refWebContextSupplement):
(WebKit::WebMediaCacheManagerProxy::derefWebContextSupplement):
(WebKit::WebMediaCacheManagerProxy::getHostnamesWithMediaCache):
(WebKit::WebMediaCacheManagerProxy::clearCacheForHostname):
(WebKit::WebMediaCacheManagerProxy::clearCacheForAllHostnames):
* UIProcess/WebMediaCacheManagerProxy.h:
(WebMediaCacheManagerProxy):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::showNotification):
* UIProcess/WebResourceCacheManagerProxy.cpp:
(WebKit::WebResourceCacheManagerProxy::supplementName):
(WebKit):
(WebKit::WebResourceCacheManagerProxy::WebResourceCacheManagerProxy):
(WebKit::WebResourceCacheManagerProxy::contextDestroyed):
(WebKit::WebResourceCacheManagerProxy::processDidClose):
(WebKit::WebResourceCacheManagerProxy::refWebContextSupplement):
(WebKit::WebResourceCacheManagerProxy::derefWebContextSupplement):
(WebKit::WebResourceCacheManagerProxy::didReceiveMessage):
(WebKit::WebResourceCacheManagerProxy::getCacheOrigins):
(WebKit::WebResourceCacheManagerProxy::clearCacheForOrigin):
(WebKit::WebResourceCacheManagerProxy::clearCacheForAllOrigins):
* UIProcess/WebResourceCacheManagerProxy.h:
(WebResourceCacheManagerProxy):
* UIProcess/efl/WebContextEfl.cpp:
(WebKit::WebContext::platformInitializeWebProcess):
* UIProcess/gtk/WebContextGtk.cpp:
(WebKit::WebContext::platformInitializeWebProcess):
* UIProcess/qt/WebContextQt.cpp:
(WebKit::WebContext::platformInitializeWebProcess):

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

28 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/C/WKContext.cpp
Source/WebKit2/UIProcess/API/efl/ewk_context.cpp
Source/WebKit2/UIProcess/API/efl/ewk_database_manager_private.h
Source/WebKit2/UIProcess/API/efl/ewk_storage_manager_private.h
Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp
Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp
Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.h
Source/WebKit2/UIProcess/WebContext.cpp
Source/WebKit2/UIProcess/WebContext.h
Source/WebKit2/UIProcess/WebContextSupplement.h
Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp
Source/WebKit2/UIProcess/WebCookieManagerProxy.h
Source/WebKit2/UIProcess/WebDatabaseManagerProxy.cpp
Source/WebKit2/UIProcess/WebDatabaseManagerProxy.h
Source/WebKit2/UIProcess/WebGeolocationManagerProxy.cpp
Source/WebKit2/UIProcess/WebGeolocationManagerProxy.h
Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.cpp
Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.h
Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.cpp
Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.cpp
Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.h
Source/WebKit2/UIProcess/efl/WebContextEfl.cpp
Source/WebKit2/UIProcess/gtk/WebContextGtk.cpp
Source/WebKit2/UIProcess/qt/WebContextQt.cpp
Source/WebKit2/UIProcess/soup/WebCookieManagerProxySoup.cpp

index 19e02cc..ef04601 100644 (file)
@@ -1,3 +1,165 @@
+2012-12-31  Sam Weinig  <sam@webkit.org>
+
+        Convert more classes to be WebContextSupplements
+        https://bugs.webkit.org/show_bug.cgi?id=105890
+
+        Reviewed by Dan Bernstein.
+
+        * UIProcess/API/C/WKContext.cpp:
+        (WKContextGetCookieManager):
+        (WKContextGetDatabaseManager):
+        (WKContextGetGeolocationManager):
+        (WKContextGetKeyValueStorageManager):
+        (WKContextGetMediaCacheManager):
+        (WKContextGetNotificationManager):
+        (WKContextGetResourceCacheManager):
+        * UIProcess/API/efl/ewk_context.cpp:
+        (EwkContext::cookieManager):
+        (EwkContext::clearResourceCache):
+        * UIProcess/API/efl/ewk_database_manager_private.h:
+        (EwkDatabaseManager::create):
+        * UIProcess/API/efl/ewk_storage_manager_private.h:
+        (EwkStorageManager::create):
+        * UIProcess/API/gtk/WebKitWebContext.cpp:
+        (createDefaultWebContext):
+        (webkit_web_context_clear_cache):
+        (webkit_web_context_get_cookie_manager):
+        * UIProcess/Notifications/WebNotificationManagerProxy.cpp:
+        (WebKit::WebNotificationManagerProxy::supplementName):
+        (WebKit):
+        (WebKit::WebNotificationManagerProxy::WebNotificationManagerProxy):
+        (WebKit::WebNotificationManagerProxy::initializeProvider):
+        (WebKit::WebNotificationManagerProxy::contextDestroyed):
+        (WebKit::WebNotificationManagerProxy::processDidClose):
+        (WebKit::WebNotificationManagerProxy::refWebContextSupplement):
+        (WebKit::WebNotificationManagerProxy::derefWebContextSupplement):
+        (WebKit::WebNotificationManagerProxy::didReceiveMessage):
+        (WebKit::WebNotificationManagerProxy::providerDidShowNotification):
+        (WebKit::WebNotificationManagerProxy::providerDidClickNotification):
+        (WebKit::WebNotificationManagerProxy::providerDidCloseNotifications):
+        (WebKit::WebNotificationManagerProxy::providerDidUpdateNotificationPolicy):
+        (WebKit::WebNotificationManagerProxy::providerDidRemoveNotificationPolicies):
+        * UIProcess/Notifications/WebNotificationManagerProxy.h:
+        (WebNotificationManagerProxy):
+        * UIProcess/WebContext.cpp:
+        (WebKit::WebContext::WebContext):
+        (WebKit::WebContext::~WebContext):
+        (WebKit::WebContext::removeNetworkProcessProxy):
+        (WebKit::WebContext::createNewWebProcess):
+        (WebKit::WebContext::shouldTerminate):
+        (WebKit::WebContext::disconnectProcess):
+        * UIProcess/WebContext.h:
+        (WebKit):
+        (WebContext):
+        (WebKit::WebContext::iconDatabase):
+        * UIProcess/WebContextSupplement.h:
+        (WebKit):
+        (WebKit::WebContextSupplement::contextDestroyed):
+        (WebKit::WebContextSupplement::processDidClose):
+        (WebContextSupplement):
+        (WebKit::WebContextSupplement::shouldTerminate):
+        (WebKit::WebContextSupplement::ref):
+        (WebKit::WebContextSupplement::deref):
+        * UIProcess/WebCookieManagerProxy.cpp:
+        (WebKit::WebCookieManagerProxy::supplementName):
+        (WebKit):
+        (WebKit::WebCookieManagerProxy::WebCookieManagerProxy):
+        (WebKit::WebCookieManagerProxy::initializeClient):
+        (WebKit::WebCookieManagerProxy::contextDestroyed):
+        (WebKit::WebCookieManagerProxy::processDidClose):
+        (WebKit::WebCookieManagerProxy::shouldTerminate):
+        (WebKit::WebCookieManagerProxy::refWebContextSupplement):
+        (WebKit::WebCookieManagerProxy::derefWebContextSupplement):
+        (WebKit::WebCookieManagerProxy::getHostnamesWithCookies):
+        (WebKit::WebCookieManagerProxy::deleteCookiesForHostname):
+        (WebKit::WebCookieManagerProxy::deleteAllCookies):
+        (WebKit::WebCookieManagerProxy::startObservingCookieChanges):
+        (WebKit::WebCookieManagerProxy::stopObservingCookieChanges):
+        (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
+        (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
+        * UIProcess/WebCookieManagerProxy.h:
+        (WebCookieManagerProxy):
+        * UIProcess/WebDatabaseManagerProxy.cpp:
+        (WebKit::WebDatabaseManagerProxy::supplementName):
+        (WebKit):
+        (WebKit::WebDatabaseManagerProxy::WebDatabaseManagerProxy):
+        (WebKit::WebDatabaseManagerProxy::initializeClient):
+        (WebKit::WebDatabaseManagerProxy::contextDestroyed):
+        (WebKit::WebDatabaseManagerProxy::processDidClose):
+        (WebKit::WebDatabaseManagerProxy::refWebContextSupplement):
+        (WebKit::WebDatabaseManagerProxy::derefWebContextSupplement):
+        (WebKit::WebDatabaseManagerProxy::didReceiveMessage):
+        (WebKit::WebDatabaseManagerProxy::getDatabasesByOrigin):
+        (WebKit::WebDatabaseManagerProxy::getDatabaseOrigins):
+        (WebKit::WebDatabaseManagerProxy::deleteDatabaseWithNameForOrigin):
+        (WebKit::WebDatabaseManagerProxy::deleteDatabasesForOrigin):
+        (WebKit::WebDatabaseManagerProxy::deleteAllDatabases):
+        (WebKit::WebDatabaseManagerProxy::setQuotaForOrigin):
+        * UIProcess/WebDatabaseManagerProxy.h:
+        (WebDatabaseManagerProxy):
+        * UIProcess/WebGeolocationManagerProxy.cpp:
+        (WebKit::WebGeolocationManagerProxy::supplementName):
+        (WebKit):
+        (WebKit::WebGeolocationManagerProxy::WebGeolocationManagerProxy):
+        (WebKit::WebGeolocationManagerProxy::initializeProvider):
+        (WebKit::WebGeolocationManagerProxy::contextDestroyed):
+        (WebKit::WebGeolocationManagerProxy::processDidClose):
+        (WebKit::WebGeolocationManagerProxy::refWebContextSupplement):
+        (WebKit::WebGeolocationManagerProxy::derefWebContextSupplement):
+        (WebKit::WebGeolocationManagerProxy::didReceiveMessage):
+        (WebKit::WebGeolocationManagerProxy::providerDidChangePosition):
+        (WebKit::WebGeolocationManagerProxy::providerDidFailToDeterminePosition):
+        * UIProcess/WebGeolocationManagerProxy.h:
+        (WebGeolocationManagerProxy):
+        * UIProcess/WebKeyValueStorageManagerProxy.cpp:
+        (WebKit::WebKeyValueStorageManagerProxy::supplementName):
+        (WebKit):
+        (WebKit::WebKeyValueStorageManagerProxy::WebKeyValueStorageManagerProxy):
+        (WebKit::WebKeyValueStorageManagerProxy::contextDestroyed):
+        (WebKit::WebKeyValueStorageManagerProxy::processDidClose):
+        (WebKit::WebKeyValueStorageManagerProxy::refWebContextSupplement):
+        (WebKit::WebKeyValueStorageManagerProxy::derefWebContextSupplement):
+        (WebKit::WebKeyValueStorageManagerProxy::getKeyValueStorageOrigins):
+        (WebKit::WebKeyValueStorageManagerProxy::deleteEntriesForOrigin):
+        (WebKit::WebKeyValueStorageManagerProxy::deleteAllEntries):
+        * UIProcess/WebKeyValueStorageManagerProxy.h:
+        (WebKeyValueStorageManagerProxy):
+        * UIProcess/WebMediaCacheManagerProxy.cpp:
+        (WebKit::WebMediaCacheManagerProxy::supplementName):
+        (WebKit):
+        (WebKit::WebMediaCacheManagerProxy::WebMediaCacheManagerProxy):
+        (WebKit::WebMediaCacheManagerProxy::contextDestroyed):
+        (WebKit::WebMediaCacheManagerProxy::processDidClose):
+        (WebKit::WebMediaCacheManagerProxy::refWebContextSupplement):
+        (WebKit::WebMediaCacheManagerProxy::derefWebContextSupplement):
+        (WebKit::WebMediaCacheManagerProxy::getHostnamesWithMediaCache):
+        (WebKit::WebMediaCacheManagerProxy::clearCacheForHostname):
+        (WebKit::WebMediaCacheManagerProxy::clearCacheForAllHostnames):
+        * UIProcess/WebMediaCacheManagerProxy.h:
+        (WebMediaCacheManagerProxy):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::showNotification):
+        * UIProcess/WebResourceCacheManagerProxy.cpp:
+        (WebKit::WebResourceCacheManagerProxy::supplementName):
+        (WebKit):
+        (WebKit::WebResourceCacheManagerProxy::WebResourceCacheManagerProxy):
+        (WebKit::WebResourceCacheManagerProxy::contextDestroyed):
+        (WebKit::WebResourceCacheManagerProxy::processDidClose):
+        (WebKit::WebResourceCacheManagerProxy::refWebContextSupplement):
+        (WebKit::WebResourceCacheManagerProxy::derefWebContextSupplement):
+        (WebKit::WebResourceCacheManagerProxy::didReceiveMessage):
+        (WebKit::WebResourceCacheManagerProxy::getCacheOrigins):
+        (WebKit::WebResourceCacheManagerProxy::clearCacheForOrigin):
+        (WebKit::WebResourceCacheManagerProxy::clearCacheForAllOrigins):
+        * UIProcess/WebResourceCacheManagerProxy.h:
+        (WebResourceCacheManagerProxy):
+        * UIProcess/efl/WebContextEfl.cpp:
+        (WebKit::WebContext::platformInitializeWebProcess):
+        * UIProcess/gtk/WebContextGtk.cpp:
+        (WebKit::WebContext::platformInitializeWebProcess):
+        * UIProcess/qt/WebContextQt.cpp:
+        (WebKit::WebContext::platformInitializeWebProcess):
+
 2013-01-01  Dan Bernstein  <mitz@apple.com>
 
         <rdar://problem/12942239> Update copyright strings
index b1fa13b..5c838fe 100644 (file)
@@ -28,7 +28,6 @@
 #include "WKContextPrivate.h"
 
 #include "WKAPICast.h"
-#include "WebApplicationCacheManagerProxy.h"
 #include "WebContext.h"
 #include "WebURLRequest.h"
 #include <wtf/PassRefPtr.h>
 #include <wtf/UnusedParam.h>
 #include <wtf/text/WTFString.h>
 
+// Supplements
+#include "WebApplicationCacheManagerProxy.h"
+#include "WebCookieManagerProxy.h"
+#include "WebGeolocationManagerProxy.h"
+#include "WebKeyValueStorageManagerProxy.h"
+#include "WebMediaCacheManagerProxy.h"
+#include "WebNotificationManagerProxy.h"
+#include "WebResourceCacheManagerProxy.h"
+#if ENABLE(SQL_DATABASE)
+#include "WebDatabaseManagerProxy.h"
+#endif
+
 using namespace WebKit;
 
 extern "C" {
@@ -184,7 +195,7 @@ void WKContextSetDomainRelaxationForbiddenForURLScheme(WKContextRef contextRef,
 
 WKCookieManagerRef WKContextGetCookieManager(WKContextRef contextRef)
 {
-    return toAPI(toImpl(contextRef)->cookieManagerProxy());
+    return toAPI(toImpl(contextRef)->supplement<WebCookieManagerProxy>());
 }
 
 WKApplicationCacheManagerRef WKContextGetApplicationCacheManager(WKContextRef contextRef)
@@ -204,7 +215,7 @@ WKBatteryManagerRef WKContextGetBatteryManager(WKContextRef contextRef)
 WKDatabaseManagerRef WKContextGetDatabaseManager(WKContextRef contextRef)
 {
 #if ENABLE(SQL_DATABASE)
-    return toAPI(toImpl(contextRef)->databaseManagerProxy());
+    return toAPI(toImpl(contextRef)->supplement<WebDatabaseManagerProxy>());
 #else
     return 0;
 #endif
@@ -212,7 +223,7 @@ WKDatabaseManagerRef WKContextGetDatabaseManager(WKContextRef contextRef)
 
 WKGeolocationManagerRef WKContextGetGeolocationManager(WKContextRef contextRef)
 {
-    return toAPI(toImpl(contextRef)->geolocationManagerProxy());
+    return toAPI(toImpl(contextRef)->supplement<WebGeolocationManagerProxy>());
 }
 
 WKNetworkInfoManagerRef WKContextGetNetworkInfoManager(WKContextRef contextRef)
@@ -231,17 +242,17 @@ WKIconDatabaseRef WKContextGetIconDatabase(WKContextRef contextRef)
 
 WKKeyValueStorageManagerRef WKContextGetKeyValueStorageManager(WKContextRef contextRef)
 {
-    return toAPI(toImpl(contextRef)->keyValueStorageManagerProxy());
+    return toAPI(toImpl(contextRef)->supplement<WebKeyValueStorageManagerProxy>());
 }
 
 WKMediaCacheManagerRef WKContextGetMediaCacheManager(WKContextRef contextRef)
 {
-    return toAPI(toImpl(contextRef)->mediaCacheManagerProxy());
+    return toAPI(toImpl(contextRef)->supplement<WebMediaCacheManagerProxy>());
 }
 
 WKNotificationManagerRef WKContextGetNotificationManager(WKContextRef contextRef)
 {
-    return toAPI(toImpl(contextRef)->notificationManagerProxy());
+    return toAPI(toImpl(contextRef)->supplement<WebNotificationManagerProxy>());
 }
 
 WKPluginSiteDataManagerRef WKContextGetPluginSiteDataManager(WKContextRef contextRef)
@@ -255,7 +266,7 @@ WKPluginSiteDataManagerRef WKContextGetPluginSiteDataManager(WKContextRef contex
 
 WKResourceCacheManagerRef WKContextGetResourceCacheManager(WKContextRef contextRef)
 {
-    return toAPI(toImpl(contextRef)->resourceCacheManagerProxy());
+    return toAPI(toImpl(contextRef)->supplement<WebResourceCacheManagerProxy>());
 }
 
 void WKContextStartMemorySampler(WKContextRef contextRef, WKDoubleRef interval)
index 9e728ee..ab1d8a5 100644 (file)
@@ -31,6 +31,7 @@
 #include "WKRetainPtr.h"
 #include "WKString.h"
 #include "WebContext.h"
+#include "WebCookieManagerProxy.h"
 #include "WebIconDatabase.h"
 #include "WebResourceCacheManagerProxy.h"
 #include "WebSoupRequestManagerProxy.h"
@@ -135,7 +136,7 @@ PassRefPtr<EwkContext> EwkContext::defaultContext()
 EwkCookieManager* EwkContext::cookieManager()
 {
     if (!m_cookieManager)
-        m_cookieManager = EwkCookieManager::create(m_context->cookieManagerProxy());
+        m_cookieManager = EwkCookieManager::create(m_context->supplement<WebCookieManagerProxy>());
 
     return m_cookieManager.get();
 }
@@ -211,7 +212,7 @@ void EwkContext::setAdditionalPluginPath(const String& path)
 
 void EwkContext::clearResourceCache()
 {
-    m_context->resourceCacheManagerProxy()->clearCacheForAllOrigins(AllResourceCaches);
+    m_context->supplement<WebResourceCacheManagerProxy>()->clearCacheForAllOrigins(AllResourceCaches);
 }
 
 Ewk_Cookie_Manager* ewk_context_cookie_manager_get(const Ewk_Context* ewkContext)
index 8270968..da8a2a0 100644 (file)
@@ -40,7 +40,7 @@ public:
     static PassOwnPtr<EwkDatabaseManager> create(PassRefPtr<WebContext> context)
     {
         ASSERT(context);
-        return adoptPtr(new EwkDatabaseManager(context->databaseManagerProxy()));
+        return adoptPtr(new EwkDatabaseManager(context->supplement<WebDatabaseManagerProxy>()));
     }
 
     Eina_List* createOriginList(WKArrayRef wkList) const;
index 0ec5cc8..71a88c6 100644 (file)
@@ -40,7 +40,7 @@ public:
     static PassOwnPtr<EwkStorageManager> create(PassRefPtr<WebContext> context)
     {
         ASSERT(context);
-        return adoptPtr(new EwkStorageManager(context->keyValueStorageManagerProxy()));
+        return adoptPtr(new EwkStorageManager(context->supplement<WebKeyValueStorageManagerProxy>()));
     }
 
     Eina_List* createOriginList(WKArrayRef wkList) const;
index 576a1b4..d19b993 100644 (file)
@@ -20,6 +20,8 @@
 #include "config.h"
 #include "WebKitWebContext.h"
 
+#include "WebCookieManagerProxy.h"
+#include "WebGeolocationManagerProxy.h"
 #include "WebKitCookieManagerPrivate.h"
 #include "WebKitDownloadClient.h"
 #include "WebKitDownloadPrivate.h"
@@ -178,7 +180,7 @@ static gpointer createDefaultWebContext(gpointer)
     attachRequestManagerClientToContext(webContext.get());
 
 #if ENABLE(GEOLOCATION)
-    priv->geolocationProvider = WebKitGeolocationProvider::create(priv->context->geolocationManagerProxy());
+    priv->geolocationProvider = WebKitGeolocationProvider::create(priv->context->supplement<WebGeolocationManagerProxy>());
 #endif
 #if ENABLE(SPELLCHECK)
     priv->textChecker = WebKitTextChecker::create();
@@ -286,7 +288,7 @@ void webkit_web_context_clear_cache(WebKitWebContext* context)
 {
     g_return_if_fail(WEBKIT_IS_WEB_CONTEXT(context));
 
-    context->priv->context->resourceCacheManagerProxy()->clearCacheForAllOrigins(AllResourceCaches);
+    context->priv->context->supplement<WebResourceCacheManagerProxy>()->clearCacheForAllOrigins(AllResourceCaches);
 }
 
 typedef HashMap<DownloadProxy*, GRefPtr<WebKitDownload> > DownloadsMap;
@@ -332,7 +334,7 @@ WebKitCookieManager* webkit_web_context_get_cookie_manager(WebKitWebContext* con
 
     WebKitWebContextPrivate* priv = context->priv;
     if (!priv->cookieManager)
-        priv->cookieManager = adoptGRef(webkitCookieManagerCreate(priv->context->cookieManagerProxy()));
+        priv->cookieManager = adoptGRef(webkitCookieManagerCreate(priv->context->supplement<WebCookieManagerProxy>()));
 
     return priv->cookieManager.get();
 }
index 9dfe29b..9b0fddc 100644 (file)
@@ -40,26 +40,56 @@ using namespace WebCore;
 
 namespace WebKit {
 
+const AtomicString& WebNotificationManagerProxy::supplementName()
+{
+    DEFINE_STATIC_LOCAL(AtomicString, name, ("WebNotificationManagerProxy", AtomicString::ConstructFromLiteral));
+    return name;
+}
+
 PassRefPtr<WebNotificationManagerProxy> WebNotificationManagerProxy::create(WebContext* context)
 {
     return adoptRef(new WebNotificationManagerProxy(context));
 }
 
 WebNotificationManagerProxy::WebNotificationManagerProxy(WebContext* context)
-    : m_context(context)
+    : WebContextSupplement(context)
+{
+    WebContextSupplement::context()->addMessageReceiver(Messages::WebNotificationManagerProxy::messageReceiverName(), this);
+}
+
+void WebNotificationManagerProxy::initializeProvider(const WKNotificationProvider *provider)
 {
-    m_context->addMessageReceiver(Messages::WebNotificationManagerProxy::messageReceiverName(), this);
+    m_provider.initialize(provider);
+    m_provider.addNotificationManager(this);
 }
 
-void WebNotificationManagerProxy::invalidate()
+// WebContextSupplement
+
+void WebNotificationManagerProxy::contextDestroyed()
 {
     m_provider.removeNotificationManager(this);
 }
 
-void WebNotificationManagerProxy::initializeProvider(const WKNotificationProvider *provider)
+void WebNotificationManagerProxy::processDidClose(WebProcessProxy*)
 {
-    m_provider.initialize(provider);
-    m_provider.addNotificationManager(this);
+    m_provider.removeNotificationManager(this);
+}
+
+void WebNotificationManagerProxy::refWebContextSupplement()
+{
+    APIObject::ref();
+}
+
+void WebNotificationManagerProxy::derefWebContextSupplement()
+{
+    APIObject::deref();
+}
+
+// CoreIPC::MessageReceiver
+
+void WebNotificationManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
+{
+    didReceiveWebNotificationManagerProxyMessage(connection, messageID, decoder);
 }
 
 void WebNotificationManagerProxy::populateCopyOfNotificationPermissions(HashMap<String, bool>& permissions)
@@ -73,11 +103,6 @@ void WebNotificationManagerProxy::populateCopyOfNotificationPermissions(HashMap<
     }
 }
 
-void WebNotificationManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
-{
-    didReceiveWebNotificationManagerProxyMessage(connection, messageID, decoder);
-}
-
 void WebNotificationManagerProxy::show(WebPageProxy* page, const String& title, const String& body, const String& iconURL, const String& tag, const String& lang, const String& dir, const String& originString, uint64_t notificationID)
 {
     if (!isNotificationIDValid(notificationID))
@@ -122,24 +147,24 @@ void WebNotificationManagerProxy::clearNotifications(const Vector<uint64_t>& not
 
 void WebNotificationManagerProxy::providerDidShowNotification(uint64_t notificationID)
 {
-    if (!m_context)
+    if (!context())
         return;
     
-    m_context->sendToAllProcesses(Messages::WebNotificationManager::DidShowNotification(notificationID));
+    context()->sendToAllProcesses(Messages::WebNotificationManager::DidShowNotification(notificationID));
 }
 
 void WebNotificationManagerProxy::providerDidClickNotification(uint64_t notificationID)
 {
-    if (!m_context)
+    if (!context())
         return;
     
-    m_context->sendToAllProcesses(Messages::WebNotificationManager::DidClickNotification(notificationID));
+    context()->sendToAllProcesses(Messages::WebNotificationManager::DidClickNotification(notificationID));
 }
 
 
 void WebNotificationManagerProxy::providerDidCloseNotifications(ImmutableArray* notificationIDs)
 {
-    if (!m_context)
+    if (!context())
         return;
     
     size_t size = notificationIDs->size();
@@ -153,20 +178,20 @@ void WebNotificationManagerProxy::providerDidCloseNotifications(ImmutableArray*
     }
     
     if (vectorNotificationIDs.size())
-        m_context->sendToAllProcesses(Messages::WebNotificationManager::DidCloseNotifications(vectorNotificationIDs));
+        context()->sendToAllProcesses(Messages::WebNotificationManager::DidCloseNotifications(vectorNotificationIDs));
 }
 
 void WebNotificationManagerProxy::providerDidUpdateNotificationPolicy(const WebSecurityOrigin* origin, bool allowed)
 {
-    if (!m_context)
+    if (!context())
         return;
 
-    m_context->sendToAllProcesses(Messages::WebNotificationManager::DidUpdateNotificationDecision(origin->toString(), allowed));
+    context()->sendToAllProcesses(Messages::WebNotificationManager::DidUpdateNotificationDecision(origin->toString(), allowed));
 }
 
 void WebNotificationManagerProxy::providerDidRemoveNotificationPolicies(ImmutableArray* origins)
 {
-    if (!m_context)
+    if (!context())
         return;
 
     size_t size = origins->size();
@@ -179,7 +204,7 @@ void WebNotificationManagerProxy::providerDidRemoveNotificationPolicies(Immutabl
     for (size_t i = 0; i < size; ++i)
         originStrings.append(origins->at<WebSecurityOrigin>(i)->toString());
     
-    m_context->sendToAllProcesses(Messages::WebNotificationManager::DidRemoveNotificationDecisions(originStrings));
+    context()->sendToAllProcesses(Messages::WebNotificationManager::DidRemoveNotificationDecisions(originStrings));
 }
 
 } // namespace WebKit
index d543387..62ab203 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "APIObject.h"
 #include "MessageReceiver.h"
+#include "WebContextSupplement.h"
 #include "WebNotificationProvider.h"
 #include <WebCore/NotificationClient.h>
 #include <wtf/HashMap.h>
@@ -42,14 +43,13 @@ class WebContext;
 class WebPageProxy;
 class WebSecurityOrigin;
 
-class WebNotificationManagerProxy : public APIObject, private CoreIPC::MessageReceiver {
+class WebNotificationManagerProxy : public APIObject, public WebContextSupplement, private CoreIPC::MessageReceiver {
 public:
     static const Type APIType = TypeNotificationManager;
-    
+
+    static const AtomicString& supplementName();
+
     static PassRefPtr<WebNotificationManagerProxy> create(WebContext*);
-    
-    void invalidate();
-    void clearContext() { m_context = 0; }
 
     void initializeProvider(const WKNotificationProvider*);
     void populateCopyOfNotificationPermissions(HashMap<String, bool>&);
@@ -61,12 +61,21 @@ public:
     void providerDidCloseNotifications(ImmutableArray* notificationIDs);
     void providerDidUpdateNotificationPolicy(const WebSecurityOrigin*, bool allowed);
     void providerDidRemoveNotificationPolicies(ImmutableArray* origins);
-    
+
+    using APIObject::ref;
+    using APIObject::deref;
+
 private:
     explicit WebNotificationManagerProxy(WebContext*);
     
     virtual Type type() const { return APIType; }
 
+    // WebContextSupplement
+    virtual void contextDestroyed() OVERRIDE;
+    virtual void processDidClose(WebProcessProxy*) OVERRIDE;
+    virtual void refWebContextSupplement() OVERRIDE;
+    virtual void derefWebContextSupplement() OVERRIDE;
+
     // CoreIPC::MessageReceiver
     virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE;
     void didReceiveWebNotificationManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
@@ -78,7 +87,6 @@ private:
 
     typedef HashMap<uint64_t, RefPtr<WebNotification> > WebNotificationMap;
     
-    WebContext* m_context;
     WebNotificationProvider m_provider;
     WebNotificationMap m_notifications;
 };
index 22caffa..4bb7d9d 100644 (file)
@@ -160,27 +160,26 @@ WebContext::WebContext(ProcessModel processModel, const String& injectedBundlePa
 #if ENABLE(BATTERY_STATUS)
     m_batteryManagerProxy = WebBatteryManagerProxy::create(this);
 #endif
-    m_cookieManagerProxy = WebCookieManagerProxy::create(this);
-#if ENABLE(SQL_DATABASE)
-    m_databaseManagerProxy = WebDatabaseManagerProxy::create(this);
-#endif
-    m_geolocationManagerProxy = WebGeolocationManagerProxy::create(this);
-    m_iconDatabase = WebIconDatabase::create(this);
-    m_keyValueStorageManagerProxy = WebKeyValueStorageManagerProxy::create(this);
-    m_mediaCacheManagerProxy = WebMediaCacheManagerProxy::create(this);
 #if ENABLE(NETWORK_INFO)
     m_networkInfoManagerProxy = WebNetworkInfoManagerProxy::create(this);
 #endif
-    m_notificationManagerProxy = WebNotificationManagerProxy::create(this);
 #if ENABLE(NETSCAPE_PLUGIN_API)
     m_pluginSiteDataManager = WebPluginSiteDataManager::create(this);
 #endif // ENABLE(NETSCAPE_PLUGIN_API)
-    m_resourceCacheManagerProxy = WebResourceCacheManagerProxy::create(this);
 #if USE(SOUP)
     m_soupRequestManagerProxy = WebSoupRequestManagerProxy::create(this);
 #endif
 
     addSupplement<WebApplicationCacheManagerProxy>();
+    addSupplement<WebCookieManagerProxy>();
+    addSupplement<WebGeolocationManagerProxy>();
+    addSupplement<WebKeyValueStorageManagerProxy>();
+    addSupplement<WebMediaCacheManagerProxy>();
+    addSupplement<WebNotificationManagerProxy>();
+    addSupplement<WebResourceCacheManagerProxy>();
+#if ENABLE(SQL_DATABASE)
+    addSupplement<WebDatabaseManagerProxy>();
+#endif
 
     contexts().append(this);
 
@@ -223,42 +222,19 @@ WebContext::~WebContext()
     m_batteryManagerProxy->clearContext();
 #endif
 
-    m_cookieManagerProxy->invalidate();
-    m_cookieManagerProxy->clearContext();
-
-#if ENABLE(SQL_DATABASE)
-    m_databaseManagerProxy->invalidate();
-    m_databaseManagerProxy->clearContext();
-#endif
-    
-    m_geolocationManagerProxy->invalidate();
-    m_geolocationManagerProxy->clearContext();
-
     m_iconDatabase->invalidate();
     m_iconDatabase->clearContext();
     
-    m_keyValueStorageManagerProxy->invalidate();
-    m_keyValueStorageManagerProxy->clearContext();
-
-    m_mediaCacheManagerProxy->invalidate();
-    m_mediaCacheManagerProxy->clearContext();
-
 #if ENABLE(NETWORK_INFO)
     m_networkInfoManagerProxy->invalidate();
     m_networkInfoManagerProxy->clearContext();
 #endif
-    
-    m_notificationManagerProxy->invalidate();
-    m_notificationManagerProxy->clearContext();
 
 #if ENABLE(NETSCAPE_PLUGIN_API)
     m_pluginSiteDataManager->invalidate();
     m_pluginSiteDataManager->clearContext();
 #endif
 
-    m_resourceCacheManagerProxy->invalidate();
-    m_resourceCacheManagerProxy->clearContext();
-
 #if USE(SOUP)
     m_soupRequestManagerProxy->invalidate();
     m_soupRequestManagerProxy->clearContext();
@@ -410,10 +386,13 @@ void WebContext::removeNetworkProcessProxy(NetworkProcessProxy* networkProcessPr
 {
     ASSERT(m_networkProcess);
     ASSERT(networkProcessProxy == m_networkProcess.get());
-    
-    m_networkProcess = nullptr;
 
-    m_cookieManagerProxy->invalidate();
+    WebContextSupplementMap::const_iterator it = m_supplements.begin();
+    WebContextSupplementMap::const_iterator end = m_supplements.end();
+    for (; it != end; ++it)
+        it->value->processDidClose(networkProcessProxy);
+
+    m_networkProcess = nullptr;
 }
 
 void WebContext::getNetworkProcessConnection(PassRefPtr<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply> reply)
@@ -530,7 +509,8 @@ WebProcessProxy* WebContext::createNewWebProcess()
     parameters.defaultRequestTimeoutInterval = WebURLRequest::defaultTimeoutInterval();
 
 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
-    m_notificationManagerProxy->populateCopyOfNotificationPermissions(parameters.notificationPermissions);
+    // FIXME: There should be a generic way for supplements to add to the intialization parameters.
+    supplement<WebNotificationManagerProxy>()->populateCopyOfNotificationPermissions(parameters.notificationPermissions);
 #endif
 
 #if ENABLE(NETWORK_PROCESS)
@@ -604,22 +584,10 @@ bool WebContext::shouldTerminate(WebProcessProxy* process)
             return false;
     }
 
-    if (!m_cookieManagerProxy->shouldTerminate(process))
-        return false;
-#if ENABLE(SQL_DATABASE)
-    if (!m_databaseManagerProxy->shouldTerminate(process))
-        return false;
-#endif
-    if (!m_keyValueStorageManagerProxy->shouldTerminate(process))
-        return false;
-    if (!m_mediaCacheManagerProxy->shouldTerminate(process))
-        return false;
 #if ENABLE(NETSCAPE_PLUGIN_API)
     if (!m_pluginSiteDataManager->shouldTerminate(process))
         return false;
 #endif
-    if (!m_resourceCacheManagerProxy->shouldTerminate(process))
-        return false;
 
     return true;
 }
@@ -669,18 +637,9 @@ void WebContext::disconnectProcess(WebProcessProxy* process)
 #if ENABLE(BATTERY_STATUS)
     m_batteryManagerProxy->invalidate();
 #endif
-    m_cookieManagerProxy->invalidate();
-#if ENABLE(SQL_DATABASE)
-    m_databaseManagerProxy->invalidate();
-#endif
-    m_geolocationManagerProxy->invalidate();
-    m_keyValueStorageManagerProxy->invalidate();
-    m_mediaCacheManagerProxy->invalidate();
 #if ENABLE(NETWORK_INFO)
     m_networkInfoManagerProxy->invalidate();
 #endif
-    m_notificationManagerProxy->invalidate();
-    m_resourceCacheManagerProxy->invalidate();
 #if USE(SOUP)
     m_soupRequestManagerProxy->invalidate();
 #endif
index 937be7c..ff023e5 100644 (file)
@@ -59,16 +59,9 @@ namespace WebKit {
 
 class DownloadProxy;
 class WebContextSupplement;
-class WebCookieManagerProxy;
-class WebDatabaseManagerProxy;
-class WebGeolocationManagerProxy;
 class WebIconDatabase;
-class WebKeyValueStorageManagerProxy;
-class WebMediaCacheManagerProxy;
-class WebNotificationManagerProxy;
 class WebPageGroup;
 class WebPageProxy;
-class WebResourceCacheManagerProxy;
 struct StatisticsData;
 struct WebProcessCreationParameters;
     
@@ -216,22 +209,13 @@ public:
 #if ENABLE(BATTERY_STATUS)
     WebBatteryManagerProxy* batteryManagerProxy() const { return m_batteryManagerProxy.get(); }
 #endif
-    WebCookieManagerProxy* cookieManagerProxy() const { return m_cookieManagerProxy.get(); }
-#if ENABLE(SQL_DATABASE)
-    WebDatabaseManagerProxy* databaseManagerProxy() const { return m_databaseManagerProxy.get(); }
-#endif
-    WebGeolocationManagerProxy* geolocationManagerProxy() const { return m_geolocationManagerProxy.get(); }
     WebIconDatabase* iconDatabase() const { return m_iconDatabase.get(); }
-    WebKeyValueStorageManagerProxy* keyValueStorageManagerProxy() const { return m_keyValueStorageManagerProxy.get(); }
-    WebMediaCacheManagerProxy* mediaCacheManagerProxy() const { return m_mediaCacheManagerProxy.get(); }
 #if ENABLE(NETWORK_INFO)
     WebNetworkInfoManagerProxy* networkInfoManagerProxy() const { return m_networkInfoManagerProxy.get(); }
 #endif
-    WebNotificationManagerProxy* notificationManagerProxy() const { return m_notificationManagerProxy.get(); }
 #if ENABLE(NETSCAPE_PLUGIN_API)
     WebPluginSiteDataManager* pluginSiteDataManager() const { return m_pluginSiteDataManager.get(); }
 #endif
-    WebResourceCacheManagerProxy* resourceCacheManagerProxy() const { return m_resourceCacheManagerProxy.get(); }
 #if USE(SOUP)
     WebSoupRequestManagerProxy* soupRequestManagerProxy() const { return m_soupRequestManagerProxy.get(); }
 #endif
@@ -435,22 +419,13 @@ private:
 #if ENABLE(BATTERY_STATUS)
     RefPtr<WebBatteryManagerProxy> m_batteryManagerProxy;
 #endif
-    RefPtr<WebCookieManagerProxy> m_cookieManagerProxy;
-#if ENABLE(SQL_DATABASE)
-    RefPtr<WebDatabaseManagerProxy> m_databaseManagerProxy;
-#endif
-    RefPtr<WebGeolocationManagerProxy> m_geolocationManagerProxy;
     RefPtr<WebIconDatabase> m_iconDatabase;
-    RefPtr<WebKeyValueStorageManagerProxy> m_keyValueStorageManagerProxy;
-    RefPtr<WebMediaCacheManagerProxy> m_mediaCacheManagerProxy;
 #if ENABLE(NETWORK_INFO)
     RefPtr<WebNetworkInfoManagerProxy> m_networkInfoManagerProxy;
 #endif
-    RefPtr<WebNotificationManagerProxy> m_notificationManagerProxy;
 #if ENABLE(NETSCAPE_PLUGIN_API)
     RefPtr<WebPluginSiteDataManager> m_pluginSiteDataManager;
 #endif
-    RefPtr<WebResourceCacheManagerProxy> m_resourceCacheManagerProxy;
 #if USE(SOUP)
     RefPtr<WebSoupRequestManagerProxy> m_soupRequestManagerProxy;
 #endif
index 6e1e116..69f87e4 100644 (file)
@@ -28,6 +28,7 @@
 
 namespace WebKit {
 
+class NetworkProcessProxy;
 class WebContext;
 class WebProcessProxy;
 
@@ -42,16 +43,29 @@ public:
     {
     }
 
-    void ref() { refWebContextSupplement(); }
-    void deref() { derefWebContextSupplement(); }
+    virtual void contextDestroyed()
+    {
+    }
 
-    virtual void contextDestroyed() = 0;
-    virtual void processDidClose(WebProcessProxy*) = 0;
-    virtual bool shouldTerminate(WebProcessProxy*) const = 0;
+    virtual void processDidClose(WebProcessProxy*)
+    {
+    }
+
+    virtual void processDidClose(NetworkProcessProxy*)
+    {
+    }
+
+    virtual bool shouldTerminate(WebProcessProxy*) const
+    {
+        return true;
+    }
 
     WebContext* context() const { return m_context; }
     void clearContext() { m_context = 0; }
 
+    void ref() { refWebContextSupplement(); }
+    void deref() { derefWebContextSupplement(); }
+
 private:
     virtual void refWebContextSupplement() = 0;
     virtual void derefWebContextSupplement() = 0;
index c2a5a1c..716802f 100644 (file)
 
 namespace WebKit {
 
+const AtomicString& WebCookieManagerProxy::supplementName()
+{
+    DEFINE_STATIC_LOCAL(AtomicString, name, ("WebCookieManagerProxy", AtomicString::ConstructFromLiteral));
+    return name;
+}
+
 PassRefPtr<WebCookieManagerProxy> WebCookieManagerProxy::create(WebContext* context)
 {
     return adoptRef(new WebCookieManagerProxy(context));
 }
 
 WebCookieManagerProxy::WebCookieManagerProxy(WebContext* context)
-    : m_webContext(context)
+    : WebContextSupplement(context)
 #if USE(SOUP)
     , m_cookiePersistentStorageType(SoupCookiePersistentStorageSQLite)
 #endif
 {
-    m_webContext->addMessageReceiver(Messages::WebCookieManagerProxy::messageReceiverName(), this);
+    WebContextSupplement::context()->addMessageReceiver(Messages::WebCookieManagerProxy::messageReceiverName(), this);
 }
 
 WebCookieManagerProxy::~WebCookieManagerProxy()
 {
 }
 
-void WebCookieManagerProxy::invalidate()
+void WebCookieManagerProxy::initializeClient(const WKCookieManagerClient* client)
+{
+    m_client.initialize(client);
+}
+
+// WebContextSupplement
+
+void WebCookieManagerProxy::contextDestroyed()
+{
+    invalidateCallbackMap(m_arrayCallbacks);
+    invalidateCallbackMap(m_httpCookieAcceptPolicyCallbacks);
+}
+
+void WebCookieManagerProxy::processDidClose(WebProcessProxy*)
+{
+    invalidateCallbackMap(m_arrayCallbacks);
+    invalidateCallbackMap(m_httpCookieAcceptPolicyCallbacks);
+}
+
+void WebCookieManagerProxy::processDidClose(NetworkProcessProxy*)
 {
     invalidateCallbackMap(m_arrayCallbacks);
     invalidateCallbackMap(m_httpCookieAcceptPolicyCallbacks);
@@ -60,15 +85,22 @@ void WebCookieManagerProxy::invalidate()
 
 bool WebCookieManagerProxy::shouldTerminate(WebProcessProxy*) const
 {
-    return m_webContext->processModel() != ProcessModelSharedSecondaryProcess
+    return context()->processModel() != ProcessModelSharedSecondaryProcess
         || (m_arrayCallbacks.isEmpty() && m_httpCookieAcceptPolicyCallbacks.isEmpty());
 }
 
-void WebCookieManagerProxy::initializeClient(const WKCookieManagerClient* client)
+void WebCookieManagerProxy::refWebContextSupplement()
 {
-    m_client.initialize(client);
+    APIObject::ref();
+}
+
+void WebCookieManagerProxy::derefWebContextSupplement()
+{
+    APIObject::deref();
 }
 
+// CoreIPC::MessageReceiver
+
 void WebCookieManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
 {
     didReceiveWebCookieManagerProxyMessage(connection, messageID, decoder);
@@ -80,7 +112,7 @@ void WebCookieManagerProxy::getHostnamesWithCookies(PassRefPtr<ArrayCallback> pr
     uint64_t callbackID = callback->callbackID();
     m_arrayCallbacks.set(callbackID, callback.release());
 
-    m_webContext->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::GetHostnamesWithCookies(callbackID));
+    context()->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::GetHostnamesWithCookies(callbackID));
 }
     
 void WebCookieManagerProxy::didGetHostnamesWithCookies(const Vector<String>& hostnameList, uint64_t callbackID)
@@ -102,22 +134,22 @@ void WebCookieManagerProxy::didGetHostnamesWithCookies(const Vector<String>& hos
 
 void WebCookieManagerProxy::deleteCookiesForHostname(const String& hostname)
 {
-    m_webContext->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::DeleteCookiesForHostname(hostname));
+    context()->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::DeleteCookiesForHostname(hostname));
 }
 
 void WebCookieManagerProxy::deleteAllCookies()
 {
-    m_webContext->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::DeleteAllCookies());
+    context()->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::DeleteAllCookies());
 }
 
 void WebCookieManagerProxy::startObservingCookieChanges()
 {
-    m_webContext->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::StartObservingCookieChanges());
+    context()->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::StartObservingCookieChanges());
 }
 
 void WebCookieManagerProxy::stopObservingCookieChanges()
 {
-    m_webContext->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::StopObservingCookieChanges());
+    context()->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::StopObservingCookieChanges());
 }
 
 void WebCookieManagerProxy::cookiesDidChange()
@@ -131,10 +163,10 @@ void WebCookieManagerProxy::setHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy pol
     persistHTTPCookieAcceptPolicy(policy);
 #endif
 #if USE(SOUP)
-    m_webContext->setInitialHTTPCookieAcceptPolicy(policy);
+    context()->setInitialHTTPCookieAcceptPolicy(policy);
 #endif
 
-    m_webContext->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::SetHTTPCookieAcceptPolicy(policy));
+    context()->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::SetHTTPCookieAcceptPolicy(policy));
 }
 
 void WebCookieManagerProxy::getHTTPCookieAcceptPolicy(PassRefPtr<HTTPCookieAcceptPolicyCallback> prpCallback)
@@ -144,7 +176,7 @@ void WebCookieManagerProxy::getHTTPCookieAcceptPolicy(PassRefPtr<HTTPCookieAccep
     uint64_t callbackID = callback->callbackID();
     m_httpCookieAcceptPolicyCallbacks.set(callbackID, callback.release());
 
-    m_webContext->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::GetHTTPCookieAcceptPolicy(callbackID));
+    context()->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::GetHTTPCookieAcceptPolicy(callbackID));
 }
 
 void WebCookieManagerProxy::didGetHTTPCookieAcceptPolicy(uint32_t policy, uint64_t callbackID)
index 3467bb4..b462375 100644 (file)
@@ -30,6 +30,7 @@
 #include "GenericCallback.h"
 #include "ImmutableArray.h"
 #include "MessageReceiver.h"
+#include "WebContextSupplement.h"
 #include "WebCookieManagerProxyClient.h"
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefPtr.h>
@@ -52,16 +53,15 @@ class WebProcessProxy;
 typedef GenericCallback<WKArrayRef> ArrayCallback;
 typedef GenericCallback<WKHTTPCookieAcceptPolicy, HTTPCookieAcceptPolicy> HTTPCookieAcceptPolicyCallback;
 
-class WebCookieManagerProxy : public APIObject, private CoreIPC::MessageReceiver {
+class WebCookieManagerProxy : public APIObject, public WebContextSupplement, private CoreIPC::MessageReceiver {
 public:
     static const Type APIType = TypeCookieManager;
 
+    static const AtomicString& supplementName();
+
     static PassRefPtr<WebCookieManagerProxy> create(WebContext*);
     virtual ~WebCookieManagerProxy();
 
-    void invalidate();
-    void clearContext() { m_webContext = 0; }
-
     void initializeClient(const WKCookieManagerClient*);
     
     void getHostnamesWithCookies(PassRefPtr<ArrayCallback>);
@@ -79,7 +79,8 @@ public:
     void getCookiePersistentStorage(String& storagePath, uint32_t& storageType) const;
 #endif
 
-    bool shouldTerminate(WebProcessProxy*) const;
+    using APIObject::ref;
+    using APIObject::deref;
 
 private:
     WebCookieManagerProxy(WebContext*);
@@ -90,7 +91,15 @@ private:
     void didGetHTTPCookieAcceptPolicy(uint32_t policy, uint64_t callbackID);
 
     void cookiesDidChange();
-    
+
+    // WebContextSupplement
+    virtual void contextDestroyed() OVERRIDE;
+    virtual void processDidClose(WebProcessProxy*) OVERRIDE;
+    virtual void processDidClose(NetworkProcessProxy*) OVERRIDE;
+    virtual bool shouldTerminate(WebProcessProxy*) const OVERRIDE;
+    virtual void refWebContextSupplement() OVERRIDE;
+    virtual void derefWebContextSupplement() OVERRIDE;
+
     // CoreIPC::MessageReceiver
     virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE;
     void didReceiveWebCookieManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
@@ -99,7 +108,6 @@ private:
     void persistHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy);
 #endif
 
-    WebContext* m_webContext;
     HashMap<uint64_t, RefPtr<ArrayCallback> > m_arrayCallbacks;
     HashMap<uint64_t, RefPtr<HTTPCookieAcceptPolicyCallback> > m_httpCookieAcceptPolicyCallbacks;
 
index 116fd56..67298da 100644 (file)
@@ -39,6 +39,12 @@ using namespace WebCore;
 
 namespace WebKit {
 
+const AtomicString& WebDatabaseManagerProxy::supplementName()
+{
+    DEFINE_STATIC_LOCAL(AtomicString, name, ("WebDatabaseManagerProxy", AtomicString::ConstructFromLiteral));
+    return name;
+}
+
 String WebDatabaseManagerProxy::originKey()
 {
     DEFINE_STATIC_LOCAL(String, key, (ASCIILiteral("WebDatabaseManagerOriginKey")));
@@ -93,16 +99,28 @@ PassRefPtr<WebDatabaseManagerProxy> WebDatabaseManagerProxy::create(WebContext*
 }
 
 WebDatabaseManagerProxy::WebDatabaseManagerProxy(WebContext* webContext)
-    : m_webContext(webContext)
+    : WebContextSupplement(webContext)
 {
-    m_webContext->addMessageReceiver(Messages::WebDatabaseManagerProxy::messageReceiverName(), this);
+    WebContextSupplement::context()->addMessageReceiver(Messages::WebDatabaseManagerProxy::messageReceiverName(), this);
 }
 
 WebDatabaseManagerProxy::~WebDatabaseManagerProxy()
 {
 }
 
-void WebDatabaseManagerProxy::invalidate()
+void WebDatabaseManagerProxy::initializeClient(const WKDatabaseManagerClient* client)
+{
+    m_client.initialize(client);
+}
+
+// WebContextSupplement
+
+void WebDatabaseManagerProxy::contextDestroyed()
+{
+    invalidateCallbackMap(m_arrayCallbacks);
+}
+
+void WebDatabaseManagerProxy::processDidClose(WebProcessProxy*)
 {
     invalidateCallbackMap(m_arrayCallbacks);
 }
@@ -112,9 +130,21 @@ bool WebDatabaseManagerProxy::shouldTerminate(WebProcessProxy*) const
     return m_arrayCallbacks.isEmpty();
 }
 
-void WebDatabaseManagerProxy::initializeClient(const WKDatabaseManagerClient* client)
+void WebDatabaseManagerProxy::refWebContextSupplement()
 {
-    m_client.initialize(client);
+    APIObject::ref();
+}
+
+void WebDatabaseManagerProxy::derefWebContextSupplement()
+{
+    APIObject::deref();
+}
+
+// CoreIPC::MessageReceiver
+
+void WebDatabaseManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
+{
+    didReceiveWebDatabaseManagerProxyMessage(connection, messageID, decoder);
 }
 
 void WebDatabaseManagerProxy::getDatabasesByOrigin(PassRefPtr<ArrayCallback> prpCallback)
@@ -124,7 +154,7 @@ void WebDatabaseManagerProxy::getDatabasesByOrigin(PassRefPtr<ArrayCallback> prp
     m_arrayCallbacks.set(callbackID, callback.release());
 
     // FIXME (Multi-WebProcess): <rdar://problem/12239765> Databases shouldn't be stored in the web process.
-    m_webContext->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebDatabaseManager::GetDatabasesByOrigin(callbackID));
+    context()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebDatabaseManager::GetDatabasesByOrigin(callbackID));
 }
 
 void WebDatabaseManagerProxy::didGetDatabasesByOrigin(const Vector<OriginAndDatabases>& originAndDatabasesVector, uint64_t callbackID)
@@ -177,7 +207,7 @@ void WebDatabaseManagerProxy::getDatabaseOrigins(PassRefPtr<ArrayCallback> prpCa
     m_arrayCallbacks.set(callbackID, callback.release());
 
     // FIXME (Multi-WebProcess): <rdar://problem/12239765> Databases shouldn't be stored in the web process.
-    m_webContext->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebDatabaseManager::GetDatabaseOrigins(callbackID));
+    context()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebDatabaseManager::GetDatabaseOrigins(callbackID));
 }
 
 void WebDatabaseManagerProxy::didGetDatabaseOrigins(const Vector<String>& originIdentifiers, uint64_t callbackID)
@@ -200,25 +230,25 @@ void WebDatabaseManagerProxy::didGetDatabaseOrigins(const Vector<String>& origin
 void WebDatabaseManagerProxy::deleteDatabaseWithNameForOrigin(const String& databaseIdentifier, WebSecurityOrigin* origin)
 {
     // FIXME (Multi-WebProcess): <rdar://problem/7855696> Databases shouldn't be stored in the web process.
-    m_webContext->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebDatabaseManager::DeleteDatabaseWithNameForOrigin(databaseIdentifier, origin->databaseIdentifier()));
+    context()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebDatabaseManager::DeleteDatabaseWithNameForOrigin(databaseIdentifier, origin->databaseIdentifier()));
 }
 
 void WebDatabaseManagerProxy::deleteDatabasesForOrigin(WebSecurityOrigin* origin)
 {
     // FIXME (Multi-WebProcess): <rdar://problem/7855696> Databases shouldn't be stored in the web process.
-    m_webContext->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebDatabaseManager::DeleteDatabasesForOrigin(origin->databaseIdentifier()));
+    context()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebDatabaseManager::DeleteDatabasesForOrigin(origin->databaseIdentifier()));
 }
 
 void WebDatabaseManagerProxy::deleteAllDatabases()
 {
     // FIXME (Multi-WebProcess): <rdar://problem/7855696> Databases shouldn't be stored in the web process.
-    m_webContext->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebDatabaseManager::DeleteAllDatabases());
+    context()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebDatabaseManager::DeleteAllDatabases());
 }
 
 void WebDatabaseManagerProxy::setQuotaForOrigin(WebSecurityOrigin* origin, uint64_t quota)
 {
     // FIXME (Multi-WebProcess): <rdar://problem/7855696> Databases shouldn't be stored in the web process.
-    m_webContext->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebDatabaseManager::SetQuotaForOrigin(origin->databaseIdentifier(), quota));
+    context()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebDatabaseManager::SetQuotaForOrigin(origin->databaseIdentifier(), quota));
 }
 
 void WebDatabaseManagerProxy::didModifyOrigin(const String& originIdentifier)
@@ -233,11 +263,6 @@ void WebDatabaseManagerProxy::didModifyDatabase(const String& originIdentifier,
     m_client.didModifyDatabase(this, origin.get(), databaseIdentifier);
 }
 
-void WebDatabaseManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
-{
-    didReceiveWebDatabaseManagerProxyMessage(connection, messageID, decoder);
-}
-
 } // namespace WebKit
 
 #endif // ENABLE(SQL_DATABASE)
index 7c695fc..33b80f8 100644 (file)
@@ -33,6 +33,7 @@
 #include "GenericCallback.h"
 #include "MessageReceiver.h"
 #include "OriginAndDatabases.h"
+#include "WebContextSupplement.h"
 #include "WebDatabaseManagerProxyClient.h"
 #include <wtf/HashMap.h>
 #include <wtf/PassRefPtr.h>
@@ -45,16 +46,15 @@ class WebSecurityOrigin;
 
 typedef GenericCallback<WKArrayRef> ArrayCallback;
 
-class WebDatabaseManagerProxy : public APIObject, private CoreIPC::MessageReceiver {
+class WebDatabaseManagerProxy : public APIObject, public WebContextSupplement, private CoreIPC::MessageReceiver {
 public:
     static const Type APIType = TypeDatabaseManager;
 
+    static const AtomicString& supplementName();
+
     static PassRefPtr<WebDatabaseManagerProxy> create(WebContext*);
     virtual ~WebDatabaseManagerProxy();
 
-    void invalidate();
-    void clearContext() { m_webContext = 0; }
-
     void initializeClient(const WKDatabaseManagerClient*);
 
     void getDatabasesByOrigin(PassRefPtr<ArrayCallback>);
@@ -73,13 +73,21 @@ public:
     static String databaseDetailsExpectedUsageKey();
     static String databaseDetailsCurrentUsageKey();
 
-    bool shouldTerminate(WebProcessProxy*) const;
+    using APIObject::ref;
+    using APIObject::deref;
 
 private:
     explicit WebDatabaseManagerProxy(WebContext*);
 
     virtual Type type() const { return APIType; }
 
+    // WebContextSupplement
+    virtual void contextDestroyed() OVERRIDE;
+    virtual void processDidClose(WebProcessProxy*) OVERRIDE;
+    virtual bool shouldTerminate(WebProcessProxy*) const OVERRIDE;
+    virtual void refWebContextSupplement() OVERRIDE;
+    virtual void derefWebContextSupplement() OVERRIDE;
+
     // CoreIPC::MessageReceiver
     virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE;
     void didReceiveWebDatabaseManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
@@ -90,9 +98,7 @@ private:
     void didModifyOrigin(const String& originIdentifier);
     void didModifyDatabase(const String& originIdentifier, const String& databaseIdentifier);
 
-    WebContext* m_webContext;
     HashMap<uint64_t, RefPtr<ArrayCallback> > m_arrayCallbacks;
-
     WebDatabaseManagerProxyClient m_client;
 };
 
index 74b9079..4400f98 100644 (file)
 
 namespace WebKit {
 
+const AtomicString& WebGeolocationManagerProxy::supplementName()
+{
+    DEFINE_STATIC_LOCAL(AtomicString, name, ("WebGeolocationManagerProxy", AtomicString::ConstructFromLiteral));
+    return name;
+}
+
 PassRefPtr<WebGeolocationManagerProxy> WebGeolocationManagerProxy::create(WebContext* context)
 {
     return adoptRef(new WebGeolocationManagerProxy(context));
 }
 
 WebGeolocationManagerProxy::WebGeolocationManagerProxy(WebContext* context)
-    : m_isUpdating(false)
-    , m_context(context)
+    : WebContextSupplement(context)
+    , m_isUpdating(false)
 {
-    m_context->addMessageReceiver(Messages::WebGeolocationManagerProxy::messageReceiverName(), this);
+    WebContextSupplement::context()->addMessageReceiver(Messages::WebGeolocationManagerProxy::messageReceiverName(), this);
 }
 
 WebGeolocationManagerProxy::~WebGeolocationManagerProxy()
 {
 }
 
-void WebGeolocationManagerProxy::invalidate()
+void WebGeolocationManagerProxy::initializeProvider(const WKGeolocationProvider* provider)
+{
+    m_provider.initialize(provider);
+}
+
+// WebContextSupplement
+
+void WebGeolocationManagerProxy::contextDestroyed()
 {
     stopUpdating();
 }
 
-void WebGeolocationManagerProxy::initializeProvider(const WKGeolocationProvider* provider)
+void WebGeolocationManagerProxy::processDidClose(WebProcessProxy*)
 {
-    m_provider.initialize(provider);
+    stopUpdating();
 }
 
-void WebGeolocationManagerProxy::providerDidChangePosition(WebGeolocationPosition* position)
+void WebGeolocationManagerProxy::refWebContextSupplement()
 {
-    if (!m_context)
-        return;
+    APIObject::ref();
+}
 
-    m_context->sendToAllProcesses(Messages::WebGeolocationManager::DidChangePosition(position->data()));
+void WebGeolocationManagerProxy::derefWebContextSupplement()
+{
+    APIObject::deref();
 }
 
-void WebGeolocationManagerProxy::providerDidFailToDeterminePosition(const String& errorMessage)
+// CoreIPC::MessageReceiver
+
+void WebGeolocationManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
+{
+    didReceiveWebGeolocationManagerProxyMessage(connection, messageID, decoder);
+}
+
+void WebGeolocationManagerProxy::providerDidChangePosition(WebGeolocationPosition* position)
 {
-    if (!m_context)
+    if (!context())
         return;
 
-    m_context->sendToAllProcesses(Messages::WebGeolocationManager::DidFailToDeterminePosition(errorMessage));
+    context()->sendToAllProcesses(Messages::WebGeolocationManager::DidChangePosition(position->data()));
 }
 
-void WebGeolocationManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
+void WebGeolocationManagerProxy::providerDidFailToDeterminePosition(const String& errorMessage)
 {
-    didReceiveWebGeolocationManagerProxyMessage(connection, messageID, decoder);
+    if (!context())
+        return;
+
+    context()->sendToAllProcesses(Messages::WebGeolocationManager::DidFailToDeterminePosition(errorMessage));
 }
 
 void WebGeolocationManagerProxy::startUpdating()
index 81fc19e..2279161 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "APIObject.h"
 #include "MessageReceiver.h"
+#include "WebContextSupplement.h"
 #include "WebGeolocationProvider.h"
 #include <wtf/text/WTFString.h>
 
@@ -36,26 +37,34 @@ namespace WebKit {
 class WebContext;
 class WebGeolocationPosition;
 
-class WebGeolocationManagerProxy : public APIObject, private CoreIPC::MessageReceiver {
+class WebGeolocationManagerProxy : public APIObject, public WebContextSupplement, private CoreIPC::MessageReceiver {
 public:
     static const Type APIType = TypeGeolocationManager;
 
+    static const AtomicString& supplementName();
+
     static PassRefPtr<WebGeolocationManagerProxy> create(WebContext*);
     virtual ~WebGeolocationManagerProxy();
 
-    void invalidate();
-    void clearContext() { m_context = 0; }
-
     void initializeProvider(const WKGeolocationProvider*);
 
     void providerDidChangePosition(WebGeolocationPosition*);
     void providerDidFailToDeterminePosition(const String& errorMessage = String());
 
+    using APIObject::ref;
+    using APIObject::deref;
+
 private:
     explicit WebGeolocationManagerProxy(WebContext*);
 
     virtual Type type() const { return APIType; }
 
+    // WebContextSupplement
+    virtual void contextDestroyed() OVERRIDE;
+    virtual void processDidClose(WebProcessProxy*) OVERRIDE;
+    virtual void refWebContextSupplement() OVERRIDE;
+    virtual void derefWebContextSupplement() OVERRIDE;
+
     // CoreIPC::MessageReceiver
     virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE;
 
@@ -67,7 +76,6 @@ private:
 
     bool m_isUpdating;
 
-    WebContext* m_context;
     WebGeolocationProvider m_provider;
 };
 
index 43f69a4..5999410 100644 (file)
 
 namespace WebKit {
 
+const AtomicString& WebKeyValueStorageManagerProxy::supplementName()
+{
+    DEFINE_STATIC_LOCAL(AtomicString, name, ("WebKeyValueStorageManagerProxy", AtomicString::ConstructFromLiteral));
+    return name;
+}
+
 PassRefPtr<WebKeyValueStorageManagerProxy> WebKeyValueStorageManagerProxy::create(WebContext* context)
 {
     return adoptRef(new WebKeyValueStorageManagerProxy(context));
 }
 
 WebKeyValueStorageManagerProxy::WebKeyValueStorageManagerProxy(WebContext* context)
-    : m_webContext(context)
+    : WebContextSupplement(context)
 {
-    m_webContext->addMessageReceiver(Messages::WebKeyValueStorageManagerProxy::messageReceiverName(), this);
+    WebContextSupplement::context()->addMessageReceiver(Messages::WebKeyValueStorageManagerProxy::messageReceiverName(), this);
 }
 
 WebKeyValueStorageManagerProxy::~WebKeyValueStorageManagerProxy()
 {
 }
 
-void WebKeyValueStorageManagerProxy::invalidate()
+// WebContextSupplement
+
+void WebKeyValueStorageManagerProxy::contextDestroyed()
+{
+    invalidateCallbackMap(m_arrayCallbacks);
+}
+
+void WebKeyValueStorageManagerProxy::processDidClose(WebProcessProxy*)
 {
     invalidateCallbackMap(m_arrayCallbacks);
 }
@@ -59,6 +72,18 @@ bool WebKeyValueStorageManagerProxy::shouldTerminate(WebProcessProxy*) const
     return m_arrayCallbacks.isEmpty();
 }
 
+void WebKeyValueStorageManagerProxy::refWebContextSupplement()
+{
+    APIObject::ref();
+}
+
+void WebKeyValueStorageManagerProxy::derefWebContextSupplement()
+{
+    APIObject::deref();
+}
+
+// CoreIPC::MessageReceiver
+
 void WebKeyValueStorageManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
 {
     didReceiveWebKeyValueStorageManagerProxyMessage(connection, messageID, decoder);
@@ -71,7 +96,7 @@ void WebKeyValueStorageManagerProxy::getKeyValueStorageOrigins(PassRefPtr<ArrayC
     m_arrayCallbacks.set(callbackID, callback.release());
 
     // FIXME (Multi-WebProcess): <rdar://problem/12239765> Should key-value storage be handled in the web process?
-    m_webContext->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebKeyValueStorageManager::GetKeyValueStorageOrigins(callbackID));
+    context()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebKeyValueStorageManager::GetKeyValueStorageOrigins(callbackID));
 }
     
 void WebKeyValueStorageManagerProxy::didGetKeyValueStorageOrigins(const Vector<SecurityOriginData>& originDatas, uint64_t callbackID)
@@ -88,13 +113,13 @@ void WebKeyValueStorageManagerProxy::deleteEntriesForOrigin(WebSecurityOrigin* o
     securityOriginData.port = origin->port();
 
     // FIXME (Multi-WebProcess): <rdar://problem/12239765> Should key-value storage be handled in the web process?
-    m_webContext->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebKeyValueStorageManager::DeleteEntriesForOrigin(securityOriginData));
+    context()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebKeyValueStorageManager::DeleteEntriesForOrigin(securityOriginData));
 }
 
 void WebKeyValueStorageManagerProxy::deleteAllEntries()
 {
     // FIXME (Multi-WebProcess): <rdar://problem/12239765> Should key-value storage be handled in the web process?
-    m_webContext->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebKeyValueStorageManager::DeleteAllEntries());
+    context()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebKeyValueStorageManager::DeleteAllEntries());
 }
 
 } // namespace WebKit
index ba392bb..683c4b3 100644 (file)
@@ -30,6 +30,7 @@
 #include "GenericCallback.h"
 #include "ImmutableArray.h"
 #include "MessageReceiver.h"
+#include "WebContextSupplement.h"
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefPtr.h>
 #include <wtf/Vector.h>
@@ -43,21 +44,21 @@ class WebSecurityOrigin;
 
 typedef GenericCallback<WKArrayRef> ArrayCallback;
 
-class WebKeyValueStorageManagerProxy : public APIObject, private CoreIPC::MessageReceiver {
+class WebKeyValueStorageManagerProxy : public APIObject, public WebContextSupplement, private CoreIPC::MessageReceiver {
 public:
     static const Type APIType = TypeKeyValueStorageManager;
 
+    static const AtomicString& supplementName();
+
     static PassRefPtr<WebKeyValueStorageManagerProxy> create(WebContext*);
     virtual ~WebKeyValueStorageManagerProxy();
 
-    void invalidate();
-    void clearContext() { m_webContext = 0; }
-    
     void getKeyValueStorageOrigins(PassRefPtr<ArrayCallback>);
     void deleteEntriesForOrigin(WebSecurityOrigin*);
     void deleteAllEntries();
 
-    bool shouldTerminate(WebProcessProxy*) const;
+    using APIObject::ref;
+    using APIObject::deref;
 
 private:
     explicit WebKeyValueStorageManagerProxy(WebContext*);
@@ -66,11 +67,17 @@ private:
 
     void didGetKeyValueStorageOrigins(const Vector<SecurityOriginData>&, uint64_t callbackID);
 
+    // WebContextSupplement
+    virtual void contextDestroyed() OVERRIDE;
+    virtual void processDidClose(WebProcessProxy*) OVERRIDE;
+    virtual bool shouldTerminate(WebProcessProxy*) const OVERRIDE;
+    virtual void refWebContextSupplement() OVERRIDE;
+    virtual void derefWebContextSupplement() OVERRIDE;
+
     // CoreIPC::MessageReceiver
     virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE;
     void didReceiveWebKeyValueStorageManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
 
-    WebContext* m_webContext;
     HashMap<uint64_t, RefPtr<ArrayCallback> > m_arrayCallbacks;
 };
 
index b0f9bd1..d884556 100644 (file)
 
 namespace WebKit {
 
+const AtomicString& WebMediaCacheManagerProxy::supplementName()
+{
+    DEFINE_STATIC_LOCAL(AtomicString, name, ("WebMediaCacheManagerProxy", AtomicString::ConstructFromLiteral));
+    return name;
+}
+
 PassRefPtr<WebMediaCacheManagerProxy> WebMediaCacheManagerProxy::create(WebContext* context)
 {
     return adoptRef(new WebMediaCacheManagerProxy(context));
 }
 
 WebMediaCacheManagerProxy::WebMediaCacheManagerProxy(WebContext* context)
-    : m_webContext(context)
+    : WebContextSupplement(context)
 {
-    m_webContext->addMessageReceiver(Messages::WebMediaCacheManagerProxy::messageReceiverName(), this);
+    WebContextSupplement::context()->addMessageReceiver(Messages::WebMediaCacheManagerProxy::messageReceiverName(), this);
 }
 
 WebMediaCacheManagerProxy::~WebMediaCacheManagerProxy()
 {
 }
 
-void WebMediaCacheManagerProxy::invalidate()
+// WebContextSupplement
+
+void WebMediaCacheManagerProxy::contextDestroyed()
+{
+    invalidateCallbackMap(m_arrayCallbacks);
+}
+
+void WebMediaCacheManagerProxy::processDidClose(WebProcessProxy*)
 {
     invalidateCallbackMap(m_arrayCallbacks);
 }
@@ -58,6 +71,18 @@ bool WebMediaCacheManagerProxy::shouldTerminate(WebProcessProxy*) const
     return m_arrayCallbacks.isEmpty();
 }
 
+void WebMediaCacheManagerProxy::refWebContextSupplement()
+{
+    APIObject::ref();
+}
+
+void WebMediaCacheManagerProxy::derefWebContextSupplement()
+{
+    APIObject::deref();
+}
+
+// CoreIPC::MessageReceiver
+
 void WebMediaCacheManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
 {
     didReceiveWebMediaCacheManagerProxyMessage(connection, messageID, decoder);
@@ -70,7 +95,7 @@ void WebMediaCacheManagerProxy::getHostnamesWithMediaCache(PassRefPtr<ArrayCallb
     m_arrayCallbacks.set(callbackID, callback.release());
 
     // FIXME (Multi-WebProcess): <rdar://problem/12239765> When we're sending this to multiple processes, we need to aggregate the callback data when it comes back.
-    m_webContext->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebMediaCacheManager::GetHostnamesWithMediaCache(callbackID));
+    context()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebMediaCacheManager::GetHostnamesWithMediaCache(callbackID));
 }
     
 void WebMediaCacheManagerProxy::didGetHostnamesWithMediaCache(const Vector<String>& hostnameList, uint64_t callbackID)
@@ -92,12 +117,12 @@ void WebMediaCacheManagerProxy::didGetHostnamesWithMediaCache(const Vector<Strin
 
 void WebMediaCacheManagerProxy::clearCacheForHostname(const String& hostname)
 {
-    m_webContext->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebMediaCacheManager::ClearCacheForHostname(hostname));
+    context()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebMediaCacheManager::ClearCacheForHostname(hostname));
 }
 
 void WebMediaCacheManagerProxy::clearCacheForAllHostnames()
 {
-    m_webContext->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebMediaCacheManager::ClearCacheForAllHostnames());
+    context()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebMediaCacheManager::ClearCacheForAllHostnames());
 }
 
 } // namespace WebKit
index 4531a72..dfe00ab 100644 (file)
@@ -30,6 +30,7 @@
 #include "GenericCallback.h"
 #include "ImmutableArray.h"
 #include "MessageReceiver.h"
+#include "WebContextSupplement.h"
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefPtr.h>
 #include <wtf/Vector.h>
@@ -41,21 +42,21 @@ class WebProcessProxy;
 
 typedef GenericCallback<WKArrayRef> ArrayCallback;
 
-class WebMediaCacheManagerProxy : public APIObject, private CoreIPC::MessageReceiver {
+class WebMediaCacheManagerProxy : public APIObject, public WebContextSupplement, private CoreIPC::MessageReceiver {
 public:
     static const Type APIType = TypeMediaCacheManager;
 
+    static const AtomicString& supplementName();
+
     static PassRefPtr<WebMediaCacheManagerProxy> create(WebContext*);
     virtual ~WebMediaCacheManagerProxy();
-
-    void invalidate();
-    void clearContext() { m_webContext = 0; }
     
     void getHostnamesWithMediaCache(PassRefPtr<ArrayCallback>);
     void clearCacheForHostname(const String&);
     void clearCacheForAllHostnames();
 
-    bool shouldTerminate(WebProcessProxy*) const;
+    using APIObject::ref;
+    using APIObject::deref;
 
 private:
     explicit WebMediaCacheManagerProxy(WebContext*);
@@ -64,11 +65,17 @@ private:
 
     void didGetHostnamesWithMediaCache(const Vector<String>&, uint64_t callbackID);
 
+    // WebContextSupplement
+    virtual void contextDestroyed() OVERRIDE;
+    virtual void processDidClose(WebProcessProxy*) OVERRIDE;
+    virtual bool shouldTerminate(WebProcessProxy*) const OVERRIDE;
+    virtual void refWebContextSupplement() OVERRIDE;
+    virtual void derefWebContextSupplement() OVERRIDE;
+
     // CoreIPC::MessageReceiver
     virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE;
     void didReceiveWebMediaCacheManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
 
-    WebContext* m_webContext;
     HashMap<uint64_t, RefPtr<ArrayCallback> > m_arrayCallbacks;
 };
 
index 7c93392..4c1cd97 100644 (file)
@@ -3895,7 +3895,7 @@ void WebPageProxy::requestNotificationPermission(uint64_t requestID, const Strin
 
 void WebPageProxy::showNotification(const String& title, const String& body, const String& iconURL, const String& tag, const String& lang, const String& dir, const String& originString, uint64_t notificationID)
 {
-    m_process->context()->notificationManagerProxy()->show(this, title, body, iconURL, tag, lang, dir, originString, notificationID);
+    m_process->context()->supplement<WebNotificationManagerProxy>()->show(this, title, body, iconURL, tag, lang, dir, originString, notificationID);
 }
 
 float WebPageProxy::headerHeight(WebFrameProxy* frame)
index 22a41a1..d68f629 100644 (file)
@@ -38,22 +38,35 @@ using namespace WebCore;
 
 namespace WebKit {
 
+const AtomicString& WebResourceCacheManagerProxy::supplementName()
+{
+    DEFINE_STATIC_LOCAL(AtomicString, name, ("WebResourceCacheManagerProxy", AtomicString::ConstructFromLiteral));
+    return name;
+}
+
 PassRefPtr<WebResourceCacheManagerProxy> WebResourceCacheManagerProxy::create(WebContext* webContext)
 {
     return adoptRef(new WebResourceCacheManagerProxy(webContext));
 }
 
 WebResourceCacheManagerProxy::WebResourceCacheManagerProxy(WebContext* webContext)
-    : m_webContext(webContext)
+    : WebContextSupplement(webContext)
 {
-    m_webContext->addMessageReceiver(Messages::WebResourceCacheManagerProxy::messageReceiverName(), this);
+    WebContextSupplement::context()->addMessageReceiver(Messages::WebResourceCacheManagerProxy::messageReceiverName(), this);
 }
 
 WebResourceCacheManagerProxy::~WebResourceCacheManagerProxy()
 {
 }
 
-void WebResourceCacheManagerProxy::invalidate()
+// WebContextSupplement
+
+void WebResourceCacheManagerProxy::contextDestroyed()
+{
+    invalidateCallbackMap(m_arrayCallbacks);
+}
+
+void WebResourceCacheManagerProxy::processDidClose(WebProcessProxy*)
 {
     invalidateCallbackMap(m_arrayCallbacks);
 }
@@ -63,6 +76,23 @@ bool WebResourceCacheManagerProxy::shouldTerminate(WebProcessProxy*) const
     return m_arrayCallbacks.isEmpty();
 }
 
+void WebResourceCacheManagerProxy::refWebContextSupplement()
+{
+    APIObject::ref();
+}
+
+void WebResourceCacheManagerProxy::derefWebContextSupplement()
+{
+    APIObject::deref();
+}
+
+// CoreIPC::MessageReceiver
+
+void WebResourceCacheManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
+{
+    didReceiveWebResourceCacheManagerProxyMessage(connection, messageID, decoder);
+}
+
 void WebResourceCacheManagerProxy::getCacheOrigins(PassRefPtr<ArrayCallback> prpCallback)
 {
     RefPtr<ArrayCallback> callback = prpCallback;
@@ -70,7 +100,7 @@ void WebResourceCacheManagerProxy::getCacheOrigins(PassRefPtr<ArrayCallback> prp
     m_arrayCallbacks.set(callbackID, callback.release());
 
     // FIXME (Multi-WebProcess): <rdar://problem/12239765> When multi-process is enabled, we need to aggregate the callback data from all processes.
-    m_webContext->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebResourceCacheManager::GetCacheOrigins(callbackID));
+    context()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebResourceCacheManager::GetCacheOrigins(callbackID));
 }
 
 void WebResourceCacheManagerProxy::didGetCacheOrigins(const Vector<SecurityOriginData>& origins, uint64_t callbackID)
@@ -87,18 +117,13 @@ void WebResourceCacheManagerProxy::clearCacheForOrigin(WebSecurityOrigin* origin
     securityOrigin.port = origin->port();
 
     // FIXME (Multi-WebProcess): <rdar://problem/12239765> There is no need to relaunch all processes. One process to take care of persistent cache is enough.
-    m_webContext->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebResourceCacheManager::ClearCacheForOrigin(securityOrigin, cachesToClear));
+    context()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebResourceCacheManager::ClearCacheForOrigin(securityOrigin, cachesToClear));
 }
 
 void WebResourceCacheManagerProxy::clearCacheForAllOrigins(ResourceCachesToClear cachesToClear)
 {
     // FIXME (Multi-WebProcess): <rdar://problem/12239765> There is no need to relaunch all processes. One process to take care of persistent cache is enough.
-    m_webContext->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebResourceCacheManager::ClearCacheForAllOrigins(cachesToClear));
-}
-
-void WebResourceCacheManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
-{
-    didReceiveWebResourceCacheManagerProxyMessage(connection, messageID, decoder);
+    context()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebResourceCacheManager::ClearCacheForAllOrigins(cachesToClear));
 }
 
 } // namespace WebKit
index 1c62070..80b5c66 100644 (file)
@@ -31,6 +31,7 @@
 #include "GenericCallback.h"
 #include "MessageReceiver.h"
 #include "ResourceCachesToClear.h"
+#include "WebContextSupplement.h"
 #include <wtf/HashMap.h>
 #include <wtf/PassRefPtr.h>
 
@@ -43,27 +44,34 @@ class WebSecurityOrigin;
 
 typedef GenericCallback<WKArrayRef> ArrayCallback;
 
-class WebResourceCacheManagerProxy : public APIObject, private CoreIPC::MessageReceiver {
+class WebResourceCacheManagerProxy : public APIObject, public WebContextSupplement, private CoreIPC::MessageReceiver {
 public:
     static const Type APIType = TypeCacheManager;
 
+    static const AtomicString& supplementName();
+
     static PassRefPtr<WebResourceCacheManagerProxy> create(WebContext*);
     virtual ~WebResourceCacheManagerProxy();
 
-    void invalidate();
-    void clearContext() { m_webContext = 0; }
-
     void getCacheOrigins(PassRefPtr<ArrayCallback>);
     void clearCacheForOrigin(WebSecurityOrigin*, ResourceCachesToClear);
     void clearCacheForAllOrigins(ResourceCachesToClear);
 
-    bool shouldTerminate(WebProcessProxy*) const;
+    using APIObject::ref;
+    using APIObject::deref;
 
 private:
     explicit WebResourceCacheManagerProxy(WebContext*);
 
     virtual Type type() const { return APIType; }
 
+    // WebContextSupplement
+    virtual void contextDestroyed() OVERRIDE;
+    virtual void processDidClose(WebProcessProxy*) OVERRIDE;
+    virtual bool shouldTerminate(WebProcessProxy*) const OVERRIDE;
+    virtual void refWebContextSupplement() OVERRIDE;
+    virtual void derefWebContextSupplement() OVERRIDE;
+
     // CoreIPC::MessageReceiver
     virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE;
     void didReceiveWebResourceCacheManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
@@ -71,7 +79,6 @@ private:
     // Message handlers.
     void didGetCacheOrigins(const Vector<SecurityOriginData>& originIdentifiers, uint64_t callbackID);
 
-    WebContext* m_webContext;
     HashMap<uint64_t, RefPtr<ArrayCallback> > m_arrayCallbacks;
 };
 
index ee63217..fe8c83f 100644 (file)
@@ -90,7 +90,7 @@ void WebContext::platformInitializeWebProcess(WebProcessCreationParameters& para
     initializeInspectorServer();
 
     parameters.urlSchemesRegistered = m_soupRequestManagerProxy->registeredURISchemes();
-    m_cookieManagerProxy->getCookiePersistentStorage(parameters.cookiePersistentStoragePath, parameters.cookiePersistentStorageType);
+    supplement<WebCookieManagerProxy>()->getCookiePersistentStorage(parameters.cookiePersistentStoragePath, parameters.cookiePersistentStorageType);
     parameters.cookieAcceptPolicy = m_initialHTTPCookieAcceptPolicy;
     parameters.ignoreTLSErrors = m_ignoreTLSErrors;
 }
index 832d12a..026a8ab 100644 (file)
@@ -89,7 +89,7 @@ void WebContext::platformInitializeWebProcess(WebProcessCreationParameters& para
     initInspectorServer();
 
     parameters.urlSchemesRegistered = m_soupRequestManagerProxy->registeredURISchemes();
-    m_cookieManagerProxy->getCookiePersistentStorage(parameters.cookiePersistentStoragePath, parameters.cookiePersistentStorageType);
+    supplement<WebCookieManagerProxy>()->getCookiePersistentStorage(parameters.cookiePersistentStoragePath, parameters.cookiePersistentStorageType);
     parameters.cookieAcceptPolicy = m_initialHTTPCookieAcceptPolicy;
     parameters.ignoreTLSErrors = m_ignoreTLSErrors;
 }
index 726e624..b003667 100644 (file)
 #include "QtDefaultDataLocation.h"
 #include "QtWebContext.h"
 #include "WKSharedAPICast.h"
-#if ENABLE(GEOLOCATION)
-#include "WebGeolocationProviderQt.h"
-#endif
 #include "WebProcessCreationParameters.h"
 #include <QCoreApplication>
 #include <QDir>
 #include <QProcess>
 
+#if ENABLE(GEOLOCATION)
+#include "WebGeolocationManagerProxy.h"
+#include "WebGeolocationProviderQt.h"
+#endif
+
 namespace WebKit {
 
 static QString s_defaultDatabaseDirectory;
@@ -72,8 +74,8 @@ void WebContext::platformInitializeWebProcess(WebProcessCreationParameters& para
 {
     qRegisterMetaType<QProcess::ExitStatus>("QProcess::ExitStatus");
 #if ENABLE(GEOLOCATION)
-    static WebGeolocationProviderQt* location = WebGeolocationProviderQt::create(toAPI(geolocationManagerProxy()));
-    WKGeolocationManagerSetProvider(toAPI(geolocationManagerProxy()), WebGeolocationProviderQt::provider(location));
+    static WebGeolocationProviderQt* location = WebGeolocationProviderQt::create(toAPI(supplement<WebGeolocationManagerProxy>()));
+    WKGeolocationManagerSetProvider(toAPI(supplement<WebGeolocationManagerProxy>()), WebGeolocationProviderQt::provider(location));
 #endif
 }
 
index fe20bab..f964e49 100644 (file)
@@ -33,7 +33,7 @@ namespace WebKit {
 
 void WebCookieManagerProxy::setCookiePersistentStorage(const String& storagePath, uint32_t storageType)
 {
-    m_webContext->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebCookieManager::SetCookiePersistentStorage(storagePath, storageType));
+    context()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebCookieManager::SetCookiePersistentStorage(storagePath, storageType));
 
     m_cookiePersistentStoragePath = storagePath;
     m_cookiePersistentStorageType = static_cast<SoupCookiePersistentStorageType>(storageType);