Diff
Modified: branches/safari-605-branch/LayoutTests/ChangeLog (228232 => 228233)
--- branches/safari-605-branch/LayoutTests/ChangeLog 2018-02-07 19:01:16 UTC (rev 228232)
+++ branches/safari-605-branch/LayoutTests/ChangeLog 2018-02-07 19:07:00 UTC (rev 228233)
@@ -1,3 +1,19 @@
+2018-02-07 Jason Marcell <[email protected]>
+
+ Cherry-pick r228230. rdar://problem/37319241
+
+ 2018-02-07 Chris Dumez <[email protected]>
+
+ 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 Jason Marcell <[email protected]>
Cherry-pick r228199. rdar://problem/37294597
Modified: branches/safari-605-branch/LayoutTests/TestExpectations (228232 => 228233)
--- branches/safari-605-branch/LayoutTests/TestExpectations 2018-02-07 19:01:16 UTC (rev 228232)
+++ branches/safari-605-branch/LayoutTests/TestExpectations 2018-02-07 19:07:00 UTC (rev 228233)
@@ -163,7 +163,6 @@
imported/w3c/web-platform-tests/service-workers/service-worker/update-recovery.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 ]
# Unsupported features: SharedWorker, NavigationPreload
Modified: branches/safari-605-branch/LayoutTests/imported/w3c/ChangeLog (228232 => 228233)
--- branches/safari-605-branch/LayoutTests/imported/w3c/ChangeLog 2018-02-07 19:01:16 UTC (rev 228232)
+++ branches/safari-605-branch/LayoutTests/imported/w3c/ChangeLog 2018-02-07 19:07:00 UTC (rev 228233)
@@ -1,3 +1,19 @@
+2018-02-07 Jason Marcell <[email protected]>
+
+ Cherry-pick r228230. rdar://problem/37319241
+
+ 2018-02-07 Chris Dumez <[email protected]>
+
+ 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-04 Jason Marcell <[email protected]>
Cherry-pick r228015. rdar://problem/37220133
Modified: branches/safari-605-branch/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/indexeddb.https-expected.txt (228232 => 228233)
--- branches/safari-605-branch/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/indexeddb.https-expected.txt 2018-02-07 19:01:16 UTC (rev 228232)
+++ branches/safari-605-branch/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/indexeddb.https-expected.txt 2018-02-07 19:07:00 UTC (rev 228233)
@@ -1,4 +1,5 @@
-FAIL Verify Indexed DB operation in a Service Worker promise_test: Unhandled rejection with value: object "NotSupportedError: Passing MessagePort objects to postMessage is not yet supported"
+PASS Verify Indexed DB operation in a Service Worker
PASS clean up: registration
+PASS clean up: database
Modified: branches/safari-605-branch/Source/WebKit/ChangeLog (228232 => 228233)
--- branches/safari-605-branch/Source/WebKit/ChangeLog 2018-02-07 19:01:16 UTC (rev 228232)
+++ branches/safari-605-branch/Source/WebKit/ChangeLog 2018-02-07 19:07:00 UTC (rev 228233)
@@ -1,3 +1,31 @@
+2018-02-07 Jason Marcell <[email protected]>
+
+ Cherry-pick r228230. rdar://problem/37319241
+
+ 2018-02-07 Chris Dumez <[email protected]>
+
+ 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-06 Jason Marcell <[email protected]>
Cherry-pick r228198. rdar://problem/37294605
Modified: branches/safari-605-branch/Source/WebKit/UIProcess/ServiceWorkerProcessProxy.cpp (228232 => 228233)
--- branches/safari-605-branch/Source/WebKit/UIProcess/ServiceWorkerProcessProxy.cpp 2018-02-07 19:01:16 UTC (rev 228232)
+++ branches/safari-605-branch/Source/WebKit/UIProcess/ServiceWorkerProcessProxy.cpp 2018-02-07 19:07:00 UTC (rev 228233)
@@ -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: branches/safari-605-branch/Source/WebKit/UIProcess/WebProcessPool.h (228232 => 228233)
--- branches/safari-605-branch/Source/WebKit/UIProcess/WebProcessPool.h 2018-02-07 19:01:16 UTC (rev 228232)
+++ branches/safari-605-branch/Source/WebKit/UIProcess/WebProcessPool.h 2018-02-07 19:07:00 UTC (rev 228233)
@@ -205,6 +205,8 @@
ProcessID networkProcessIdentifier();
ProcessID storageProcessIdentifier();
+ WebPageGroup& defaultPageGroup() { return m_defaultPageGroup.get(); }
+
void setAlwaysUsesComplexTextCodePath(bool);
void setShouldUseFontSmoothing(bool);
Modified: branches/safari-605-branch/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp (228232 => 228233)
--- branches/safari-605-branch/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp 2018-02-07 19:01:16 UTC (rev 228232)
+++ branches/safari-605-branch/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp 2018-02-07 19:07:00 UTC (rev 228233)
@@ -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: branches/safari-605-branch/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h (228232 => 228233)
--- branches/safari-605-branch/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h 2018-02-07 19:01:16 UTC (rev 228232)
+++ branches/safari-605-branch/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h 2018-02-07 19:07:00 UTC (rev 228233)
@@ -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: branches/safari-605-branch/Source/WebKit/WebProcess/WebProcess.cpp (228232 => 228233)
--- branches/safari-605-branch/Source/WebKit/WebProcess/WebProcess.cpp 2018-02-07 19:01:16 UTC (rev 228232)
+++ branches/safari-605-branch/Source/WebKit/WebProcess/WebProcess.cpp 2018-02-07 19:07:00 UTC (rev 228233)
@@ -1664,13 +1664,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: branches/safari-605-branch/Source/WebKit/WebProcess/WebProcess.h (228232 => 228233)
--- branches/safari-605-branch/Source/WebKit/WebProcess/WebProcess.h 2018-02-07 19:01:16 UTC (rev 228232)
+++ branches/safari-605-branch/Source/WebKit/WebProcess/WebProcess.h 2018-02-07 19:07:00 UTC (rev 228233)
@@ -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: branches/safari-605-branch/Source/WebKit/WebProcess/WebProcess.messages.in (228232 => 228233)
--- branches/safari-605-branch/Source/WebKit/WebProcess/WebProcess.messages.in 2018-02-07 19:01:16 UTC (rev 228232)
+++ branches/safari-605-branch/Source/WebKit/WebProcess/WebProcess.messages.in 2018-02-07 19:07:00 UTC (rev 228233)
@@ -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