RESOLVED FIXED 182301
Delay service worker process creation until actually needed by SWServer
https://bugs.webkit.org/show_bug.cgi?id=182301
Summary Delay service worker process creation until actually needed by SWServer
youenn fablet
Reported 2018-01-30 11:43:07 PST
This would allow not creating a service worker process if there is no need for it.
Attachments
Patch (8.38 KB, patch)
2018-01-30 11:45 PST, youenn fablet
no flags
Patch (14.76 KB, patch)
2018-01-31 15:30 PST, youenn fablet
no flags
Patch (14.56 KB, patch)
2018-01-31 15:44 PST, youenn fablet
no flags
Patch (11.19 KB, patch)
2018-02-01 10:26 PST, youenn fablet
no flags
Patch (14.50 KB, patch)
2018-02-01 12:11 PST, youenn fablet
no flags
Patch for landing (15.42 KB, patch)
2018-02-01 15:01 PST, youenn fablet
no flags
youenn fablet
Comment 1 2018-01-30 11:45:00 PST
youenn fablet
Comment 2 2018-01-30 11:48:16 PST
Patch tested locally and it waits to create a service worker for a page to match.
youenn fablet
Comment 3 2018-01-30 11:48:28 PST
Would need API test probably.
youenn fablet
Comment 4 2018-01-31 15:30:48 PST
EWS Watchlist
Comment 5 2018-01-31 15:33:41 PST
Attachment 332809 [details] did not pass style-queue: ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:179: Multi-line string ("...") found. This lint script doesn't do well with such strings, and may give bogus warnings. They're ugly and unnecessary, and you should use concatenation instead". [readability/multiline_string] [5] ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:193: Missing spaces around / [whitespace/operators] [3] ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:195: Place brace on its own line for function definitions. [whitespace/braces] [4] ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:198: Place brace on its own line for function definitions. [whitespace/braces] [4] ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:203: Multi-line string ("...") found. This lint script doesn't do well with such strings, and may give bogus warnings. They're ugly and unnecessary, and you should use concatenation instead". [readability/multiline_string] [5] Total errors found: 5 in 7 files If any of these errors are false positives, please file a bug against check-webkit-style.
youenn fablet
Comment 6 2018-01-31 15:44:43 PST
EWS Watchlist
Comment 7 2018-01-31 15:47:37 PST
Attachment 332813 [details] did not pass style-queue: ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:734: Multi-line string ("...") found. This lint script doesn't do well with such strings, and may give bogus warnings. They're ugly and unnecessary, and you should use concatenation instead". [readability/multiline_string] [5] ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:748: Missing spaces around / [whitespace/operators] [3] ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:750: Place brace on its own line for function definitions. [whitespace/braces] [4] ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:753: Place brace on its own line for function definitions. [whitespace/braces] [4] ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:758: Multi-line string ("...") found. This lint script doesn't do well with such strings, and may give bogus warnings. They're ugly and unnecessary, and you should use concatenation instead". [readability/multiline_string] [5] Total errors found: 5 in 7 files If any of these errors are false positives, please file a bug against check-webkit-style.
Chris Dumez
Comment 8 2018-01-31 21:27:08 PST
Comment on attachment 332813 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=332813&action=review > Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.cpp:210 > + if (!StorageProcess::singleton().globalServerToContextConnection()) We no longer need this part if we land the patch at Bug 182375 first.
youenn fablet
Comment 9 2018-02-01 10:26:08 PST
EWS Watchlist
Comment 10 2018-02-01 10:27:49 PST
Attachment 332886 [details] did not pass style-queue: ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:734: Multi-line string ("...") found. This lint script doesn't do well with such strings, and may give bogus warnings. They're ugly and unnecessary, and you should use concatenation instead". [readability/multiline_string] [5] ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:748: Missing spaces around / [whitespace/operators] [3] ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:750: Place brace on its own line for function definitions. [whitespace/braces] [4] ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:753: Place brace on its own line for function definitions. [whitespace/braces] [4] ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:758: Multi-line string ("...") found. This lint script doesn't do well with such strings, and may give bogus warnings. They're ugly and unnecessary, and you should use concatenation instead". [readability/multiline_string] [5] Total errors found: 5 in 6 files If any of these errors are false positives, please file a bug against check-webkit-style.
Chris Dumez
Comment 11 2018-02-01 11:36:57 PST
Comment on attachment 332813 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=332813&action=review > Source/WebCore/workers/service/server/SWServer.h:96 > + virtual void scheduleJobInServer(ServiceWorkerJobData&&) = 0; This seems weird. This is called due to IPC iirc. Therefore, I would expect this method to not be virtual and be on WebSWServerConnection instead. Also, it looks like you kept SWServer::Connection::scheduleJobInServer() in the cpp?
youenn fablet
Comment 12 2018-02-01 12:11:06 PST
EWS Watchlist
Comment 13 2018-02-01 12:13:55 PST
Attachment 332901 [details] did not pass style-queue: ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:734: Multi-line string ("...") found. This lint script doesn't do well with such strings, and may give bogus warnings. They're ugly and unnecessary, and you should use concatenation instead". [readability/multiline_string] [5] ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:748: Missing spaces around / [whitespace/operators] [3] ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:750: Place brace on its own line for function definitions. [whitespace/braces] [4] ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:753: Place brace on its own line for function definitions. [whitespace/braces] [4] ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:758: Multi-line string ("...") found. This lint script doesn't do well with such strings, and may give bogus warnings. They're ugly and unnecessary, and you should use concatenation instead". [readability/multiline_string] [5] Total errors found: 5 in 8 files If any of these errors are false positives, please file a bug against check-webkit-style.
Chris Dumez
Comment 14 2018-02-01 12:18:35 PST
Comment on attachment 332901 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=332901&action=review r=me with comment. > Source/WebCore/workers/service/server/SWServer.cpp:219 > +void SWServer::Connection::scheduleJob(ServiceWorkerJobData&& jobData) I do not think we need this method on SWServer::Connection. > Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.cpp:210 > + scheduleJob(WTFMove(jobData)); we can call server().scheduleJob(WTFMove(jobData)); directly, like we do in the other methods. No needs for a scheduleJob on Connection.
youenn fablet
Comment 15 2018-02-01 13:46:12 PST
(In reply to Chris Dumez from comment #14) > Comment on attachment 332901 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=332901&action=review > > r=me with comment. > > > Source/WebCore/workers/service/server/SWServer.cpp:219 > > +void SWServer::Connection::scheduleJob(ServiceWorkerJobData&& jobData) > > I do not think we need this method on SWServer::Connection. > > > Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.cpp:210 > > + scheduleJob(WTFMove(jobData)); > > we can call server().scheduleJob(WTFMove(jobData)); directly, like we do in > the other methods. No needs for a scheduleJob on Connection. Initially I did that, I kept it there as there is some logging done in SWServer. I can convert it to release logging in WebKit2 code.
Chris Dumez
Comment 16 2018-02-01 13:49:31 PST
Comment on attachment 332901 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=332901&action=review >>> Source/WebCore/workers/service/server/SWServer.cpp:219 >>> +void SWServer::Connection::scheduleJob(ServiceWorkerJobData&& jobData) >> >> I do not think we need this method on SWServer::Connection. > > Initially I did that, I kept it there as there is some logging done in SWServer. > I can convert it to release logging in WebKit2 code. Yes please.
youenn fablet
Comment 17 2018-02-01 15:01:58 PST
Created attachment 332912 [details] Patch for landing
EWS Watchlist
Comment 18 2018-02-01 15:02:59 PST
Attachment 332912 [details] did not pass style-queue: ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:734: Multi-line string ("...") found. This lint script doesn't do well with such strings, and may give bogus warnings. They're ugly and unnecessary, and you should use concatenation instead". [readability/multiline_string] [5] ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:748: Missing spaces around / [whitespace/operators] [3] ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:750: Place brace on its own line for function definitions. [whitespace/braces] [4] ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:753: Place brace on its own line for function definitions. [whitespace/braces] [4] ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:758: Multi-line string ("...") found. This lint script doesn't do well with such strings, and may give bogus warnings. They're ugly and unnecessary, and you should use concatenation instead". [readability/multiline_string] [5] Total errors found: 5 in 7 files If any of these errors are false positives, please file a bug against check-webkit-style.
WebKit Commit Bot
Comment 19 2018-02-01 16:25:17 PST
Comment on attachment 332912 [details] Patch for landing Clearing flags on attachment: 332912 Committed r227989: <https://trac.webkit.org/changeset/227989>
WebKit Commit Bot
Comment 20 2018-02-01 16:25:18 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 21 2018-02-01 16:26:30 PST
Note You need to log in before you can comment on or make changes to this bug.