Bug 190324 - NetworkCache::Storage should be WTF::DestructionThread::Main
Summary: NetworkCache::Storage should be WTF::DestructionThread::Main
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Service Workers (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-10-05 16:15 PDT by youenn fablet
Modified: 2018-10-08 13:23 PDT (History)
9 users (show)

See Also:


Attachments
Patch (6.40 KB, patch)
2018-10-05 16:22 PDT, youenn fablet
ews-watchlist: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews105 for mac-sierra-wk2 (3.68 MB, application/zip)
2018-10-05 17:48 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews201 for win-future (12.70 MB, application/zip)
2018-10-05 18:54 PDT, EWS Watchlist
no flags Details
Patch (8.43 KB, patch)
2018-10-05 21:01 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (8.43 KB, patch)
2018-10-05 21:03 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (8.43 KB, patch)
2018-10-05 21:04 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews107 for mac-sierra-wk2 (3.30 MB, application/zip)
2018-10-05 22:13 PDT, EWS Watchlist
no flags Details
Patch (8.64 KB, patch)
2018-10-06 07:56 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2018-10-05 16:15:40 PDT
This will simplify the code and make it more robust.
Comment 1 youenn fablet 2018-10-05 16:22:55 PDT
Created attachment 351705 [details]
Patch
Comment 2 EWS Watchlist 2018-10-05 17:47:58 PDT
Comment on attachment 351705 [details]
Patch

Attachment 351705 [details] did not pass mac-wk2-ews (mac-wk2):
Output: https://webkit-queues.webkit.org/results/9467282

New failing tests:
imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-add.https.html
imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-add.https.html
imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-delete.https.html
imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-put.https.html
imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-put.https.html
imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-match.https.html
imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-cache.https.html
imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-matchAll.https.html
imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-keys.https.html
imported/w3c/web-platform-tests/service-workers/service-worker/redirected-response.https.html
imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-storage.https.html
imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-match.https.html
imported/w3c/web-platform-tests/service-workers/service-worker/interfaces-sw.https.html
imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-matchAll.https.html
imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-keys.https.html
Comment 3 EWS Watchlist 2018-10-05 17:48:00 PDT
Created attachment 351707 [details]
Archive of layout-test-results from ews105 for mac-sierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews105  Port: mac-sierra-wk2  Platform: Mac OS X 10.12.6
Comment 4 EWS Watchlist 2018-10-05 18:54:46 PDT
Comment on attachment 351705 [details]
Patch

Attachment 351705 [details] did not pass win-ews (win):
Output: https://webkit-queues.webkit.org/results/9467586

New failing tests:
http/tests/misc/resource-timing-resolution.html
Comment 5 EWS Watchlist 2018-10-05 18:54:58 PDT
Created attachment 351709 [details]
Archive of layout-test-results from ews201 for win-future

The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: ews201  Port: win-future  Platform: CYGWIN_NT-6.1-2.10.0-0.325-5-3-x86_64-64bit
Comment 6 youenn fablet 2018-10-05 21:01:33 PDT
Created attachment 351714 [details]
Patch
Comment 7 youenn fablet 2018-10-05 21:03:49 PDT
Created attachment 351715 [details]
Patch
Comment 8 youenn fablet 2018-10-05 21:04:41 PDT
Created attachment 351716 [details]
Patch
Comment 9 EWS Watchlist 2018-10-05 22:13:30 PDT
Comment on attachment 351716 [details]
Patch

Attachment 351716 [details] did not pass mac-wk2-ews (mac-wk2):
Output: https://webkit-queues.webkit.org/results/9468829

New failing tests:
css3/filters/backdrop/add-remove-add-backdrop-filter.html
Comment 10 EWS Watchlist 2018-10-05 22:13:32 PDT
Created attachment 351717 [details]
Archive of layout-test-results from ews107 for mac-sierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews107  Port: mac-sierra-wk2  Platform: Mac OS X 10.12.6
Comment 11 Michael Catanzaro 2018-10-06 02:38:38 PDT
Comment on attachment 351716 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=351716&action=review

> Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.cpp:-242
>  Storage::~Storage()
>  {
> -    ASSERT(RunLoop::isMain());

Um... why are you removing the assertion that checks that it is destroyed on the main thread?
Comment 12 youenn fablet 2018-10-06 07:26:12 PDT
(In reply to Michael Catanzaro from comment #11)
> Comment on attachment 351716 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=351716&action=review
> 
> > Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.cpp:-242
> >  Storage::~Storage()
> >  {
> > -    ASSERT(RunLoop::isMain());
> 
> Um... why are you removing the assertion that checks that it is destroyed on
> the main thread?

This is guaranteed by ThreadSafeRefCounted<DestructionThread::Main>.
I can keep it if that helps.
If useful here, it might be best to add such assertion in ThreadSafeRefCounted destructor instead of here.
Comment 13 youenn fablet 2018-10-06 07:56:03 PDT
Created attachment 351724 [details]
Patch
Comment 14 Michael Catanzaro 2018-10-07 12:08:48 PDT
(In reply to youenn fablet from comment #12)
> This is guaranteed by ThreadSafeRefCounted<DestructionThread::Main>.
> I can keep it if that helps.

Up to you, but I think I would keep it. Of course every assertion in the codebase should be guaranteed to never fail already... we have them because we know sometimes things go wrong.

> If useful here, it might be best to add such assertion in
> ThreadSafeRefCounted destructor instead of here.

Sounds good.
Comment 15 Antti Koivisto 2018-10-08 01:18:58 PDT
> If useful here, it might be best to add such assertion in
> ThreadSafeRefCounted destructor instead of here.

I don't think ThreadSafeRefCounted implies that the object needs to be destroyed in the main thread.
Comment 16 youenn fablet 2018-10-08 08:40:26 PDT
(In reply to Antti Koivisto from comment #15)
> > If useful here, it might be best to add such assertion in
> > ThreadSafeRefCounted destructor instead of here.
> 
> I don't think ThreadSafeRefCounted implies that the object needs to be
> destroyed in the main thread.

ThreadSafeRefCounted does not.
ThreadSafeRefCounted<WTF::DestructionThread::Main> does.
I kept the assert for now though.
Comment 17 WebKit Commit Bot 2018-10-08 13:22:07 PDT
Comment on attachment 351724 [details]
Patch

Clearing flags on attachment: 351724

Committed r236936: <https://trac.webkit.org/changeset/236936>
Comment 18 WebKit Commit Bot 2018-10-08 13:22:09 PDT
All reviewed patches have been landed.  Closing bug.
Comment 19 Radar WebKit Bug Importer 2018-10-08 13:23:32 PDT
<rdar://problem/45102139>