Title: [228653] releases/WebKitGTK/webkit-2.20
Revision
228653
Author
carlo...@webkit.org
Date
2018-02-19 03:50:32 -0800 (Mon, 19 Feb 2018)

Log Message

Merge r228230 - IndexedDB in service workers is using a memory backed store
https://bugs.webkit.org/show_bug.cgi?id=182574
<rdar://problem/37316205>

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Rebaseline WPT test that is now passing.

* web-platform-tests/service-workers/service-worker/indexeddb.https-expected.txt:

Source/WebKit:

Make sure we pass a proper WebDatabaseProvider to the ServiceWorkerProcess via
PageConfiguration. Otherwise, we end up using the default EmptyDatabaseProvider
which uses an InProcessIDBServer and a memory-backed store for IndexedDB.

* UIProcess/ServiceWorkerProcessProxy.cpp:
(WebKit::ServiceWorkerProcessProxy::start):
* UIProcess/WebProcessPool.h:
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
(WebKit::WebSWContextManagerConnection::installServiceWorker):
* WebProcess/Storage/WebSWContextManagerConnection.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::establishWorkerContextConnectionToStorageProcess):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

LayoutTests:

Unskip test that no longer times out.

* TestExpectations:

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.20/LayoutTests/ChangeLog (228652 => 228653)


--- releases/WebKitGTK/webkit-2.20/LayoutTests/ChangeLog	2018-02-19 11:50:24 UTC (rev 228652)
+++ releases/WebKitGTK/webkit-2.20/LayoutTests/ChangeLog	2018-02-19 11:50:32 UTC (rev 228653)
@@ -1,3 +1,15 @@
+2018-02-07  Chris Dumez  <cdu...@apple.com>
+
+        IndexedDB in service workers is using a memory backed store
+        https://bugs.webkit.org/show_bug.cgi?id=182574
+        <rdar://problem/37316205>
+
+        Reviewed by Youenn Fablet.
+
+        Unskip test that no longer times out.
+
+        * TestExpectations:
+
 2018-02-06  Nikita Vasilyev  <nvasil...@apple.com>
 
         Web Inspector: Rename String.prototype.trimEnd to avoid conflicts with native trimEnd

Modified: releases/WebKitGTK/webkit-2.20/LayoutTests/TestExpectations (228652 => 228653)


--- releases/WebKitGTK/webkit-2.20/LayoutTests/TestExpectations	2018-02-19 11:50:24 UTC (rev 228652)
+++ releases/WebKitGTK/webkit-2.20/LayoutTests/TestExpectations	2018-02-19 11:50:32 UTC (rev 228653)
@@ -160,7 +160,6 @@
 imported/w3c/web-platform-tests/service-workers/service-worker/update-bytecheck.https.html [ Skip ]
 imported/w3c/web-platform-tests/service-workers/service-worker/client-navigate.https.html [ Skip ]
 imported/w3c/web-platform-tests/service-workers/service-worker/clients-matchall-include-uncontrolled.https.html [ Skip ]
-imported/w3c/web-platform-tests/service-workers/service-worker/indexeddb.https.html [ Skip ]
 imported/w3c/web-platform-tests/service-workers/service-worker/appcache-ordering-main.https.html [ Skip ]
 
 # Requires additional test infrastructure.

Modified: releases/WebKitGTK/webkit-2.20/LayoutTests/imported/w3c/ChangeLog (228652 => 228653)


--- releases/WebKitGTK/webkit-2.20/LayoutTests/imported/w3c/ChangeLog	2018-02-19 11:50:24 UTC (rev 228652)
+++ releases/WebKitGTK/webkit-2.20/LayoutTests/imported/w3c/ChangeLog	2018-02-19 11:50:32 UTC (rev 228653)
@@ -1,3 +1,15 @@
+2018-02-07  Chris Dumez  <cdu...@apple.com>
+
+        IndexedDB in service workers is using a memory backed store
+        https://bugs.webkit.org/show_bug.cgi?id=182574
+        <rdar://problem/37316205>
+
+        Reviewed by Youenn Fablet.
+
+        Rebaseline WPT test that is now passing.
+
+        * web-platform-tests/service-workers/service-worker/indexeddb.https-expected.txt:
+
 2018-02-05  Manuel Rego Casasnovas  <r...@igalia.com>
 
         [css-grid] Rename gutter properties to remove "grid-" prefix

