servo/components/script
bors-servo 513811f6b4 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 -->
2016-07-18 09:50:59 -07:00
..
docs
dom Auto merge of #11727 - creativcoder:swmanager, r=jdm 2016-07-18 09:50:59 -07:00
parse script: Obtain referrer policy from header 2016-07-15 08:12:24 -07:00
task_source Implement file reading task source 2016-07-14 13:27:42 -04:00
bluetooth_blacklist.rs Add WebBluetooth Blacklist support 2016-05-31 17:05:45 +02:00
build.rs
Cargo.toml All our Cargo.toml files should contain an MPL-2.0 license field. 2016-07-14 10:26:34 -05:00
clipboard_provider.rs Remove ConstellationChan. 2016-05-19 17:13:44 +02:00
devtools.rs Switch to using the new rooted!/RootedGuard API for rooting. 2016-07-04 20:59:01 +03:00
document_loader.rs Integrate service worker manager thread 2016-07-16 23:29:44 +05:30
layout_wrapper.rs Only restyle viewport-relative nodes on viewport size change 2016-07-18 11:01:42 +08:00
lib.rs make resource_thread talk to sw-manager 2016-07-18 19:06:48 +05:30
makefile.cargo Generate a list of supported DOM APIs from parsed WebIDLs. 2016-07-15 18:13:09 -04:00
mem.rs Bump heapsize to 0.3 2016-02-13 11:13:19 +01:00
network_listener.rs Move boxing to runnable initialization 2016-07-13 11:10:23 -06:00
origin.rs Make script origins sendable and immutable. 2016-05-27 17:16:13 +02:00
script_runtime.rs Refactor util::prefs operations to be methods on static struct. 2016-07-02 16:43:39 -04:00
script_thread.rs Integrate service worker manager thread 2016-07-16 23:29:44 +05:30
serviceworker_manager.rs make resource_thread talk to sw-manager 2016-07-18 19:06:48 +05:30
textinput.rs Take selection direction into account when setting selection 2016-07-06 16:14:32 -06:00
timers.rs Auto merge of #11872 - eddyb:back-to-roots, r=Ms2ger 2016-07-04 11:03:35 -07:00
unpremultiplytable.rs
webdriver_handlers.rs Move webdriver_msg to script_traits. 2016-07-05 09:02:46 +02:00