diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-09-15 08:34:22 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-15 08:34:22 -0500 |
commit | 0ec4ea4ee188f2e5db9d387d182c34a9d97d07cd (patch) | |
tree | 738a39d85d1ce67f5ab9d7b4a04a60cc2bf41287 /components/script/dom/serviceworkercontainer.rs | |
parent | b3db4b4c0dfc41ffbf566da15bd85ebdb7b1ea1f (diff) | |
parent | 314dedb96fdea9d7656a3be166aec7749d2b85da (diff) | |
download | servo-0ec4ea4ee188f2e5db9d387d182c34a9d97d07cd.tar.gz servo-0ec4ea4ee188f2e5db9d387d182c34a9d97d07cd.zip |
Auto merge of #12910 - creativcoder:swsender, r=jdm
Implement postMessage for ServiceWorkers
<!-- Please describe your changes on the following line: -->
Fixes #12773
r? @jdm
Changes:
* Implements `postMessage` on `ServiceWorker` object.
* Removes unused channels from sw and their scopes.
* Fixes a crash when calling `scope.script_chan()` in sw-scopes event handling.
---
<!-- 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 fix #12773
<!-- Either: -->
- [X] There are tests for these changes at `tests/html/service-worker`
<!-- 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="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12910)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/serviceworkercontainer.rs')
-rw-r--r-- | components/script/dom/serviceworkercontainer.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/components/script/dom/serviceworkercontainer.rs b/components/script/dom/serviceworkercontainer.rs index d6379c30183..73e19690e2e 100644 --- a/components/script/dom/serviceworkercontainer.rs +++ b/components/script/dom/serviceworkercontainer.rs @@ -95,10 +95,9 @@ impl ServiceWorkerContainerMethods for ServiceWorkerContainer { return Err(Error::Type("Scope URL contains forbidden characters".to_owned())); } - let scope_str = scope.as_str().to_owned(); let worker_registration = ServiceWorkerRegistration::new(self.global().r(), script_url, - scope_str.clone(), + scope.clone(), self); ScriptThread::set_registration(scope, &*worker_registration, self.global().r().pipeline_id()); Ok(worker_registration) |