WebKit2: Make sure to try to terminate the Web Process when any work that might requi...
authorjberlin@webkit.org <jberlin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Mar 2011 16:48:48 +0000 (16:48 +0000)
committerjberlin@webkit.org <jberlin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Mar 2011 16:48:48 +0000 (16:48 +0000)
Web Process to be relaunched is done
https://bugs.webkit.org/show_bug.cgi?id=57462

Reviewed by Anders Carlsson.

For the ManagerProxies in the UIProcess, only return true from shouldTerminate if there are
no more callbacks waiting to be invoked.

For the the Managers in the WebProcess, call WebProcess::shared().terminateIfPossible() when
any work called for by a ManagerProxy function that called relaunchProcessIfNecessary is
finished.

* UIProcess/WebContext.cpp:
(WebKit::WebContext::shouldTerminate):
Check with each of the ManagerProxies.

* UIProcess/WebApplicationCacheManagerProxy.cpp:
(WebKit::WebApplicationCacheManagerProxy::shouldTerminate):
* UIProcess/WebApplicationCacheManagerProxy.h:
* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::shouldTerminate):
* UIProcess/WebCookieManagerProxy.h:
* UIProcess/WebDatabaseManagerProxy.cpp:
(WebKit::WebDatabaseManagerProxy::shouldTerminate):
* UIProcess/WebDatabaseManagerProxy.h:
* UIProcess/WebKeyValueStorageManagerProxy.cpp:
(WebKit::WebKeyValueStorageManagerProxy::shouldTerminate):
* UIProcess/WebKeyValueStorageManagerProxy.h:
* UIProcess/WebMediaCacheManagerProxy.cpp:
(WebKit::WebMediaCacheManagerProxy::shouldTerminate):
* UIProcess/WebMediaCacheManagerProxy.h:
* UIProcess/WebResourceCacheManagerProxy.cpp:
(WebKit::WebResourceCacheManagerProxy::shouldTerminate):
* UIProcess/WebResourceCacheManagerProxy.h:

* WebProcess/ApplicationCache/WebApplicationCacheManager.cpp:
(WebKit::WebApplicationCacheManager::getApplicationCacheOrigins):
(WebKit::WebApplicationCacheManager::deleteEntriesForOrigin):
(WebKit::WebApplicationCacheManager::deleteAllEntries):
* WebProcess/Cookies/WebCookieManager.cpp:
(WebKit::WebCookieManager::getHostnamesWithCookies):
(WebKit::WebCookieManager::deleteCookiesForHostname):
(WebKit::WebCookieManager::deleteAllCookies):
(WebKit::WebCookieManager::startObservingCookieChanges):
(WebKit::WebCookieManager::setHTTPCookieAcceptPolicy):
(WebKit::WebCookieManager::getHTTPCookieAcceptPolicy):
* WebProcess/KeyValueStorage/WebKeyValueStorageManager.cpp:
(WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
(WebKit::WebKeyValueStorageManager::deleteEntriesForOrigin):
(WebKit::WebKeyValueStorageManager::deleteAllEntries):
* WebProcess/MediaCache/WebMediaCacheManager.cpp:
(WebKit::WebMediaCacheManager::getHostnamesWithMediaCache):
(WebKit::WebMediaCacheManager::clearCacheForHostname):
(WebKit::WebMediaCacheManager::clearCacheForAllHostnames):
* WebProcess/ResourceCache/WebResourceCacheManager.cpp:
(WebKit::WebResourceCacheManager::getCacheOrigins):
(WebKit::WebResourceCacheManager::clearCacheForOrigin):
(WebKit::WebResourceCacheManager::clearCacheForAllOrigins):
* WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
(WebKit::WebDatabaseManager::getDatabasesByOrigin):
(WebKit::WebDatabaseManager::getDatabaseOrigins):
(WebKit::WebDatabaseManager::deleteDatabaseWithNameForOrigin):
(WebKit::WebDatabaseManager::deleteDatabasesForOrigin):
(WebKit::WebDatabaseManager::deleteAllDatabases):
(WebKit::WebDatabaseManager::setQuotaForOrigin):

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

20 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.cpp
Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.h
Source/WebKit2/UIProcess/WebContext.cpp
Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp
Source/WebKit2/UIProcess/WebCookieManagerProxy.h
Source/WebKit2/UIProcess/WebDatabaseManagerProxy.cpp
Source/WebKit2/UIProcess/WebDatabaseManagerProxy.h
Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.cpp
Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.h
Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.cpp
Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.h
Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.cpp
Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.h
Source/WebKit2/WebProcess/ApplicationCache/WebApplicationCacheManager.cpp
Source/WebKit2/WebProcess/Cookies/WebCookieManager.cpp
Source/WebKit2/WebProcess/KeyValueStorage/WebKeyValueStorageManager.cpp
Source/WebKit2/WebProcess/MediaCache/WebMediaCacheManager.cpp
Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebDatabaseManager.cpp

index 0c535e5..addccad 100644 (file)
@@ -1,3 +1,72 @@
+2011-03-30  Jessie Berlin  <jberlin@apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        WebKit2: Make sure to try to terminate the Web Process when any work that might require the
+        Web Process to be relaunched is done
+        https://bugs.webkit.org/show_bug.cgi?id=57462
+
+        For the ManagerProxies in the UIProcess, only return true from shouldTerminate if there are
+        no more callbacks waiting to be invoked.
+
+        For the the Managers in the WebProcess, call WebProcess::shared().terminateIfPossible() when
+        any work called for by a ManagerProxy function that called relaunchProcessIfNecessary is
+        finished.
+
+        * UIProcess/WebContext.cpp:
+        (WebKit::WebContext::shouldTerminate):
+        Check with each of the ManagerProxies.
+
+        * UIProcess/WebApplicationCacheManagerProxy.cpp:
+        (WebKit::WebApplicationCacheManagerProxy::shouldTerminate):
+        * UIProcess/WebApplicationCacheManagerProxy.h:
+        * UIProcess/WebCookieManagerProxy.cpp:
+        (WebKit::WebCookieManagerProxy::shouldTerminate):
+        * UIProcess/WebCookieManagerProxy.h:
+        * UIProcess/WebDatabaseManagerProxy.cpp:
+        (WebKit::WebDatabaseManagerProxy::shouldTerminate):
+        * UIProcess/WebDatabaseManagerProxy.h:
+        * UIProcess/WebKeyValueStorageManagerProxy.cpp:
+        (WebKit::WebKeyValueStorageManagerProxy::shouldTerminate):
+        * UIProcess/WebKeyValueStorageManagerProxy.h:
+        * UIProcess/WebMediaCacheManagerProxy.cpp:
+        (WebKit::WebMediaCacheManagerProxy::shouldTerminate):
+        * UIProcess/WebMediaCacheManagerProxy.h:
+        * UIProcess/WebResourceCacheManagerProxy.cpp:
+        (WebKit::WebResourceCacheManagerProxy::shouldTerminate):
+        * UIProcess/WebResourceCacheManagerProxy.h:
+
+        * WebProcess/ApplicationCache/WebApplicationCacheManager.cpp:
+        (WebKit::WebApplicationCacheManager::getApplicationCacheOrigins):
+        (WebKit::WebApplicationCacheManager::deleteEntriesForOrigin):
+        (WebKit::WebApplicationCacheManager::deleteAllEntries):
+        * WebProcess/Cookies/WebCookieManager.cpp:
+        (WebKit::WebCookieManager::getHostnamesWithCookies):
+        (WebKit::WebCookieManager::deleteCookiesForHostname):
+        (WebKit::WebCookieManager::deleteAllCookies):
+        (WebKit::WebCookieManager::startObservingCookieChanges):
+        (WebKit::WebCookieManager::setHTTPCookieAcceptPolicy):
+        (WebKit::WebCookieManager::getHTTPCookieAcceptPolicy):
+        * WebProcess/KeyValueStorage/WebKeyValueStorageManager.cpp:
+        (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
+        (WebKit::WebKeyValueStorageManager::deleteEntriesForOrigin):
+        (WebKit::WebKeyValueStorageManager::deleteAllEntries):
+        * WebProcess/MediaCache/WebMediaCacheManager.cpp:
+        (WebKit::WebMediaCacheManager::getHostnamesWithMediaCache):
+        (WebKit::WebMediaCacheManager::clearCacheForHostname):
+        (WebKit::WebMediaCacheManager::clearCacheForAllHostnames):
+        * WebProcess/ResourceCache/WebResourceCacheManager.cpp:
+        (WebKit::WebResourceCacheManager::getCacheOrigins):
+        (WebKit::WebResourceCacheManager::clearCacheForOrigin):
+        (WebKit::WebResourceCacheManager::clearCacheForAllOrigins):
+        * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
+        (WebKit::WebDatabaseManager::getDatabasesByOrigin):
+        (WebKit::WebDatabaseManager::getDatabaseOrigins):
+        (WebKit::WebDatabaseManager::deleteDatabaseWithNameForOrigin):
+        (WebKit::WebDatabaseManager::deleteDatabasesForOrigin):
+        (WebKit::WebDatabaseManager::deleteAllDatabases):
+        (WebKit::WebDatabaseManager::setQuotaForOrigin):
+
 2011-03-30  Adam Roben  <aroben@apple.com>
 
         Mac build fix after r82442
index cf5eda1..6b24940 100644 (file)
@@ -52,6 +52,11 @@ void WebApplicationCacheManagerProxy::invalidate()
     invalidateCallbackMap(m_arrayCallbacks);
 }
 
+bool WebApplicationCacheManagerProxy::shouldTerminate(WebProcessProxy*) const
+{
+    return m_arrayCallbacks.isEmpty();
+}
+
 void WebApplicationCacheManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
 {
     didReceiveWebApplicationCacheManagerProxyMessage(connection, messageID, arguments);
index 81637e0..b3dca15 100644 (file)
@@ -44,6 +44,7 @@ namespace WebKit {
 
 struct SecurityOriginData;
 class WebContext;
+class WebProcessProxy;
 class WebSecurityOrigin;
 
 typedef GenericCallback<WKArrayRef> ArrayCallback;
@@ -64,6 +65,8 @@ public:
 
     void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
 
+    bool shouldTerminate(WebProcessProxy*) const;
+
 private:
     WebApplicationCacheManagerProxy(WebContext*);
 
index 43907ad..0609d68 100644 (file)
@@ -282,8 +282,20 @@ bool WebContext::shouldTerminate(WebProcessProxy* process)
     if (!m_downloads.isEmpty())
         return false;
 
+    if (!m_applicationCacheManagerProxy->shouldTerminate(process))
+        return false;
+    if (!m_cookieManagerProxy->shouldTerminate(process))
+        return false;
+    if (!m_databaseManagerProxy->shouldTerminate(process))
+        return false;
+    if (!m_keyValueStorageManagerProxy->shouldTerminate(process))
+        return false;
+    if (!m_mediaCacheManagerProxy->shouldTerminate(process))
+        return false;
     if (!m_pluginSiteDataManager->shouldTerminate(process))
         return false;
+    if (!m_resourceCacheManagerProxy->shouldTerminate(process))
+        return false;
 
     return true;
 }
index c2ae441..a30ab41 100644 (file)
@@ -53,6 +53,11 @@ void WebCookieManagerProxy::invalidate()
     invalidateCallbackMap(m_httpCookieAcceptPolicyCallbacks);
 }
 
+bool WebCookieManagerProxy::shouldTerminate(WebProcessProxy*) const
+{
+    return m_arrayCallbacks.isEmpty() && m_httpCookieAcceptPolicyCallbacks.isEmpty();
+}
+
 void WebCookieManagerProxy::initializeClient(const WKCookieManagerClient* client)
 {
     m_client.initialize(client);
index b650e1b..7dc20d5 100644 (file)
@@ -43,6 +43,7 @@ namespace CoreIPC {
 namespace WebKit {
 
 class WebContext;
+class WebProcessProxy;
 
 typedef GenericCallback<WKArrayRef> ArrayCallback;
 typedef GenericCallback<WKHTTPCookieAcceptPolicy, HTTPCookieAcceptPolicy> HTTPCookieAcceptPolicyCallback;
@@ -71,6 +72,8 @@ public:
 
     void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
 
+    bool shouldTerminate(WebProcessProxy*) const;
+
 private:
     WebCookieManagerProxy(WebContext*);
 
index 45ccb0e..67323cd 100644 (file)
@@ -103,6 +103,11 @@ void WebDatabaseManagerProxy::invalidate()
     invalidateCallbackMap(m_arrayCallbacks);
 }
 
+bool WebDatabaseManagerProxy::shouldTerminate(WebProcessProxy*) const
+{
+    return m_arrayCallbacks.isEmpty();
+}
+
 void WebDatabaseManagerProxy::initializeClient(const WKDatabaseManagerClient* client)
 {
     m_client.initialize(client);
index 3658845..d70011c 100644 (file)
@@ -43,6 +43,7 @@ class MessageID;
 namespace WebKit {
 
 class WebContext;
+class WebProcessProxy;
 class WebSecurityOrigin;
 
 typedef GenericCallback<WKArrayRef> ArrayCallback;
@@ -77,6 +78,8 @@ public:
 
     void didReceiveWebDatabaseManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
 
+    bool shouldTerminate(WebProcessProxy*) const;
+
 private:
     explicit WebDatabaseManagerProxy(WebContext*);
 
index 31aaf1d..1de1532 100644 (file)
@@ -52,6 +52,11 @@ void WebKeyValueStorageManagerProxy::invalidate()
     invalidateCallbackMap(m_arrayCallbacks);
 }
 
+bool WebKeyValueStorageManagerProxy::shouldTerminate(WebProcessProxy*) const
+{
+    return m_arrayCallbacks.isEmpty();
+}
+
 void WebKeyValueStorageManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
 {
     didReceiveWebKeyValueStorageManagerProxyMessage(connection, messageID, arguments);
index 1c5ea3a..79cb03e 100644 (file)
@@ -44,6 +44,7 @@ namespace WebKit {
 
 struct SecurityOriginData;
 class WebContext;
+class WebProcessProxy;
 class WebSecurityOrigin;
 
 typedef GenericCallback<WKArrayRef> ArrayCallback;
@@ -64,6 +65,8 @@ public:
 
     void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
 
+    bool shouldTerminate(WebProcessProxy*) const;
+
 private:
     WebKeyValueStorageManagerProxy(WebContext*);
 
index a731891..c8a7f51 100644 (file)
@@ -51,6 +51,11 @@ void WebMediaCacheManagerProxy::invalidate()
     invalidateCallbackMap(m_arrayCallbacks);
 }
 
+bool WebMediaCacheManagerProxy::shouldTerminate(WebProcessProxy*) const
+{
+    return m_arrayCallbacks.isEmpty();
+}
+
 void WebMediaCacheManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
 {
     didReceiveWebMediaCacheManagerProxyMessage(connection, messageID, arguments);
index 0240d4f..43231e5 100644 (file)
@@ -43,6 +43,7 @@ namespace CoreIPC {
 namespace WebKit {
 
 class WebContext;
+class WebProcessProxy;
 
 typedef GenericCallback<WKArrayRef> ArrayCallback;
 
@@ -62,6 +63,8 @@ public:
 
     void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
 
+    bool shouldTerminate(WebProcessProxy*) const;
+
 private:
     WebMediaCacheManagerProxy(WebContext*);
 
index 62296f4..403a8dc 100644 (file)
@@ -56,6 +56,11 @@ void WebResourceCacheManagerProxy::invalidate()
     invalidateCallbackMap(m_arrayCallbacks);
 }
 
+bool WebResourceCacheManagerProxy::shouldTerminate(WebProcessProxy*) const
+{
+    return m_arrayCallbacks.isEmpty();
+}
+
 void WebResourceCacheManagerProxy::getCacheOrigins(PassRefPtr<ArrayCallback> prpCallback)
 {
     RefPtr<ArrayCallback> callback = prpCallback;
index 0a2c3c8..1a360b4 100644 (file)
@@ -42,6 +42,7 @@ namespace WebKit {
 
 struct SecurityOriginData;
 class WebContext;
+class WebProcessProxy;
 class WebSecurityOrigin;
 
 typedef GenericCallback<WKArrayRef> ArrayCallback;
@@ -62,6 +63,8 @@ public:
 
     void didReceiveWebResourceCacheManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
 
+    bool shouldTerminate(WebProcessProxy*) const;
+
 private:
     explicit WebResourceCacheManagerProxy(WebContext*);
 
index 6fb42d9..4f91e3d 100644 (file)
@@ -79,6 +79,7 @@ void WebApplicationCacheManager::getApplicationCacheOrigins(uint64_t callbackID)
     }
 
     WebProcess::shared().connection()->send(Messages::WebApplicationCacheManagerProxy::DidGetApplicationCacheOrigins(identifiers, callbackID), 0);
+    WebProcess::shared().terminateIfPossible();
 }
 
 void WebApplicationCacheManager::deleteEntriesForOrigin(const SecurityOriginData& originData)
@@ -90,6 +91,7 @@ void WebApplicationCacheManager::deleteEntriesForOrigin(const SecurityOriginData
     
     ApplicationCache::deleteCacheForOrigin(origin.get());
 #endif
+    WebProcess::shared().terminateIfPossible();
 }
 
 void WebApplicationCacheManager::deleteAllEntries()
@@ -97,6 +99,7 @@ void WebApplicationCacheManager::deleteAllEntries()
 #if ENABLE(OFFLINE_WEB_APPLICATIONS)
     cacheStorage().deleteAllEntries();
 #endif
+    WebProcess::shared().terminateIfPossible();
 }
 
 } // namespace WebKit
index 38394c2..4181e14 100644 (file)
@@ -62,21 +62,25 @@ void WebCookieManager::getHostnamesWithCookies(uint64_t callbackID)
     copyToVector(hostnames, hostnameList);
 
     WebProcess::shared().connection()->send(Messages::WebCookieManagerProxy::DidGetHostnamesWithCookies(hostnameList, callbackID), 0);
+    WebProcess::shared().terminateIfPossible();
 }
 
 void WebCookieManager::deleteCookiesForHostname(const String& hostname)
 {
     WebCore::deleteCookiesForHostname(hostname);
+    WebProcess::shared().terminateIfPossible();
 }
 
 void WebCookieManager::deleteAllCookies()
 {
     WebCore::deleteAllCookies();
+    WebProcess::shared().terminateIfPossible();
 }
 
 void WebCookieManager::startObservingCookieChanges()
 {
     WebCore::startObservingCookieChanges();
+    WebProcess::shared().terminateIfPossible();
 }
 
 void WebCookieManager::stopObservingCookieChanges()
@@ -92,11 +96,13 @@ void WebCookieManager::dispatchCookiesDidChange()
 void WebCookieManager::setHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy policy)
 {
     platformSetHTTPCookieAcceptPolicy(policy);
+    WebProcess::shared().terminateIfPossible();
 }
 
 void WebCookieManager::getHTTPCookieAcceptPolicy(uint64_t callbackID)
 {
     WebProcess::shared().connection()->send(Messages::WebCookieManagerProxy::DidGetHTTPCookieAcceptPolicy(platformGetHTTPCookieAcceptPolicy(), callbackID), 0);
+    WebProcess::shared().terminateIfPossible();
 }
 
 } // namespace WebKit
index b8640ee..45431c3 100644 (file)
@@ -76,6 +76,7 @@ void WebKeyValueStorageManager::getKeyValueStorageOrigins(uint64_t callbackID)
     }
 
     WebProcess::shared().connection()->send(Messages::WebKeyValueStorageManagerProxy::DidGetKeyValueStorageOrigins(identifiers, callbackID), 0);
+    WebProcess::shared().terminateIfPossible();
 }
 
 void WebKeyValueStorageManager::deleteEntriesForOrigin(const SecurityOriginData& originData)