Modified: releases/WebKitGTK/webkit-2.20/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/indexeddb.https-expected.txt (228652 => 228653)


--- releases/WebKitGTK/webkit-2.20/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/indexeddb.https-expected.txt	2018-02-19 11:50:24 UTC (rev 228652)
+++ releases/WebKitGTK/webkit-2.20/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/indexeddb.https-expected.txt	2018-02-19 11:50:32 UTC (rev 228653)
@@ -1,8 +1,5 @@
-CONSOLE MESSAGE: line 14: NotFoundError: Failed to execute 'transaction' on 'IDBDatabase': One of the specified object stores was not found.
 
-Harness Error (FAIL), message = NotFoundError: Failed to execute 'transaction' on 'IDBDatabase': One of the specified object stores was not found.
+PASS Verify Indexed DB operation in a Service Worker 
+PASS clean up: registration 
+PASS clean up: database 
 
-TIMEOUT Verify Indexed DB operation in a Service Worker Test timed out
-NOTRUN clean up: registration 
-NOTRUN clean up: database 
-

Modified: releases/WebKitGTK/webkit-2.20/Source/WebKit/ChangeLog (228652 => 228653)


--- releases/WebKitGTK/webkit-2.20/Source/WebKit/ChangeLog	2018-02-19 11:50:24 UTC (rev 228652)
+++ releases/WebKitGTK/webkit-2.20/Source/WebKit/ChangeLog	2018-02-19 11:50:32 UTC (rev 228653)
@@ -1,3 +1,27 @@
+2018-02-07  Chris Dumez  <cdu...@apple.com>
+
+        IndexedDB in service workers is using a memory backed store
+        https://bugs.webkit.org/show_bug.cgi?id=182574
+        <rdar://problem/37316205>
+
+        Reviewed by Youenn Fablet.
+
+        Make sure we pass a proper WebDatabaseProvider to the ServiceWorkerProcess via
+        PageConfiguration. Otherwise, we end up using the default EmptyDatabaseProvider
+        which uses an InProcessIDBServer and a memory-backed store for IndexedDB.
+
+        * UIProcess/ServiceWorkerProcessProxy.cpp:
+        (WebKit::ServiceWorkerProcessProxy::start):
+        * UIProcess/WebProcessPool.h:
+        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
+        (WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
+        (WebKit::WebSWContextManagerConnection::installServiceWorker):
+        * WebProcess/Storage/WebSWContextManagerConnection.h:
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::establishWorkerContextConnectionToStorageProcess):
+        * WebProcess/WebProcess.h:
+        * WebProcess/WebProcess.messages.in:
+
 2018-02-07  Michael Catanzaro  <mcatanz...@igalia.com>
 
         [GTK] Typo in a translatable string

Modified: releases/WebKitGTK/webkit-2.20/Source/WebKit/UIProcess/ServiceWorkerProcessProxy.cpp (228652 => 228653)


--- releases/WebKitGTK/webkit-2.20/Source/WebKit/UIProcess/ServiceWorkerProcessProxy.cpp	2018-02-19 11:50:24 UTC (rev 228652)
+++ releases/WebKitGTK/webkit-2.20/Source/WebKit/UIProcess/ServiceWorkerProcessProxy.cpp	2018-02-19 11:50:32 UTC (rev 228653)
@@ -28,6 +28,7 @@
 
 #include "AuthenticationChallengeProxy.h"
 #include "WebCredential.h"
+#include "WebPageGroup.h"
 #include "WebPreferencesStore.h"
 #include "WebProcessMessages.h"
 #include "WebProcessPool.h"
@@ -69,7 +70,7 @@
 
 void ServiceWorkerProcessProxy::start(const WebPreferencesStore& store, std::optional<PAL::SessionID> initialSessionID)
 {
-    send(Messages::WebProcess::EstablishWorkerContextConnectionToStorageProcess { m_serviceWorkerPageID, store, initialSessionID.value_or(PAL::SessionID::defaultSessionID()) }, 0);
+    send(Messages::WebProcess::EstablishWorkerContextConnectionToStorageProcess { processPool().defaultPageGroup().pageGroupID(), m_serviceWorkerPageID, store, initialSessionID.value_or(PAL::SessionID::defaultSessionID()) }, 0);
 }
 
 void ServiceWorkerProcessProxy::setUserAgent(const String& userAgent)

