aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/websocket.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-07-05 06:24:46 -0700
committerGitHub <noreply@github.com>2016-07-05 06:24:46 -0700
commit87c77725279ba3f1b612e27fccf353c81eae17b8 (patch)
tree6c808ba9d7dd60914cf5b156906e59e0c49e6535 /components/script/dom/websocket.rs
parent9860584edf8e1ae4783d6ac4d75bda6b06da2057 (diff)
parentab14777312b6bc0e21736f907bc22364dea143d3 (diff)
downloadservo-87c77725279ba3f1b612e27fccf353c81eae17b8.tar.gz
servo-87c77725279ba3f1b612e27fccf353c81eae17b8.zip
Auto merge of #12258 - izgzhen:remove-data-slice, r=Manishearth
Remove DataSlice, fix #12249 r? @Manishearth --- <!-- 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 #12249 <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- 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/12258) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/websocket.rs')
-rw-r--r--components/script/dom/websocket.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/components/script/dom/websocket.rs b/components/script/dom/websocket.rs
index cc8c6f74d54..1a34096f26b 100644
--- a/components/script/dom/websocket.rs
+++ b/components/script/dom/websocket.rs
@@ -16,7 +16,7 @@ use dom::bindings::js::Root;
use dom::bindings::refcounted::Trusted;
use dom::bindings::reflector::{Reflectable, reflect_dom_object};
use dom::bindings::str::{DOMString, USVString, is_token};
-use dom::blob::{Blob, BlobImpl, DataSlice};
+use dom::blob::{Blob, BlobImpl};
use dom::closeevent::CloseEvent;
use dom::event::{Event, EventBubbles, EventCancelable};
use dom::eventtarget::EventTarget;
@@ -405,7 +405,7 @@ impl WebSocketMethods for WebSocket {
if send_data {
let mut other_sender = self.sender.borrow_mut();
let my_sender = other_sender.as_mut().unwrap();
- let bytes = blob.get_slice_or_empty().get_bytes().to_vec();
+ let bytes = blob.get_bytes().unwrap_or(vec![]);
let _ = my_sender.send(WebSocketDomAction::SendMessage(MessageData::Binary(bytes)));
}
@@ -591,8 +591,7 @@ impl Runnable for MessageReceivedTask {
MessageData::Binary(data) => {
match ws.binary_type.get() {
BinaryType::Blob => {
- let slice = DataSlice::from_bytes(data);
- let blob = Blob::new(global.r(), BlobImpl::new_from_slice(slice), "".to_owned());
+ let blob = Blob::new(global.r(), BlobImpl::new_from_bytes(data), "".to_owned());
blob.to_jsval(cx, message.handle_mut());
}
BinaryType::Arraybuffer => {