@@ -85,11 +86,13 @@ void WebKeyValueStorageManager::deleteEntriesForOrigin(const SecurityOriginData&
         return;
 
     StorageTracker::tracker().deleteOrigin(origin.get());
+    WebProcess::shared().terminateIfPossible();
 }
 
 void WebKeyValueStorageManager::deleteAllEntries()
 {
     StorageTracker::tracker().deleteAllOrigins();
+    WebProcess::shared().terminateIfPossible();
 }
 
 } // namespace WebKit
index 9ec3b21..6baf6d9 100644 (file)
@@ -60,6 +60,7 @@ void WebMediaCacheManager::getHostnamesWithMediaCache(uint64_t callbackID)
 #endif
 
     WebProcess::shared().connection()->send(Messages::WebMediaCacheManagerProxy::DidGetHostnamesWithMediaCache(mediaCacheHostnames, callbackID), 0);
+    WebProcess::shared().terminateIfPossible();
 }
 
 void WebMediaCacheManager::clearCacheForHostname(const String& hostname)
@@ -67,6 +68,7 @@ void WebMediaCacheManager::clearCacheForHostname(const String& hostname)
 #if ENABLE(VIDEO)
     HTMLMediaElement::clearMediaCacheForSite(hostname);
 #endif
+    WebProcess::shared().terminateIfPossible();
 }
 
 void WebMediaCacheManager::clearCacheForAllHostnames()
