Reuse existing web processes for running service workers
https://bugs.webkit.org/show_bug.cgi?id=202195

Unreviewed.


* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::disableServiceWorkers):
(WebKit::WebProcessProxy::enableServiceWorkers):
Fix case where ENABLE_SERVICE_WORKER is not defined.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@251073 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog
index 75aaac4..142a709 100644
--- a/Source/WebKit/ChangeLog
+++ b/Source/WebKit/ChangeLog
@@ -1,3 +1,15 @@
+2019-10-14  youenn fablet  <youenn@apple.com>
+
+        Reuse existing web processes for running service workers
+        https://bugs.webkit.org/show_bug.cgi?id=202195
+
+        Unreviewed.
+
+        * UIProcess/WebProcessProxy.cpp:
+        (WebKit::WebProcessProxy::disableServiceWorkers):
+        (WebKit::WebProcessProxy::enableServiceWorkers):
+        Fix case where ENABLE_SERVICE_WORKER is not defined.
+
 2019-10-14  Philippe Normand  <pnormand@igalia.com>
 
         [GTK][WebInspector] Support for saving data
diff --git a/Source/WebKit/UIProcess/WebProcessProxy.cpp b/Source/WebKit/UIProcess/WebProcessProxy.cpp
index 6988654..e00c8df 100644
--- a/Source/WebKit/UIProcess/WebProcessProxy.cpp
+++ b/Source/WebKit/UIProcess/WebProcessProxy.cpp
@@ -1568,6 +1568,7 @@
     ASSERT(m_serviceWorkerInformation);
     send(Messages::WebSWContextManagerConnection::UpdatePreferencesStore { store }, 0);
 }
+#endif
 
 void WebProcessProxy::disableServiceWorkers()
 {
@@ -1575,9 +1576,11 @@
         return;
 
     m_serviceWorkerInformation = { };
-    processPool().removeFromServiceWorkerProcesses(*this);
 
+#if ENABLE(SERVICE_WORKER)
+    processPool().removeFromServiceWorkerProcesses(*this);
     send(Messages::WebSWContextManagerConnection::Close { }, 0);
+#endif
 
     maybeShutDown();
 }
@@ -1588,7 +1591,6 @@
     ASSERT(!m_serviceWorkerInformation);
     m_serviceWorkerInformation = ServiceWorkerInformation { WebPageProxyIdentifier::generate(), PageIdentifier::generate() };
 }
-#endif
 
 } // namespace WebKit