Integrate service worker manager thread#11727
Conversation
|
Heads up! This PR modifies the following files:
|
|
@jdm r? |
| @@ -4,75 +4,43 @@ | |||
|
|
|||
There was a problem hiding this comment.
@jdm As suggested about serviceworkerglobalscopes, not having the parent sender, the worker instance, and the parent runtime, i have removed the code, which had interactions with them. But will need advice on the run_with_memory_reporting thing when listening for events, which needs a parent_sender. I think, at the very minimum, we will need a ServiceWorker object instance, to facilitate dispatching of events to them, but how would i send a ServiceWorker object to service worker manager from the script_thread ? I am open to improving this PR. Thoughts ?
|
The build succeeded but travis gives this |
|
r? @jdm |
|
Check_no_unwrap fails if there are unwrap calls detected in constellation code. |
|
New code was committed to pull request. |
|
☔ The latest upstream changes (presumably #11745) made this pull request unmergeable. Please resolve the merge conflicts. |
f8a337c to
f794ad4
Compare
|
@jdm I removed the need for sending navigation message from constellation to script thread. You were right, it was redundant. Instead, am matching for the load_url, when the script thread has to interact with network sender, and during that match I am sending, the the |
|
Same-origin navigation do not reuse the script thread right now, unfortunately. |
|
@jdm okay, so that's the reason, why manual click registering a sw for |
|
This is why we need the actual registration data (note: orthogonal to the JS object) to be stored in the SW manager. |
c398863 to
d88d3b3
Compare
|
@jdm I made the changes. The |
|
☔ The latest upstream changes (presumably #11735) made this pull request unmergeable. Please resolve the merge conflicts. |
|
💔 Test failed - mac-rel-wpt |
|
Test logs shows this (60 tests timeout): and this ( there are more instances of this kind of Timeout) @jdm Could that be an intermittent ? Most Timeouts appear to happen when rendering images or canvas related tests. Full Log |
|
Have you run those tests locally? I suspect it's a reproducible problem. |
|
☔ The latest upstream changes (presumably #12441) made this pull request unmergeable. Please resolve the merge conflicts. |
|
I did some debugging and figured out the problem. When we're running reftests (ie. using We've got a deadlock between the layout, constellation, and HTTP loader threads in this case. The easiest way to break it is to make the HTTP loader communicate directly with the service worker manager, rather than passing through the constellation as an intermediary. |
|
@jdm Oh, great. Thanks for giving time in investigating this. Updated with the required changes, and tested the wpt-tests locally and there are no timeouts now. Let me know if the latest commit looks good to you. |
|
@bors-servo: r+ |
|
📌 Commit eff3e01 has been approved by |
|
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, windows |
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsChanges:
ServiceWorkerManager, which maintains an map of registered service workers as well as a map of active workers keyed by theirscope_url.script::init(), which makes it available as a single entity listening for requests from different script threads.serviceworkerglobalscope, which terminates the workers, after a timeout of 60 secs, thereby removing it from the active workers list.CustomResponse.This change is