Modern IDB: After closing a Netflix video, trying to watch it again fails 1 - Save off the exact URL for a specific Netflix video as a bookmark. 2 - Be watching that video. 3 - Close that Safari window, but do *not* quit Safari. This kills the WebProcess that was playing the video 4 - In a different window, open that bookmark to try to resume watching the video In normal cases, the IDB client side cleans up all transactions/requests/etc when the window closes or page navigates. But if the WebProcess is killed, then that client side cleanup doesn't happen. Instead, we need to rely on server-side cleanup in response to the connection closing. And the server doesn't abort in-progress transactions. So when you visit a new netflix page, there's an in-progress transaction, so the new connection's transaction can never start.
<rdar://problem/25092473>
Created attachment 279978 [details] Patch
Attachment 279978 [details] did not pass style-queue: ERROR: Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebProcessKillIDBCleanup.mm:31: Alphabetical sorting problem. [build/include_order] [4] Total errors found: 1 in 8 files If any of these errors are false positives, please file a bug against check-webkit-style.
http://trac.webkit.org/changeset/201461
Comment on attachment 279978 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=279978&action=review > Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp:1244 > + Deque<RefPtr<UniqueIDBDatabaseTransaction>> transactionsToAbort; I think there is a chance this can use Ref instead of RefPtr. > Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebProcessKillIDBCleanup-1.html:3 > +var request = window.indexedDB.deleteDatabase("WebProcessKillIDBCleanup"); No need for "window." here. > Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebProcessKillIDBCleanup-1.html:18 > + var request = window.indexedDB.open("WebProcessKillIDBCleanup"); Ditto. > Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebProcessKillIDBCleanup-1.html:22 > + window.webkit.messageHandlers.testHandler.postMessage('Open success'); Ditto. > Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebProcessKillIDBCleanup-1.html:29 > + window.webkit.messageHandlers.testHandler.postMessage('Unexpected error opening database'); Ditto. > Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebProcessKillIDBCleanup-1.html:34 > + window.webkit.messageHandlers.testHandler.postMessage('UpgradeNeeded'); Ditto. > Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebProcessKillIDBCleanup-1.html:40 > + window.webkit.messageHandlers.testHandler.postMessage('Transaction complete'); Ditto. > Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebProcessKillIDBCleanup-1.html:44 > + window.webkit.messageHandlers.testHandler.postMessage('Transaction errored!'); Ditto. > Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebProcessKillIDBCleanup-1.html:60 > + window.webkit.messageHandlers.testHandler.postMessage('Infinite Transaction Started'); Ditto. > Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebProcessKillIDBCleanup-2.html:7 > + window.webkit.messageHandlers.testHandler.postMessage('Second open success'); Ditto. > Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebProcessKillIDBCleanup-2.html:17 > + window.webkit.messageHandlers.testHandler.postMessage('Unexpected error opening database'); Ditto. > Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebProcessKillIDBCleanup-2.html:23 > + window.webkit.messageHandlers.testHandler.postMessage('Unexpected UpgradeNeeded opening database'); Ditto. > Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebProcessKillIDBCleanup.mm:60 > + RetainPtr<IndexedDBWebProcessKillMessageHandler> handler = adoptNS([[IndexedDBWebProcessKillMessageHandler alloc] init]); > + RetainPtr<WKWebViewConfiguration> configuration = adoptNS([[WKWebViewConfiguration alloc] init]); Better to use auto. > Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebProcessKillIDBCleanup.mm:93 > + RetainPtr<WKWebView> webView2 = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]); auto