@@ -74,6 +76,7 @@ void WebMediaCacheManager::clearCacheForAllHostnames()
 #if ENABLE(VIDEO)
     HTMLMediaElement::clearMediaCache();
 #endif
+    WebProcess::shared().terminateIfPossible();
 }
 
 } // namespace WebKit
index dad2791..1596319 100644 (file)
@@ -93,6 +93,7 @@ void WebResourceCacheManager::getCacheOrigins(uint64_t callbackID) const
     }
 
     WebProcess::shared().connection()->send(Messages::WebResourceCacheManagerProxy::DidGetCacheOrigins(identifiers, callbackID), 0);
+    WebProcess::shared().terminateIfPossible();
 }
 
 void WebResourceCacheManager::clearCacheForOrigin(SecurityOriginData originData) const
@@ -110,11 +111,13 @@ void WebResourceCacheManager::clearCacheForOrigin(SecurityOriginData originData)
 
     clearCFURLCacheForHostNames(hostArray.get());
 #endif
+    WebProcess::shared().terminateIfPossible();
 }
 
 void WebResourceCacheManager::clearCacheForAllOrigins() const
 {
     WebProcess::shared().clearResourceCaches();
+    WebProcess::shared().terminateIfPossible();
 }
 
 } // namespace WebKit
index caa6eda..825a448 100644 (file)
@@ -105,6 +105,7 @@ void WebDatabaseManager::getDatabasesByOrigin(uint64_t callbackID) const
     }
 
     WebProcess::shared().connection()->send(Messages::WebDatabaseManagerProxy::DidGetDatabasesByOrigin(originAndDatabasesVector, callbackID), 0);