Modified: releases/WebKitGTK/webkit-2.20/Source/WebKit/UIProcess/WebProcessPool.h (228652 => 228653)


--- releases/WebKitGTK/webkit-2.20/Source/WebKit/UIProcess/WebProcessPool.h	2018-02-19 11:50:24 UTC (rev 228652)
+++ releases/WebKitGTK/webkit-2.20/Source/WebKit/UIProcess/WebProcessPool.h	2018-02-19 11:50:32 UTC (rev 228653)
@@ -205,6 +205,8 @@
     ProcessID networkProcessIdentifier();
     ProcessID storageProcessIdentifier();
 
+    WebPageGroup& defaultPageGroup() { return m_defaultPageGroup.get(); }
+
     void setAlwaysUsesComplexTextCodePath(bool);
     void setShouldUseFontSmoothing(bool);
     

Modified: releases/WebKitGTK/webkit-2.20/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp (228652 => 228653)


--- releases/WebKitGTK/webkit-2.20/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp	2018-02-19 11:50:24 UTC (rev 228652)
+++ releases/WebKitGTK/webkit-2.20/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp	2018-02-19 11:50:32 UTC (rev 228653)
@@ -34,6 +34,7 @@
 #include "StorageProcessMessages.h"
 #include "WebCacheStorageProvider.h"
 #include "WebCoreArgumentCoders.h"
+#include "WebDatabaseProvider.h"
 #include "WebDocumentLoader.h"
 #include "WebPreferencesKeys.h"
 #include "WebPreferencesStore.h"
@@ -101,8 +102,9 @@
     String m_userAgent;
 };
 
-WebSWContextManagerConnection::WebSWContextManagerConnection(Ref<IPC::Connection>&& connection, uint64_t pageID, const WebPreferencesStore& store)
+WebSWContextManagerConnection::WebSWContextManagerConnection(Ref<IPC::Connection>&& connection, uint64_t pageGroupID, uint64_t pageID, const WebPreferencesStore& store)
     : m_connectionToStorageProcess(WTFMove(connection))
+    , m_pageGroupID(pageGroupID)
     , m_pageID(pageID)
     , m_userAgent(standardUserAgentWithApplicationName({ }))
 {
@@ -133,8 +135,13 @@
         WebCore::LibWebRTCProvider::create(),
         WebProcess::singleton().cacheStorageProvider()
     };
+
     fillWithEmptyClients(pageConfiguration);
 
+#if ENABLE(INDEXED_DATABASE)
+    pageConfiguration.databaseProvider = WebDatabaseProvider::getOrCreate(m_pageGroupID);
+#endif
+
     // FIXME: This method should be moved directly to WebCore::SWContextManager::Connection
     // If it weren't for ServiceWorkerFrameLoaderClient's dependence on WebDocumentLoader, this could already happen.
     auto frameLoaderClient = std::make_unique<ServiceWorkerFrameLoaderClient>(*this, sessionID, m_pageID, ++m_previousServiceWorkerID, m_userAgent);

Modified: releases/WebKitGTK/webkit-2.20/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h (228652 => 228653)


