Changeset 246184 in webkit
- Timestamp:
- Jun 6, 2019 6:28:54 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r246183 r246184 1 2019-06-06 Youenn Fablet <youenn@apple.com> 2 3 Allow WebKitTestRunner to terminate network process after it finishes service worker file operations 4 https://bugs.webkit.org/show_bug.cgi?id=198584 5 6 Reviewed by Geoffrey Garen. 7 8 * http/wpt/service-workers/service-worker-networkprocess-crash.html: 9 1 10 2019-06-06 Commit Queue <commit-queue@webkit.org> 2 11 -
trunk/LayoutTests/http/wpt/service-workers/service-worker-networkprocess-crash.html
r246089 r246184 46 46 47 47 promise_test(async (test) => { 48 if (window.internals) 49 await internals.storeRegistrationsOnDisk(); 50 48 51 if (window.testRunner && window.testRunner.terminateNetworkProcess) 49 52 testRunner.terminateNetworkProcess(); -
trunk/Source/WebCore/ChangeLog
r246182 r246184 1 2019-06-06 Youenn Fablet <youenn@apple.com> 2 3 Allow WebKitTestRunner to terminate network process after it finishes service worker file operations 4 https://bugs.webkit.org/show_bug.cgi?id=198584 5 6 Reviewed by Geoffrey Garen. 7 8 Add a promise-based internal API to store service worker registrations on disk. 9 Covered by updated test. 10 11 * testing/Internals.cpp: 12 (WebCore::Internals::storeRegistrationsOnDisk): 13 * testing/Internals.h: 14 * testing/Internals.idl: 15 * workers/service/SWClientConnection.h: 16 (WebCore::SWClientConnection::storeRegistrationsOnDiskForTesting): 17 * workers/service/server/RegistrationStore.cpp: 18 (WebCore::RegistrationStore::startSuspension): 19 (WebCore::RegistrationStore::closeDatabase): 20 * workers/service/server/RegistrationStore.h: 21 * workers/service/server/SWServer.cpp: 22 (WebCore::SWServer::Connection::storeRegistrationsOnDisk): 23 * workers/service/server/SWServer.h: 24 1 25 2019-06-06 Brent Fulgham <bfulgham@apple.com> 2 26 -
trunk/Source/WebCore/testing/Internals.cpp
r246056 r246184 4797 4797 } 4798 4798 4799 void Internals::storeRegistrationsOnDisk(DOMPromiseDeferred<void>&& promise) 4800 { 4801 #if ENABLE(SERVICE_WORKER) 4802 if (!contextDocument()) 4803 return; 4804 4805 auto& connection = ServiceWorkerProvider::singleton().serviceWorkerConnectionForSession(contextDocument()->sessionID()); 4806 connection.storeRegistrationsOnDiskForTesting([promise = WTFMove(promise)]() mutable { 4807 promise.resolve(); 4808 }); 4809 #endif 4810 } 4811 4799 4812 void Internals::clearCacheStorageMemoryRepresentation(DOMPromiseDeferred<void>&& promise) 4800 4813 { -
trunk/Source/WebCore/testing/Internals.h
r246056 r246184 719 719 bool audioSessionActive() const; 720 720 721 void storeRegistrationsOnDisk(DOMPromiseDeferred<void>&&); 722 721 723 void clearCacheStorageMemoryRepresentation(DOMPromiseDeferred<void>&&); 722 724 void cacheStorageEngineRepresentation(DOMPromiseDeferred<IDLDOMString>&&); -
trunk/Source/WebCore/testing/Internals.idl
r246056 r246184 693 693 694 694 DOMString serviceWorkerClientIdentifier(Document document); 695 Promise<void> storeRegistrationsOnDisk(); 695 696 696 697 Promise<void> clearCacheStorageMemoryRepresentation(); -
trunk/Source/WebCore/workers/service/SWClientConnection.h
r245299 r246184 89 89 virtual void updateThrottleState() = 0; 90 90 91 virtual void storeRegistrationsOnDiskForTesting(CompletionHandler<void()>&& callback) { callback(); } 92 91 93 protected: 92 94 WEBCORE_EXPORT SWClientConnection(); -
trunk/Source/WebCore/workers/service/server/RegistrationStore.cpp
r244097 r246184 88 88 { 89 89 m_isSuspended = true; 90 closeDatabase(WTFMove(completionHandler)); 91 } 92 93 void RegistrationStore::closeDatabase(CompletionHandler<void()>&& completionHandler) 94 { 90 95 m_database->close(WTFMove(completionHandler)); 91 96 } -
trunk/Source/WebCore/workers/service/server/RegistrationStore.h
r244097 r246184 49 49 ~RegistrationStore(); 50 50 51 void clearAll( WTF::CompletionHandler<void()>&&);52 void flushChanges( WTF::CompletionHandler<void()>&&);51 void clearAll(CompletionHandler<void()>&&); 52 void flushChanges(CompletionHandler<void()>&&); 53 53 54 void startSuspension(WTF::CompletionHandler<void()>&&); 54 void closeDatabase(CompletionHandler<void()>&&); 55 void startSuspension(CompletionHandler<void()>&&); 55 56 void endSuspension(); 56 57 -
trunk/Source/WebCore/workers/service/server/SWServer.cpp
r245748 r246184 879 879 } 880 880 881 void SWServer::Connection::storeRegistrationsOnDisk(CompletionHandler<void()>&& callback) 882 { 883 if (!m_server.m_registrationStore) { 884 callback(); 885 return; 886 } 887 m_server.m_registrationStore->closeDatabase(WTFMove(callback)); 888 } 889 881 890 void SWServer::Connection::resolveRegistrationReadyRequests(SWServerRegistration& registration) 882 891 { -
trunk/Source/WebCore/workers/service/server/SWServer.h
r245299 r246184 102 102 WEBCORE_EXPORT void whenRegistrationReady(uint64_t registrationReadyRequestIdentifier, const SecurityOriginData& topOrigin, const URL& clientURL); 103 103 104 WEBCORE_EXPORT void storeRegistrationsOnDisk(CompletionHandler<void()>&&); 105 104 106 private: 105 107 // Messages to the client WebProcess -
trunk/Source/WebKit/ChangeLog
r246183 r246184 1 2019-06-06 Youenn Fablet <youenn@apple.com> 2 3 Allow WebKitTestRunner to terminate network process after it finishes service worker file operations 4 https://bugs.webkit.org/show_bug.cgi?id=198584 5 6 Reviewed by Geoffrey Garen. 7 8 Add IPC binding to new internal API. 9 10 * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in: 11 * WebProcess/Storage/WebSWClientConnection.cpp: 12 (WebKit::WebSWClientConnection::storeRegistrationsOnDiskForTesting): 13 * WebProcess/Storage/WebSWClientConnection.h: 14 1 15 2019-06-06 Commit Queue <commit-queue@webkit.org> 2 16 -
trunk/Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in
r245299 r246184 47 47 48 48 SetThrottleState(bool isThrottleable) 49 StoreRegistrationsOnDisk() -> () Async 49 50 } 50 51 -
trunk/Source/WebKit/WebProcess/Storage/WebSWClientConnection.cpp
r245913 r246184 270 270 } 271 271 272 void WebSWClientConnection::storeRegistrationsOnDiskForTesting(CompletionHandler<void()>&& callback) 273 { 274 initializeConnectionIfNeeded(); 275 sendWithAsyncReply(Messages::WebSWServerConnection::StoreRegistrationsOnDisk { }, WTFMove(callback)); 276 } 277 272 278 } // namespace WebKit 273 279 -
trunk/Source/WebKit/WebProcess/Storage/WebSWClientConnection.h
r245873 r246184 94 94 void updateThrottleState() final; 95 95 bool isThrottleable() const final { return m_isThrottleable; } 96 void storeRegistrationsOnDiskForTesting(CompletionHandler<void()>&&) final; 96 97 97 98 void scheduleStorageJob(const WebCore::ServiceWorkerJobData&);
Note: See TracChangeset
for help on using the changeset viewer.