RESOLVED FIXED196623
Close service worker database on network process suspension
https://bugs.webkit.org/show_bug.cgi?id=196623
Summary Close service worker database on network process suspension
youenn fablet
Reported 2019-04-04 13:36:51 PDT
Close service worker database on network process suspension
Attachments
Patch (7.30 KB, patch)
2019-04-04 13:42 PDT, youenn fablet
no flags
Patch (9.70 KB, patch)
2019-04-04 14:39 PDT, youenn fablet
no flags
Patch (18.58 KB, patch)
2019-04-05 10:54 PDT, youenn fablet
no flags
Patch (19.58 KB, patch)
2019-04-05 14:53 PDT, youenn fablet
no flags
Patch for landing (19.91 KB, patch)
2019-04-09 15:59 PDT, youenn fablet
no flags
youenn fablet
Comment 1 2019-04-04 13:37:15 PDT
youenn fablet
Comment 2 2019-04-04 13:42:30 PDT
youenn fablet
Comment 3 2019-04-04 14:39:53 PDT
youenn fablet
Comment 4 2019-04-05 10:54:40 PDT
youenn fablet
Comment 5 2019-04-05 14:53:51 PDT
youenn fablet
Comment 6 2019-04-09 10:35:06 PDT
Ping review?
Alex Christensen
Comment 7 2019-04-09 11:30:08 PDT
Comment on attachment 366846 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=366846&action=review > Source/WebCore/workers/service/server/RegistrationDatabase.cpp:288 > + postTaskToWorkQueue([this, completionHandler = WTFMove(completionHandler)]() mutable { It might be useful to have an ASSERT(isMainThread()) before this. Also, what guarantees "this" is still alive when it is used? Please use a RefPtr or a WeakPtr to avoid UAF. > Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:1793 > + EXPECT_TRUE([[NSFileManager defaultManager] fileExistsAtPath:swDBPath.path]); Should we remove this file to clean up so it doesn't affect future tests?
youenn fablet
Comment 8 2019-04-09 13:08:54 PDT
Thanks for the review. (In reply to Alex Christensen from comment #7) > Comment on attachment 366846 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=366846&action=review > > > Source/WebCore/workers/service/server/RegistrationDatabase.cpp:288 > > + postTaskToWorkQueue([this, completionHandler = WTFMove(completionHandler)]() mutable { > > It might be useful to have an ASSERT(isMainThread()) before this. Let's add one in postTaskToWorkQueue. > Also, what guarantees "this" is still alive when it is used? Please use a > RefPtr or a WeakPtr to avoid UAF. postTaskToWorkQueue is refing "this" for us. > > > Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:1793 > > + EXPECT_TRUE([[NSFileManager defaultManager] fileExistsAtPath:swDBPath.path]); > > Should we remove this file to clean up so it doesn't affect future tests? I followed the existing file test pattern which is to clean the data store before each test.
youenn fablet
Comment 9 2019-04-09 15:59:32 PDT
Created attachment 367075 [details] Patch for landing
WebKit Commit Bot
Comment 10 2019-04-09 16:37:23 PDT
Comment on attachment 367075 [details] Patch for landing Clearing flags on attachment: 367075 Committed r244097: <https://trac.webkit.org/changeset/244097>
WebKit Commit Bot
Comment 11 2019-04-09 16:37:25 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.