+    WebProcess::shared().terminateIfPossible();
 }
 
 void WebDatabaseManager::getDatabaseOrigins(uint64_t callbackID) const
@@ -118,6 +119,7 @@ void WebDatabaseManager::getDatabaseOrigins(uint64_t callbackID) const
     for (size_t i = 0; i < numOrigins; ++i)
         identifiers[i] = origins[i]->databaseIdentifier();
     WebProcess::shared().connection()->send(Messages::WebDatabaseManagerProxy::DidGetDatabaseOrigins(identifiers, callbackID), 0);
+    WebProcess::shared().terminateIfPossible();
 }
 
 void WebDatabaseManager::deleteDatabaseWithNameForOrigin(const String& databaseIdentifier, const String& originIdentifier) const
@@ -127,6 +129,7 @@ void WebDatabaseManager::deleteDatabaseWithNameForOrigin(const String& databaseI
         return;
 
     DatabaseTracker::tracker().deleteDatabase(origin.get(), databaseIdentifier);
+    WebProcess::shared().terminateIfPossible();
 }
 
 void WebDatabaseManager::deleteDatabasesForOrigin(const String& originIdentifier) const
@@ -136,11 +139,13 @@ void WebDatabaseManager::deleteDatabasesForOrigin(const String& originIdentifier
         return;
 
     DatabaseTracker::tracker().deleteOrigin(origin.get());
+    WebProcess::shared().terminateIfPossible();
 }
 
 void WebDatabaseManager::deleteAllDatabases() const
 {
     DatabaseTracker::tracker().deleteAllDatabases();
+    WebProcess::shared().terminateIfPossible();
 }
 
 void WebDatabaseManager::setQuotaForOrigin(const String& originIdentifier, unsigned long long quota) const
@@ -154,6 +159,7 @@ void WebDatabaseManager::setQuotaForOrigin(const String& originIdentifier, unsig
         return;
 
     DatabaseTracker::tracker().setQuota(origin.get(), quota);
+    WebProcess::shared().terminateIfPossible();
 }
 
 void WebDatabaseManager::dispatchDidModifyOrigin(SecurityOrigin* origin)