Add API test coverage for SW RegistrationDatabase destruction and fix issues found...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Jun 2018 20:11:41 +0000 (20:11 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Jun 2018 20:11:41 +0000 (20:11 +0000)
commit5f15bd9eec3f2b712e54e34337fa53da71aabd23
treec6a3d6872baf12e6075fb0c14ce72d3dfd867742
parent6b29e41e5c87c579b10e37898249982f7c74b8b3
Add API test coverage for SW RegistrationDatabase destruction and fix issues found by the test
https://bugs.webkit.org/show_bug.cgi?id=186681

Reviewed by Brady Eidson.

Source/WebCore:

* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::RegistrationDatabase):
(WebCore::RegistrationDatabase::importRecords):
* workers/service/server/RegistrationDatabase.h:
Rename m_session to m_sessionID for clarity.

* workers/service/server/RegistrationStore.cpp:
(WebCore::RegistrationStore::~RegistrationStore):
Drop bad assertion now that the RegistrationDatabase is refcounted
and can outlive the RegistrationStore. The RegistrationDatabase will
take care of closing / destroying the SQLiteDatabase on the background
thread when destroyed.

Source/WebKit:

Make sure StorageProcess::unregisterSWServerConnection() does not unnecessarily
create a SWServer. Otherwise, we were in quick session destroying the SWServer
and then re-constructing it for the same sessionID, merely to try ot unregister
a SWServerConnection.

* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::existingSWOriginStoreForSession const):
(WebKit::StorageProcess::unregisterSWServerConnection):
* StorageProcess/StorageProcess.h:

Tools:

       Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232891 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/workers/service/server/RegistrationDatabase.cpp
Source/WebCore/workers/service/server/RegistrationDatabase.h
Source/WebCore/workers/service/server/RegistrationStore.cpp
Source/WebKit/ChangeLog
Source/WebKit/StorageProcess/StorageProcess.cpp
Source/WebKit/StorageProcess/StorageProcess.h
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm