aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/serviceworkercontainer.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-07-18 09:50:59 -0700
committerGitHub <noreply@github.com>2016-07-18 09:50:59 -0700
commit513811f6b40d522bc425c2588320b889614f2973 (patch)
treee5903d6006fbc90d9e4093b37cb3b2491e44f830 /components/script/dom/serviceworkercontainer.rs
parentb36a3b2fee3e70c11af2bc24832e65510acb71ec (diff)
parenteff3e01df0581e9ee3dc827dd13e86202b66752a (diff)
downloadservo-513811f6b40d522bc425c2588320b889614f2973.tar.gz
servo-513811f6b40d522bc425c2588320b889614f2973.zip
Auto merge of #11727 - creativcoder:swmanager, r=jdm
Integrate service worker manager thread <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes are part of #11091 <!-- Either: --> - [X] There are tests for these changes at my [gh-pages](https://github.com/creativcoder/gsoc16/tree/gh-pages) branch to test the instantiation of service workers by their manager, but will need to discuss how that would integrate into master. Changes: - Introduces a `ServiceWorkerManager`, which maintains an map of registered service workers as well as a map of active workers keyed by their `scope_url`. - Adds the initialization of ServiceWorkerManager, at the `script::init()`, which makes it available as a single entity listening for requests from different script threads. - Adds a timeout thread in `serviceworkerglobalscope`, which terminates the workers, after a timeout of 60 secs, thereby removing it from the active workers list. - Adds the matching of scope urls, in longest prefix way rather than path structural way, according to [spec](https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#scope-match-algorithm). - Make ServiceWorkerManager, the holder of network sender, instead of script thread, so it can send `CustomResponse`. <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11727) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/serviceworkercontainer.rs')
-rw-r--r--components/script/dom/serviceworkercontainer.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/components/script/dom/serviceworkercontainer.rs b/components/script/dom/serviceworkercontainer.rs
index 744daba7b91..17fea7100be 100644
--- a/components/script/dom/serviceworkercontainer.rs
+++ b/components/script/dom/serviceworkercontainer.rs
@@ -98,7 +98,7 @@ impl ServiceWorkerContainerMethods for ServiceWorkerContainer {
script_url,
scope_str.clone(),
self);
- ScriptThread::set_registration(scope, &*worker_registration);
+ ScriptThread::set_registration(scope, &*worker_registration, self.global().r().pipeline());
Ok(worker_registration)
}
}