Changeset 228230 in webkit


Ignore:
Timestamp:
Feb 7, 2018 10:51:21 AM (6 years ago)
Author:
Chris Dumez
Message:

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.

Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r228228 r228230  
     12018-02-07  Chris Dumez  <cdumez@apple.com>
     2
     3        IndexedDB in service workers is using a memory backed store
     4        https://bugs.webkit.org/show_bug.cgi?id=182574
     5        <rdar://problem/37316205>
     6
     7        Reviewed by Youenn Fablet.
     8
     9        Unskip test that no longer times out.
     10
     11        * TestExpectations:
     12
    1132018-02-07  Ms2ger  <Ms2ger@igalia.com>
    214
  • trunk/LayoutTests/TestExpectations

    r228199 r228230  
    160160imported/w3c/web-platform-tests/service-workers/service-worker/client-navigate.https.html [ Skip ]
    161161imported/w3c/web-platform-tests/service-workers/service-worker/clients-matchall-include-uncontrolled.https.html [ Skip ]
    162 imported/w3c/web-platform-tests/service-workers/service-worker/indexeddb.https.html [ Skip ]
    163162imported/w3c/web-platform-tests/service-workers/service-worker/appcache-ordering-main.https.html [ Skip ]
    164163
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r228113 r228230  
     12018-02-07  Chris Dumez  <cdumez@apple.com>
     2
     3        IndexedDB in service workers is using a memory backed store
     4        https://bugs.webkit.org/show_bug.cgi?id=182574
     5        <rdar://problem/37316205>
     6
     7        Reviewed by Youenn Fablet.
     8
     9        Rebaseline WPT test that is now passing.
     10
     11        * web-platform-tests/service-workers/service-worker/indexeddb.https-expected.txt:
     12
    1132018-02-05  Chris Dumez  <cdumez@apple.com>
    214
  • trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/indexeddb.https-expected.txt

    r227543 r228230  
    1 CONSOLE MESSAGE: line 14: NotFoundError: Failed to execute 'transaction' on 'IDBDatabase': One of the specified object stores was not found.
    21
    3 Harness Error (FAIL), message = NotFoundError: Failed to execute 'transaction' on 'IDBDatabase': One of the specified object stores was not found.
     2PASS Verify Indexed DB operation in a Service Worker
     3PASS clean up: registration
     4PASS clean up: database
    45
    5 TIMEOUT Verify Indexed DB operation in a Service Worker Test timed out
    6 NOTRUN clean up: registration
    7 NOTRUN clean up: database
    8 
  • trunk/Source/WebKit/ChangeLog

    r228227 r228230  
     12018-02-07  Chris Dumez  <cdumez@apple.com>
     2
     3        IndexedDB in service workers is using a memory backed store
     4        https://bugs.webkit.org/show_bug.cgi?id=182574
     5        <rdar://problem/37316205>
     6
     7        Reviewed by Youenn Fablet.
     8
     9        Make sure we pass a proper WebDatabaseProvider to the ServiceWorkerProcess via
     10        PageConfiguration. Otherwise, we end up using the default EmptyDatabaseProvider
     11        which uses an InProcessIDBServer and a memory-backed store for IndexedDB.
     12
     13        * UIProcess/ServiceWorkerProcessProxy.cpp:
     14        (WebKit::ServiceWorkerProcessProxy::start):
     15        * UIProcess/WebProcessPool.h:
     16        * WebProcess/Storage/WebSWContextManagerConnection.cpp:
     17        (WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
     18        (WebKit::WebSWContextManagerConnection::installServiceWorker):
     19        * WebProcess/Storage/WebSWContextManagerConnection.h:
     20        * WebProcess/WebProcess.cpp:
     21        (WebKit::WebProcess::establishWorkerContextConnectionToStorageProcess):
     22        * WebProcess/WebProcess.h:
     23        * WebProcess/WebProcess.messages.in:
     24
    1252018-02-07  Michael Catanzaro  <mcatanzaro@igalia.com>
    226
  • trunk/Source/WebKit/UIProcess/ServiceWorkerProcessProxy.cpp

    r227161 r228230  
    2929#include "AuthenticationChallengeProxy.h"
    3030#include "WebCredential.h"
     31#include "WebPageGroup.h"
    3132#include "WebPreferencesStore.h"
    3233#include "WebProcessMessages.h"
     
    7071void ServiceWorkerProcessProxy::start(const WebPreferencesStore& store, std::optional<PAL::SessionID> initialSessionID)
    7172{
    72     send(Messages::WebProcess::EstablishWorkerContextConnectionToStorageProcess { m_serviceWorkerPageID, store, initialSessionID.value_or(PAL::SessionID::defaultSessionID()) }, 0);
     73    send(Messages::WebProcess::EstablishWorkerContextConnectionToStorageProcess { processPool().defaultPageGroup().pageGroupID(), m_serviceWorkerPageID, store, initialSessionID.value_or(PAL::SessionID::defaultSessionID()) }, 0);
    7374}
    7475
  • trunk/Source/WebKit/UIProcess/WebProcessPool.h

    r228188 r228230  
    206206    ProcessID storageProcessIdentifier();
    207207
     208    WebPageGroup& defaultPageGroup() { return m_defaultPageGroup.get(); }
     209
    208210    void setAlwaysUsesComplexTextCodePath(bool);
    209211    void setShouldUseFontSmoothing(bool);
  • trunk/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp

    r227425 r228230  
    3535#include "WebCacheStorageProvider.h"
    3636#include "WebCoreArgumentCoders.h"
     37#include "WebDatabaseProvider.h"
    3738#include "WebDocumentLoader.h"
    3839#include "WebPreferencesKeys.h"
     
    102103};
    103104
    104 WebSWContextManagerConnection::WebSWContextManagerConnection(Ref<IPC::Connection>&& connection, uint64_t pageID, const WebPreferencesStore& store)
     105WebSWContextManagerConnection::WebSWContextManagerConnection(Ref<IPC::Connection>&& connection, uint64_t pageGroupID, uint64_t pageID, const WebPreferencesStore& store)
    105106    : m_connectionToStorageProcess(WTFMove(connection))
     107    , m_pageGroupID(pageGroupID)
    106108    , m_pageID(pageID)
    107109    , m_userAgent(standardUserAgentWithApplicationName({ }))
     
    134136        WebProcess::singleton().cacheStorageProvider()
    135137    };
     138
    136139    fillWithEmptyClients(pageConfiguration);
     140
     141#if ENABLE(INDEXED_DATABASE)
     142    pageConfiguration.databaseProvider = WebDatabaseProvider::getOrCreate(m_pageGroupID);
     143#endif
    137144
    138145    // FIXME: This method should be moved directly to WebCore::SWContextManager::Connection
  • trunk/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h

    r227425 r228230  
    5252class WebSWContextManagerConnection final : public WebCore::SWContextManager::Connection, public IPC::MessageReceiver {
    5353public:
    54     WebSWContextManagerConnection(Ref<IPC::Connection>&&, uint64_t pageID, const WebPreferencesStore&);
     54    WebSWContextManagerConnection(Ref<IPC::Connection>&&, uint64_t pageGroupID, uint64_t pageID, const WebPreferencesStore&);
    5555    ~WebSWContextManagerConnection();
    5656
     
    9090
    9191    Ref<IPC::Connection> m_connectionToStorageProcess;
     92    uint64_t m_pageGroupID;
    9293    uint64_t m_pageID { 0 };
    9394    uint64_t m_previousServiceWorkerID { 0 };
  • trunk/Source/WebKit/WebProcess/WebProcess.cpp

    r228188 r228230  
    16541654
    16551655#if ENABLE(SERVICE_WORKER)
    1656 void WebProcess::establishWorkerContextConnectionToStorageProcess(uint64_t pageID, const WebPreferencesStore& store, PAL::SessionID initialSessionID)
     1656void WebProcess::establishWorkerContextConnectionToStorageProcess(uint64_t pageGroupID, uint64_t pageID, const WebPreferencesStore& store, PAL::SessionID initialSessionID)
    16571657{
    16581658    // We are in the Service Worker context process and the call below establishes our connection to the Storage Process
     
    16601660    // WebToStorageProcessConnection for synchronization purposes.
    16611661    auto& ipcConnection = ensureWebToStorageProcessConnection(initialSessionID).connection();
    1662     SWContextManager::singleton().setConnection(std::make_unique<WebSWContextManagerConnection>(ipcConnection, pageID, store));
     1662    SWContextManager::singleton().setConnection(std::make_unique<WebSWContextManagerConnection>(ipcConnection, pageGroupID, pageID, store));
    16631663}
    16641664
  • trunk/Source/WebKit/WebProcess/WebProcess.h

    r227709 r228230  
    312312#endif
    313313#if ENABLE(SERVICE_WORKER)
    314     void establishWorkerContextConnectionToStorageProcess(uint64_t pageID, const WebPreferencesStore&, PAL::SessionID);
     314    void establishWorkerContextConnectionToStorageProcess(uint64_t pageGroupID, uint64_t pageID, const WebPreferencesStore&, PAL::SessionID);
    315315    void registerServiceWorkerClients(PAL::SessionID);
    316316#endif
  • trunk/Source/WebKit/WebProcess/WebProcess.messages.in

    r227566 r228230  
    117117
    118118#if ENABLE(SERVICE_WORKER)
    119     EstablishWorkerContextConnectionToStorageProcess(uint64_t pageID, struct WebKit::WebPreferencesStore store, PAL::SessionID initialSessionID)
     119    EstablishWorkerContextConnectionToStorageProcess(uint64_t pageGroupID, uint64_t pageID, struct WebKit::WebPreferencesStore store, PAL::SessionID initialSessionID)
    120120    RegisterServiceWorkerClients(PAL::SessionID sessionID)
    121121#endif
Note: See TracChangeset for help on using the changeset viewer.