--- releases/WebKitGTK/webkit-2.20/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h	2018-02-19 11:50:24 UTC (rev 228652)
+++ releases/WebKitGTK/webkit-2.20/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h	2018-02-19 11:50:32 UTC (rev 228653)
@@ -51,7 +51,7 @@
 
 class WebSWContextManagerConnection final : public WebCore::SWContextManager::Connection, public IPC::MessageReceiver {
 public:
-    WebSWContextManagerConnection(Ref<IPC::Connection>&&, uint64_t pageID, const WebPreferencesStore&);
+    WebSWContextManagerConnection(Ref<IPC::Connection>&&, uint64_t pageGroupID, uint64_t pageID, const WebPreferencesStore&);
     ~WebSWContextManagerConnection();
 
     void didReceiveMessage(IPC::Connection&, IPC::Decoder&) final;
@@ -89,6 +89,7 @@
     void setUserAgent(String&& userAgent);
 
     Ref<IPC::Connection> m_connectionToStorageProcess;
+    uint64_t m_pageGroupID;
     uint64_t m_pageID { 0 };
     uint64_t m_previousServiceWorkerID { 0 };
 

Modified: releases/WebKitGTK/webkit-2.20/Source/WebKit/WebProcess/WebProcess.cpp (228652 => 228653)


--- releases/WebKitGTK/webkit-2.20/Source/WebKit/WebProcess/WebProcess.cpp	2018-02-19 11:50:24 UTC (rev 228652)
+++ releases/WebKitGTK/webkit-2.20/Source/WebKit/WebProcess/WebProcess.cpp	2018-02-19 11:50:32 UTC (rev 228653)
@@ -1655,13 +1655,13 @@
 #endif
 
 #if ENABLE(SERVICE_WORKER)
-void WebProcess::establishWorkerContextConnectionToStorageProcess(uint64_t pageID, const WebPreferencesStore& store, PAL::SessionID initialSessionID)
+void WebProcess::establishWorkerContextConnectionToStorageProcess(uint64_t pageGroupID, uint64_t pageID, const WebPreferencesStore& store, PAL::SessionID initialSessionID)
 {
     // We are in the Service Worker context process and the call below establishes our connection to the Storage Process
     // by calling webToStorageProcessConnection. SWContextManager needs to use the same underlying IPC::Connection as the
     // WebToStorageProcessConnection for synchronization purposes.
     auto& ipcConnection = ensureWebToStorageProcessConnection(initialSessionID).connection();
-    SWContextManager::singleton().setConnection(std::make_unique<WebSWContextManagerConnection>(ipcConnection, pageID, store));
+    SWContextManager::singleton().setConnection(std::make_unique<WebSWContextManagerConnection>(ipcConnection, pageGroupID, pageID, store));
 }
 
 void WebProcess::registerServiceWorkerClients(PAL::SessionID sessionID)

Modified: releases/WebKitGTK/webkit-2.20/Source/WebKit/WebProcess/WebProcess.h (228652 => 228653)


--- releases/WebKitGTK/webkit-2.20/Source/WebKit/WebProcess/WebProcess.h	2018-02-19 11:50:24 UTC (rev 228652)
+++ releases/WebKitGTK/webkit-2.20/Source/WebKit/WebProcess/WebProcess.h	2018-02-19 11:50:32 UTC (rev 228653)
@@ -311,7 +311,7 @@
     void setNetworkProxySettings(const WebCore::SoupNetworkProxySettings&);
 #endif
 #if ENABLE(SERVICE_WORKER)
-    void establishWorkerContextConnectionToStorageProcess(uint64_t pageID, const WebPreferencesStore&, PAL::SessionID);
+    void establishWorkerContextConnectionToStorageProcess(uint64_t pageGroupID, uint64_t pageID, const WebPreferencesStore&, PAL::SessionID);
     void registerServiceWorkerClients(PAL::SessionID);
 #endif
 

Modified: releases/WebKitGTK/webkit-2.20/Source/WebKit/WebProcess/WebProcess.messages.in (228652 => 228653)


--- releases/WebKitGTK/webkit-2.20/Source/WebKit/WebProcess/WebProcess.messages.in	2018-02-19 11:50:24 UTC (rev 228652)
+++ releases/WebKitGTK/webkit-2.20/Source/WebKit/WebProcess/WebProcess.messages.in	2018-02-19 11:50:32 UTC (rev 228653)
@@ -116,7 +116,7 @@
 #endif
 
 #if ENABLE(SERVICE_WORKER)
-    EstablishWorkerContextConnectionToStorageProcess(uint64_t pageID, struct WebKit::WebPreferencesStore store, PAL::SessionID initialSessionID)
+    EstablishWorkerContextConnectionToStorageProcess(uint64_t pageGroupID, uint64_t pageID, struct WebKit::WebPreferencesStore store, PAL::SessionID initialSessionID)
     RegisterServiceWorkerClients(PAL::SessionID sessionID)
 #endif
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to