Changeset 233562 in webkit
- Timestamp:
- Jul 5, 2018 10:48:35 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r233560 r233562 1 2018-07-05 Brady Eidson <beidson@apple.com> 2 3 IndexedDB operations in a Page fail after a StorageProcess crash. 4 <rdar://problem/41626526> and https://bugs.webkit.org/show_bug.cgi?id=187123 5 6 Reviewed by Alex Christensen. 7 8 * storage/indexeddb/modern/opendatabase-after-storage-crash.html: Added. 9 1 10 2018-07-05 Ryosuke Niwa <rniwa@webkit.org> 2 11 -
trunk/LayoutTests/TestExpectations
r233500 r233562 119 119 http/tests/navigation/process-swap-window-open.html [ Skip ] 120 120 http/tests/navigation/useragent-reload.php [ Skip ] 121 storage/indexeddb/modern/opendatabase-after-storage-crash.html [ Skip ] 121 122 122 123 # Only Mac and iOS have an implementation of UIScriptController::doAsyncTask(). -
trunk/LayoutTests/platform/wk2/TestExpectations
r233414 r233562 737 737 738 738 http/tests/navigation/useragent-reload.php [ Pass ] 739 storage/indexeddb/modern/opendatabase-after-storage-crash.html [ Pass ] 740 739 741 740 742 ### END OF (5) Progressions, expected successes that are expected failures in WebKit1. -
trunk/Source/WebCore/ChangeLog
r233560 r233562 1 2018-07-05 Brady Eidson <beidson@apple.com> 2 3 IndexedDB operations in a Page fail after a StorageProcess crash. 4 <rdar://problem/41626526> and https://bugs.webkit.org/show_bug.cgi?id=187123 5 6 Reviewed by Alex Christensen. 7 8 Test: storage/indexeddb/modern/opendatabase-after-storage-crash.html 9 10 When the connection to a StorageProcess goes away, explicitly tell all of the WebPages 11 in the WebProcess about it. 12 13 This puts Documents/Workers in an error mode where requests fail instead of timeout. 14 It also clears the Page's connection so *new* Documents and Workers will get a fresh 15 new connection that works. 16 17 * Modules/indexeddb/client/IDBConnectionToServer.cpp: 18 (WebCore::IDBClient::IDBConnectionToServer::callResultFunctionLater): 19 (WebCore::IDBClient::IDBConnectionToServer::deleteDatabase): 20 (WebCore::IDBClient::IDBConnectionToServer::openDatabase): 21 (WebCore::IDBClient::IDBConnectionToServer::createObjectStore): 22 (WebCore::IDBClient::IDBConnectionToServer::deleteObjectStore): 23 (WebCore::IDBClient::IDBConnectionToServer::renameObjectStore): 24 (WebCore::IDBClient::IDBConnectionToServer::clearObjectStore): 25 (WebCore::IDBClient::IDBConnectionToServer::createIndex): 26 (WebCore::IDBClient::IDBConnectionToServer::deleteIndex): 27 (WebCore::IDBClient::IDBConnectionToServer::renameIndex): 28 (WebCore::IDBClient::IDBConnectionToServer::putOrAdd): 29 (WebCore::IDBClient::IDBConnectionToServer::getRecord): 30 (WebCore::IDBClient::IDBConnectionToServer::getAllRecords): 31 (WebCore::IDBClient::IDBConnectionToServer::getCount): 32 (WebCore::IDBClient::IDBConnectionToServer::deleteRecord): 33 (WebCore::IDBClient::IDBConnectionToServer::openCursor): 34 (WebCore::IDBClient::IDBConnectionToServer::iterateCursor): 35 (WebCore::IDBClient::IDBConnectionToServer::establishTransaction): 36 (WebCore::IDBClient::IDBConnectionToServer::commitTransaction): 37 (WebCore::IDBClient::IDBConnectionToServer::didFinishHandlingVersionChangeTransaction): 38 (WebCore::IDBClient::IDBConnectionToServer::abortTransaction): 39 (WebCore::IDBClient::IDBConnectionToServer::didFireVersionChangeEvent): 40 (WebCore::IDBClient::IDBConnectionToServer::confirmDidCloseFromServer): 41 (WebCore::IDBClient::IDBConnectionToServer::connectionToServerLost): 42 (WebCore::IDBClient::IDBConnectionToServer::openDBRequestCancelled): 43 (WebCore::IDBClient::IDBConnectionToServer::databaseConnectionPendingClose): 44 (WebCore::IDBClient::IDBConnectionToServer::databaseConnectionClosed): 45 (WebCore::IDBClient::IDBConnectionToServer::abortOpenAndUpgradeNeeded): 46 (WebCore::IDBClient::IDBConnectionToServer::getAllDatabaseNames): 47 * Modules/indexeddb/client/IDBConnectionToServer.h: 48 49 * Modules/indexeddb/shared/IDBError.h: 50 (WebCore::IDBError::serverConnectionLostError): 51 52 * page/Page.cpp: 53 (WebCore::Page::setSessionID): 54 (WebCore::Page::idbConnection): 55 (WebCore::Page::optionalIDBConnection): 56 (WebCore::Page::clearIDBConnection): 57 * page/Page.h: 58 1 59 2018-07-05 Ryosuke Niwa <rniwa@webkit.org> 2 60 -
trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp
r229979 r233562 65 65 } 66 66 67 void IDBConnectionToServer::callResultFunctionWithErrorLater(ResultFunction function, const IDBResourceIdentifier& requestIdentifier) 68 { 69 callOnMainThread([this, protectedThis = makeRef(*this), function, requestIdentifier]() { 70 (this->*function)(IDBResultData::error(requestIdentifier, IDBError::serverConnectionLostError())); 71 }); 72 } 73 67 74 void IDBConnectionToServer::deleteDatabase(const IDBRequestData& request) 68 75 { 69 76 LOG(IndexedDB, "IDBConnectionToServer::deleteDatabase - %s", request.databaseIdentifier().debugString().utf8().data()); 70 m_delegate->deleteDatabase(request); 77 78 if (m_serverConnectionIsValid) 79 m_delegate->deleteDatabase(request); 80 else 81 callResultFunctionWithErrorLater(&IDBConnectionToServer::didDeleteDatabase, request.requestIdentifier()); 71 82 } 72 83 … … 80 91 { 81 92 LOG(IndexedDB, "IDBConnectionToServer::openDatabase - %s (%s) (%" PRIu64 ")", request.databaseIdentifier().debugString().utf8().data(), request.requestIdentifier().loggingString().utf8().data(), request.requestedVersion()); 82 m_delegate->openDatabase(request); 93 94 if (m_serverConnectionIsValid) 95 m_delegate->openDatabase(request); 96 else 97 callResultFunctionWithErrorLater(&IDBConnectionToServer::didOpenDatabase, request.requestIdentifier()); 83 98 } 84 99 … … 94 109 ASSERT(isMainThread()); 95 110 96 m_delegate->createObjectStore(requestData, info); 111 if (m_serverConnectionIsValid) 112 m_delegate->createObjectStore(requestData, info); 113 else 114 callResultFunctionWithErrorLater(&IDBConnectionToServer::didCreateObjectStore, requestData.requestIdentifier()); 97 115 } 98 116 … … 108 126 ASSERT(isMainThread()); 109 127 110 m_delegate->deleteObjectStore(requestData, objectStoreName); 128 if (m_serverConnectionIsValid) 129 m_delegate->deleteObjectStore(requestData, objectStoreName); 130 else 131 callResultFunctionWithErrorLater(&IDBConnectionToServer::didDeleteObjectStore, requestData.requestIdentifier()); 111 132 } 112 133 … … 122 143 ASSERT(isMainThread()); 123 144 124 m_delegate->renameObjectStore(requestData, objectStoreIdentifier, newName); 145 if (m_serverConnectionIsValid) 146 m_delegate->renameObjectStore(requestData, objectStoreIdentifier, newName); 147 else 148 callResultFunctionWithErrorLater(&IDBConnectionToServer::didRenameObjectStore, requestData.requestIdentifier()); 125 149 } 126 150 … … 136 160 ASSERT(isMainThread()); 137 161 138 m_delegate->clearObjectStore(requestData, objectStoreIdentifier); 162 if (m_serverConnectionIsValid) 163 m_delegate->clearObjectStore(requestData, objectStoreIdentifier); 164 else 165 callResultFunctionWithErrorLater(&IDBConnectionToServer::didClearObjectStore, requestData.requestIdentifier()); 139 166 } 140 167 … … 150 177 ASSERT(isMainThread()); 151 178 152 m_delegate->createIndex(requestData, info); 179 if (m_serverConnectionIsValid) 180 m_delegate->createIndex(requestData, info); 181 else 182 callResultFunctionWithErrorLater(&IDBConnectionToServer::didCreateIndex, requestData.requestIdentifier()); 153 183 } 154 184 … … 164 194 ASSERT(isMainThread()); 165 195 166 m_delegate->deleteIndex(requestData, objectStoreIdentifier, indexName); 196 if (m_serverConnectionIsValid) 197 m_delegate->deleteIndex(requestData, objectStoreIdentifier, indexName); 198 else 199 callResultFunctionWithErrorLater(&IDBConnectionToServer::didDeleteIndex, requestData.requestIdentifier()); 167 200 } 168 201 … … 178 211 ASSERT(isMainThread()); 179 212 180 m_delegate->renameIndex(requestData, objectStoreIdentifier, indexIdentifier, newName); 213 if (m_serverConnectionIsValid) 214 m_delegate->renameIndex(requestData, objectStoreIdentifier, indexIdentifier, newName); 215 else 216 callResultFunctionWithErrorLater(&IDBConnectionToServer::didRenameIndex, requestData.requestIdentifier()); 181 217 } 182 218 … … 192 228 ASSERT(isMainThread()); 193 229 194 m_delegate->putOrAdd(requestData, key, value, overwriteMode); 230 if (m_serverConnectionIsValid) 231 m_delegate->putOrAdd(requestData, key, value, overwriteMode); 232 else 233 callResultFunctionWithErrorLater(&IDBConnectionToServer::didPutOrAdd, requestData.requestIdentifier()); 195 234 } 196 235 … … 207 246 ASSERT(!getRecordData.keyRangeData.isNull); 208 247 209 m_delegate->getRecord(requestData, getRecordData); 248 if (m_serverConnectionIsValid) 249 m_delegate->getRecord(requestData, getRecordData); 250 else 251 callResultFunctionWithErrorLater(&IDBConnectionToServer::didGetRecord, requestData.requestIdentifier()); 210 252 } 211 253 … … 221 263 ASSERT(isMainThread()); 222 264 223 m_delegate->getAllRecords(requestData, getAllRecordsData); 265 if (m_serverConnectionIsValid) 266 m_delegate->getAllRecords(requestData, getAllRecordsData); 267 else 268 callResultFunctionWithErrorLater(&IDBConnectionToServer::didGetAllRecords, requestData.requestIdentifier()); 224 269 } 225 270 … … 236 281 ASSERT(!keyRangeData.isNull); 237 282 238 m_delegate->getCount(requestData, keyRangeData); 283 if (m_serverConnectionIsValid) 284 m_delegate->getCount(requestData, keyRangeData); 285 else 286 callResultFunctionWithErrorLater(&IDBConnectionToServer::didGetCount, requestData.requestIdentifier()); 239 287 } 240 288 … … 251 299 ASSERT(!keyRangeData.isNull); 252 300 253 m_delegate->deleteRecord(requestData, keyRangeData); 301 if (m_serverConnectionIsValid) 302 m_delegate->deleteRecord(requestData, keyRangeData); 303 else 304 callResultFunctionWithErrorLater(&IDBConnectionToServer::didDeleteRecord, requestData.requestIdentifier()); 254 305 } 255 306 … … 265 316 ASSERT(isMainThread()); 266 317 267 m_delegate->openCursor(requestData, info); 318 if (m_serverConnectionIsValid) 319 m_delegate->openCursor(requestData, info); 320 else 321 callResultFunctionWithErrorLater(&IDBConnectionToServer::didOpenCursor, requestData.requestIdentifier()); 268 322 } 269 323 … … 279 333 ASSERT(isMainThread()); 280 334 281 m_delegate->iterateCursor(requestData, data); 335 if (m_serverConnectionIsValid) 336 m_delegate->iterateCursor(requestData, data); 337 else 338 callResultFunctionWithErrorLater(&IDBConnectionToServer::didIterateCursor, requestData.requestIdentifier()); 282 339 } 283 340 … … 293 350 ASSERT(isMainThread()); 294 351 295 m_delegate->establishTransaction(databaseConnectionIdentifier, info); 352 if (m_serverConnectionIsValid) 353 m_delegate->establishTransaction(databaseConnectionIdentifier, info); 296 354 } 297 355 … … 301 359 ASSERT(isMainThread()); 302 360 303 m_delegate->commitTransaction(transactionIdentifier); 361 if (m_serverConnectionIsValid) 362 m_delegate->commitTransaction(transactionIdentifier); 363 else { 364 callOnMainThread([this, protectedThis = makeRef(*this), transactionIdentifier] { 365 didCommitTransaction(transactionIdentifier, IDBError::serverConnectionLostError()); 366 }); 367 } 304 368 } 305 369 … … 317 381 ASSERT(isMainThread()); 318 382 319 m_delegate->didFinishHandlingVersionChangeTransaction(databaseConnectionIdentifier, transactionIdentifier); 383 if (m_serverConnectionIsValid) 384 m_delegate->didFinishHandlingVersionChangeTransaction(databaseConnectionIdentifier, transactionIdentifier); 320 385 } 321 386 … … 325 390 ASSERT(isMainThread()); 326 391 327 m_delegate->abortTransaction(transactionIdentifier); 392 if (m_serverConnectionIsValid) 393 m_delegate->abortTransaction(transactionIdentifier); 394 else { 395 callOnMainThread([this, protectedThis = makeRef(*this), transactionIdentifier] { 396 didAbortTransaction(transactionIdentifier, IDBError::serverConnectionLostError()); 397 }); 398 } 328 399 } 329 400 … … 349 420 ASSERT(isMainThread()); 350 421 351 m_delegate->didFireVersionChangeEvent(databaseConnectionIdentifier, requestIdentifier); 422 if (m_serverConnectionIsValid) 423 m_delegate->didFireVersionChangeEvent(databaseConnectionIdentifier, requestIdentifier); 352 424 } 353 425 … … 373 445 ASSERT(isMainThread()); 374 446 375 m_delegate->confirmDidCloseFromServer(databaseConnectionIdentifier); 447 if (m_serverConnectionIsValid) 448 m_delegate->confirmDidCloseFromServer(databaseConnectionIdentifier); 376 449 } 377 450 … … 380 453 LOG(IndexedDB, "IDBConnectionToServer::connectionToServerLost"); 381 454 ASSERT(isMainThread()); 382 455 ASSERT(m_serverConnectionIsValid); 456 457 m_serverConnectionIsValid = false; 383 458 m_proxy->connectionToServerLost(error); 384 459 } … … 397 472 ASSERT(isMainThread()); 398 473 399 m_delegate->openDBRequestCancelled(requestData); 474 if (m_serverConnectionIsValid) 475 m_delegate->openDBRequestCancelled(requestData); 400 476 } 401 477 … … 405 481 ASSERT(isMainThread()); 406 482 407 m_delegate->databaseConnectionPendingClose(databaseConnectionIdentifier); 483 if (m_serverConnectionIsValid) 484 m_delegate->databaseConnectionPendingClose(databaseConnectionIdentifier); 408 485 } 409 486 … … 413 490 ASSERT(isMainThread()); 414 491 415 m_delegate->databaseConnectionClosed(databaseConnectionIdentifier); 492 if (m_serverConnectionIsValid) 493 m_delegate->databaseConnectionClosed(databaseConnectionIdentifier); 416 494 } 417 495 … … 421 499 ASSERT(isMainThread()); 422 500 423 m_delegate->abortOpenAndUpgradeNeeded(databaseConnectionIdentifier, transactionIdentifier); 501 if (m_serverConnectionIsValid) 502 m_delegate->abortOpenAndUpgradeNeeded(databaseConnectionIdentifier, transactionIdentifier); 424 503 } 425 504 … … 430 509 m_getAllDatabaseNamesCallbacks.add(++callbackID, WTFMove(callback)); 431 510 432 m_delegate->getAllDatabaseNames(mainFrameOrigin.data(), openingOrigin.data(), callbackID); 511 if (m_serverConnectionIsValid) 512 m_delegate->getAllDatabaseNames(mainFrameOrigin.data(), openingOrigin.data(), callbackID); 513 else { 514 callOnMainThread([this, protectedThis = makeRef(*this), callbackID = callbackID] { 515 didGetAllDatabaseNames(callbackID, { }); 516 }); 517 } 433 518 } 434 519 -
trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h
r218048 r233562 56 56 WEBCORE_EXPORT static Ref<IDBConnectionToServer> create(IDBConnectionToServerDelegate&); 57 57 58 uint64_t identifier() const;58 WEBCORE_EXPORT uint64_t identifier() const; 59 59 60 60 IDBConnectionProxy& proxy(); … … 144 144 IDBConnectionToServer(IDBConnectionToServerDelegate&); 145 145 146 typedef void (IDBConnectionToServer::*ResultFunction)(const IDBResultData&); 147 void callResultFunctionWithErrorLater(ResultFunction, const IDBResourceIdentifier& requestIdentifier); 148 146 149 Ref<IDBConnectionToServerDelegate> m_delegate; 150 bool m_serverConnectionIsValid { true }; 147 151 148 152 HashMap<uint64_t, WTF::Function<void (const Vector<String>&)>> m_getAllDatabaseNamesCallbacks; -
trunk/Source/WebCore/Modules/indexeddb/shared/IDBError.h
r233122 r233562 41 41 { 42 42 return IDBError { UnknownError, "Database deleted by request of the user"_s }; 43 } 44 45 static IDBError serverConnectionLostError() 46 { 47 return IDBError { UnknownError, "Connection to Indexed Database server lost. Refresh the page to try again"_s }; 43 48 } 44 49 -
trunk/Source/WebCore/page/Page.cpp
r233560 r233562 2197 2197 #if ENABLE(INDEXED_DATABASE) 2198 2198 if (sessionID != m_sessionID) 2199 m_idb IDBConnectionToServer = nullptr;2199 m_idbConnectionToServer = nullptr; 2200 2200 #endif 2201 2201 … … 2321 2321 IDBClient::IDBConnectionToServer& Page::idbConnection() 2322 2322 { 2323 if (!m_idb IDBConnectionToServer)2324 m_idb IDBConnectionToServer = &databaseProvider().idbConnectionToServerForSession(m_sessionID);2323 if (!m_idbConnectionToServer) 2324 m_idbConnectionToServer = &databaseProvider().idbConnectionToServerForSession(m_sessionID); 2325 2325 2326 return *m_idbIDBConnectionToServer; 2326 return *m_idbConnectionToServer; 2327 } 2328 2329 IDBClient::IDBConnectionToServer* Page::optionalIDBConnection() 2330 { 2331 return m_idbConnectionToServer.get(); 2332 } 2333 2334 void Page::clearIDBConnection() 2335 { 2336 m_idbConnectionToServer = nullptr; 2327 2337 } 2328 2338 #endif -
trunk/Source/WebCore/page/Page.h
r233560 r233562 607 607 #if ENABLE(INDEXED_DATABASE) 608 608 IDBClient::IDBConnectionToServer& idbConnection(); 609 WEBCORE_EXPORT IDBClient::IDBConnectionToServer* optionalIDBConnection(); 610 WEBCORE_EXPORT void clearIDBConnection(); 609 611 #endif 610 612 … … 822 824 823 825 #if ENABLE(INDEXED_DATABASE) 824 RefPtr<IDBClient::IDBConnectionToServer> m_idb IDBConnectionToServer;826 RefPtr<IDBClient::IDBConnectionToServer> m_idbConnectionToServer; 825 827 #endif 826 828 -
trunk/Source/WebKit/ChangeLog
r233561 r233562 1 2018-07-05 Brady Eidson <beidson@apple.com> 2 3 IndexedDB operations in a Page fail after a StorageProcess crash. 4 <rdar://problem/41626526> and https://bugs.webkit.org/show_bug.cgi?id=187123 5 6 Reviewed by Alex Christensen. 7 8 When the connection to a StorageProcess goes away, explicitly tell all of the WebPages 9 in the WebProcess about it. 10 11 This puts Documents/Workers in an error mode where requests fail instead of timeout. 12 It also clears the Page's connection so *new* Documents and Workers will get a fresh 13 new connection that works. 14 15 * UIProcess/API/C/WKContext.cpp: 16 (WKContextTerminateStorageProcess): 17 18 * UIProcess/API/Cocoa/WKProcessPool.mm: 19 (-[WKProcessPool _terminateStorageProcess]): 20 21 * UIProcess/Storage/StorageProcessProxy.cpp: 22 (WebKit::StorageProcessProxy::terminateForTesting): 23 * UIProcess/Storage/StorageProcessProxy.h: 24 25 * UIProcess/WebProcessPool.cpp: 26 (WebKit::WebProcessPool::terminateStorageProcessForTesting): 27 (WebKit::WebProcessPool::terminateStorageProcess): Deleted. 28 * UIProcess/WebProcessPool.h: 29 30 * WebProcess/Storage/WebToStorageProcessConnection.cpp: 31 (WebKit::WebToStorageProcessConnection::didClose): 32 * WebProcess/Storage/WebToStorageProcessConnection.h: 33 (WebKit::WebToStorageProcessConnection::existingIDBConnectionToServerForIdentifier): 34 35 * WebProcess/WebProcess.cpp: 36 (WebKit::WebProcess::webToStorageProcessConnectionClosed): 37 1 38 2018-07-05 Simon Fraser <simon.fraser@apple.com> 2 39 -
trunk/Source/WebKit/UIProcess/API/C/WKContext.cpp
r232516 r233562 614 614 void WKContextTerminateStorageProcess(WKContextRef context) 615 615 { 616 toImpl(context)->terminateStorageProcess ();616 toImpl(context)->terminateStorageProcessForTesting(); 617 617 } 618 618 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm
r233431 r233562 426 426 - (void)_terminateStorageProcess 427 427 { 428 _processPool->terminateStorageProcess ();428 _processPool->terminateStorageProcessForTesting(); 429 429 } 430 430 -
trunk/Source/WebKit/UIProcess/Storage/StorageProcessProxy.cpp
r232886 r233562 66 66 } 67 67 68 void StorageProcessProxy::terminateForTesting() 69 { 70 for (auto& callback : m_pendingFetchWebsiteDataCallbacks.values()) 71 callback({ }); 72 73 for (auto& callback : m_pendingDeleteWebsiteDataCallbacks.values()) 74 callback(); 75 76 for (auto& callback : m_pendingDeleteWebsiteDataForOriginsCallbacks.values()) 77 callback(); 78 79 m_pendingFetchWebsiteDataCallbacks.clear(); 80 m_pendingDeleteWebsiteDataCallbacks.clear(); 81 m_pendingDeleteWebsiteDataForOriginsCallbacks.clear(); 82 83 terminate(); 84 } 85 68 86 void StorageProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& launchOptions) 69 87 { -
trunk/Source/WebKit/UIProcess/Storage/StorageProcessProxy.h
r231931 r233562 59 59 void getStorageProcessConnection(WebProcessProxy&, Messages::WebProcessProxy::GetStorageProcessConnection::DelayedReply&&); 60 60 61 void terminateForTesting(); 62 61 63 private: 62 64 StorageProcessProxy(WebProcessPool&); -
trunk/Source/WebKit/UIProcess/WebProcessPool.cpp
r233240 r233562 1603 1603 } 1604 1604 1605 void WebProcessPool::terminateStorageProcess ()1605 void WebProcessPool::terminateStorageProcessForTesting() 1606 1606 { 1607 1607 if (!m_storageProcess) 1608 1608 return; 1609 1609 1610 m_storageProcess->terminate ();1610 m_storageProcess->terminateForTesting(); 1611 1611 m_storageProcess = nullptr; 1612 1612 } -
trunk/Source/WebKit/UIProcess/WebProcessPool.h
r233240 r233562 273 273 274 274 void clearCachedCredentials(); 275 void terminateStorageProcess ();275 void terminateStorageProcessForTesting(); 276 276 void terminateNetworkProcess(); 277 277 void terminateServiceWorkerProcesses(); -
trunk/Source/WebKit/WebProcess/Storage/WebToStorageProcessConnection.cpp
r227789 r233562 102 102 void WebToStorageProcessConnection::didClose(IPC::Connection& connection) 103 103 { 104 auto protectedThis = makeRef(*this); 105 104 106 #if ENABLE(INDEXED_DATABASE) 105 107 for (auto& connection : m_webIDBConnectionsByIdentifier.values()) 106 108 connection->connectionToServerLost(); 107 108 m_webIDBConnectionsByIdentifier.clear();109 m_webIDBConnectionsBySession.clear();110 109 #endif 111 110 #if ENABLE(SERVICE_WORKER) … … 118 117 119 118 WebProcess::singleton().webToStorageProcessConnectionClosed(this); 119 120 #if ENABLE(INDEXED_DATABASE) 121 m_webIDBConnectionsByIdentifier.clear(); 122 m_webIDBConnectionsBySession.clear(); 123 #endif 120 124 } 121 125 -
trunk/Source/WebKit/WebProcess/Storage/WebToStorageProcessConnection.h
r227161 r233562 52 52 53 53 #if ENABLE(INDEXED_DATABASE) 54 WebIDBConnectionToServer* existingIDBConnectionToServerForIdentifier(uint64_t identifier) { return m_webIDBConnectionsByIdentifier.get(identifier); }; 54 55 WebIDBConnectionToServer& idbConnectionToServerForSession(PAL::SessionID); 55 56 #endif -
trunk/Source/WebKit/WebProcess/WebProcess.cpp
r233479 r233562 1180 1180 ASSERT(m_webToStorageProcessConnection == connection); 1181 1181 1182 m_webToStorageProcessConnection = nullptr; 1183 1182 #if ENABLE(INDEXED_DATABASE) 1183 for (auto& page : m_pageMap.values()) { 1184 auto idbConnection = page->corePage()->optionalIDBConnection(); 1185 if (!idbConnection) 1186 continue; 1187 1188 if (connection->existingIDBConnectionToServerForIdentifier(idbConnection->identifier())) { 1189 ASSERT(idbConnection == &connection->existingIDBConnectionToServerForIdentifier(idbConnection->identifier())->coreConnectionToServer()); 1190 page->corePage()->clearIDBConnection(); 1191 } 1192 } 1193 #endif 1184 1194 #if ENABLE(SERVICE_WORKER) 1185 1195 if (SWContextManager::singleton().connection()) { … … 1188 1198 } 1189 1199 #endif 1200 1201 m_webToStorageProcessConnection = nullptr; 1190 1202 } 1191 1203
Note: See TracChangeset
for help on using the changeset viewer.