aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/worker.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-06-17 07:26:16 -0500
committerGitHub <noreply@github.com>2016-06-17 07:26:16 -0500
commit0c9d0eb68575f20a8239bac8204f8e25de0f61d2 (patch)
tree85d97c6aea8332ac541912a616d824ed5e9f6976 /components/script/dom/worker.rs
parentfb9f3273426020691f658f08e4f4b754cc40dcd6 (diff)
parent4d3379392d3d79c78fa68b0831d3f94d9da949c5 (diff)
downloadservo-0c9d0eb68575f20a8239bac8204f8e25de0f61d2.tar.gz
servo-0c9d0eb68575f20a8239bac8204f8e25de0f61d2.zip
Auto merge of #11716 - izgzhen:impl-blob-url-dom, r=Manishearth
Implement Blob URL's DOM interfaces r? @Manishearth Implement the two functions in `URL` to create/revoke Blob URLs, and related code to approximate our proposed design to make things work together. <!-- 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 fix part of #10539, related to #11131 <!-- Either: --> - [x] There are tests for these changes OR <!-- 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/11716) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/worker.rs')
-rw-r--r--components/script/dom/worker.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/components/script/dom/worker.rs b/components/script/dom/worker.rs
index 5762e2aa63f..a136f4ec8ca 100644
--- a/components/script/dom/worker.rs
+++ b/components/script/dom/worker.rs
@@ -147,7 +147,10 @@ impl WorkerMethods for Worker {
fn PostMessage(&self, cx: *mut JSContext, message: HandleValue) -> ErrorResult {
let data = try!(StructuredCloneData::write(cx, message));
let address = Trusted::new(self);
- self.sender.send((address, WorkerScriptMsg::DOMMessage(data))).unwrap();
+
+ // NOTE: step 9 of https://html.spec.whatwg.org/multipage/#dom-messageport-postmessage
+ // indicates that a nonexistent communication channel should result in a silent error.
+ let _ = self.sender.send((address, WorkerScriptMsg::DOMMessage(data)));
Ok(())
}