RESOLVED FIXED 180488
Start writing ServiceWorker registrations to disk
https://bugs.webkit.org/show_bug.cgi?id=180488
Summary Start writing ServiceWorker registrations to disk
Brady Eidson
Reported 2017-12-06 10:58:47 PST
Start writing ServiceWorker registrations to disk
Attachments
Patch (37.70 KB, patch)
2017-12-06 11:01 PST, Brady Eidson
no flags
Archive of layout-test-results from ews122 for ios-simulator-wk2 (2.22 MB, application/zip)
2017-12-06 12:48 PST, EWS Watchlist
no flags
Patch (37.59 KB, patch)
2017-12-06 12:53 PST, Brady Eidson
no flags
Brady Eidson
Comment 1 2017-12-06 11:01:44 PST
Chris Dumez
Comment 2 2017-12-06 11:20:11 PST
Comment on attachment 328595 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=328595&action=review r=me > Source/WebCore/workers/service/server/RegistrationDatabase.cpp:89 > + std::unique_ptr<String> errorMessage; Wh a pointer? string::isNull() not enough? > Source/WebCore/workers/service/server/RegistrationDatabase.cpp:154 > +static String updateViaCacheToString(ServiceWorkerUpdateViaCache update) Why are we storing them as Strings? > Source/WebCore/workers/service/server/RegistrationDatabase.cpp:168 > +static String workerTypeToString(WorkerType workerType) Why are we storing them as Strings? > Source/WebCore/workers/service/server/RegistrationDatabase.h:39 > +class RegistrationDatabase : public CrossThreadTaskHandler { FAST_MALLOC? > Source/WebCore/workers/service/server/RegistrationStore.h:42 > +class RegistrationStore { FAST_MALLOC? > Source/WebCore/workers/service/server/RegistrationStore.h:44 > + RegistrationStore(const String& databaseDirectory); explicit?
Brady Eidson
Comment 3 2017-12-06 11:44:38 PST
(In reply to Chris Dumez from comment #2) > Comment on attachment 328595 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=328595&action=review > > r=me > > > Source/WebCore/workers/service/server/RegistrationDatabase.cpp:89 > > + std::unique_ptr<String> errorMessage; > > Wh a pointer? string::isNull() not enough? Yah, I overthought this. > > > Source/WebCore/workers/service/server/RegistrationDatabase.cpp:154 > > +static String updateViaCacheToString(ServiceWorkerUpdateViaCache update) > > Why are we storing them as Strings? > > > Source/WebCore/workers/service/server/RegistrationDatabase.cpp:168 > > +static String workerTypeToString(WorkerType workerType) > > Why are we storing them as Strings? We've learned in the past - Storing enum-like things in databases is fragile, as changes to their numeric values in code happens without consideration to their persistency on disk. We could *manually* convert enums to integers, and convert them back, for example - but that still suffers from similar fragility. > > > Source/WebCore/workers/service/server/RegistrationDatabase.h:39 > > +class RegistrationDatabase : public CrossThreadTaskHandler { > > FAST_MALLOC? > > > Source/WebCore/workers/service/server/RegistrationStore.h:42 > > +class RegistrationStore { > > FAST_MALLOC? Sure. > > > Source/WebCore/workers/service/server/RegistrationStore.h:44 > > + RegistrationStore(const String& databaseDirectory); > > explicit? Sure.
EWS Watchlist
Comment 4 2017-12-06 12:48:36 PST
Comment on attachment 328595 [details] Patch Attachment 328595 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: http://webkit-queues.webkit.org/results/5518240 New failing tests: loader/go-back-cached-main-resource.html
EWS Watchlist
Comment 5 2017-12-06 12:48:37 PST
Created attachment 328610 [details] Archive of layout-test-results from ews122 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews122 Port: ios-simulator-wk2 Platform: Mac OS X 10.12.6
Brady Eidson
Comment 6 2017-12-06 12:53:55 PST
WebKit Commit Bot
Comment 7 2017-12-06 16:41:18 PST
Comment on attachment 328611 [details] Patch Clearing flags on attachment: 328611 Committed r225610: <https://trac.webkit.org/changeset/225610>
WebKit Commit Bot
Comment 8 2017-12-06 16:41:20 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 9 2017-12-06 16:43:18 PST
Saam Barati
Comment 10 2017-12-06 22:39:43 PST
Comment on attachment 328611 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=328611&action=review > Source/WebCore/workers/service/server/RegistrationDatabase.cpp:90 > + auto scopeExit = makeScopeExit([&, errorMessage = &errorMessage] { Why do you do errorMessage = &errorMessage here if you're already capturing by reference? > Source/WebCore/workers/service/server/RegistrationDatabase.cpp:91 > + ASSERT(!errorMessage->isNull()); This causes a build failure for me when building on iOS. I'm going to commit to make this ASSERT_UNUSED.
Saam Barati
Comment 11 2017-12-06 22:44:44 PST
Comment on attachment 328611 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=328611&action=review > Source/WebCore/workers/service/server/RegistrationDatabase.cpp:99 > + errorMessage = "Failed to open registration database"; nit: I believe this is more efficient if it were ASCIILiteral
Saam Barati
Comment 12 2017-12-06 22:47:52 PST
Comment on attachment 328611 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=328611&action=review >> Source/WebCore/workers/service/server/RegistrationDatabase.cpp:91 >> + ASSERT(!errorMessage->isNull()); > > This causes a build failure for me when building on iOS. I'm going to commit to make this ASSERT_UNUSED. Landed in: https://trac.webkit.org/changeset/225621/webkit
Note You need to log in before you can comment on or make changes to this bug.