DatabaseProcess doesn't handle WebProcesses going away uncleanly.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Jun 2016 23:46:05 +0000 (23:46 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Jun 2016 23:46:05 +0000 (23:46 +0000)
commit6e6bde54bb28df9dee8e00073131c42f731a2f7f
treea5619db12a018c50881604e10baf362a52db851f
parentc33e3aace1aa514266fba86fac28d50aee8562d7
DatabaseProcess doesn't handle WebProcesses going away uncleanly.
https://bugs.webkit.org/show_bug.cgi?id=158894

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (Covered by additions to existing API test).

* Modules/indexeddb/server/IDBConnectionToClient.cpp:
(WebCore::IDBServer::IDBConnectionToClient::registerDatabaseConnection):
(WebCore::IDBServer::IDBConnectionToClient::unregisterDatabaseConnection):
(WebCore::IDBServer::IDBConnectionToClient::connectionToClientClosed):
* Modules/indexeddb/server/IDBConnectionToClient.h:

* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::unregisterConnection): Call connectionToClientClosed() on
  the connection, which cleans up after it in the server.

* Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseConnection::UniqueIDBDatabaseConnection):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::~UniqueIDBDatabaseConnection):

Source/WebKit2:

* DatabaseProcess/DatabaseToWebProcessConnection.cpp:
(WebKit::DatabaseToWebProcessConnection::didClose):

* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess): Actually unregister this connection
  from the IDBServer so it can clean up.
(WebKit::WebIDBConnectionToClient::~WebIDBConnectionToClient):

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBMultiProcess-2.html:
* TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBMultiProcess-3.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBMultiProcess.mm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202359 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp
Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h
Source/WebCore/Modules/indexeddb/server/IDBServer.cpp
Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/DatabaseProcess/DatabaseToWebProcessConnection.cpp
Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBMultiProcess-2.html
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBMultiProcess-3.html [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBMultiProcess.mm