diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-07-18 09:50:59 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-18 09:50:59 -0700 |
commit | 513811f6b40d522bc425c2588320b889614f2973 (patch) | |
tree | e5903d6006fbc90d9e4093b37cb3b2491e44f830 /components/script/dom/xmlhttprequest.rs | |
parent | b36a3b2fee3e70c11af2bc24832e65510acb71ec (diff) | |
parent | eff3e01df0581e9ee3dc827dd13e86202b66752a (diff) | |
download | servo-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/xmlhttprequest.rs')
-rw-r--r-- | components/script/dom/xmlhttprequest.rs | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/components/script/dom/xmlhttprequest.rs b/components/script/dom/xmlhttprequest.rs index ed254f8c007..9ac02936673 100644 --- a/components/script/dom/xmlhttprequest.rs +++ b/components/script/dom/xmlhttprequest.rs @@ -47,7 +47,7 @@ use net_traits::CoreResourceMsg::Fetch; use net_traits::request::{CredentialsMode, Destination, RequestInit, RequestMode}; use net_traits::trim_http_whitespace; use net_traits::{CoreResourceThread, LoadOrigin}; -use net_traits::{FetchResponseListener, Metadata, NetworkError, RequestSource}; +use net_traits::{FetchResponseListener, Metadata, NetworkError}; use network_listener::{NetworkListener, PreInvoke}; use parse::html::{ParseContext, parse_html}; use parse::xml::{self, parse_xml}; @@ -274,13 +274,6 @@ impl LoadOrigin for XMLHttpRequest { fn referrer_policy(&self) -> Option<ReferrerPolicy> { return self.referrer_policy; } - fn request_source(&self) -> RequestSource { - if self.sync.get() { - RequestSource::None - } else { - self.global().r().request_source() - } - } fn pipeline_id(&self) -> Option<PipelineId> { let global = self.global(); Some(global.r().pipeline()) |