aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/blob.rs
diff options
context:
space:
mode:
authorChad Kimes <ckimes89@gmail.com>2016-01-10 21:19:07 -0500
committerChad Kimes <ckimes89@gmail.com>2016-01-10 21:20:31 -0500
commit5e3bbdcafb9d4c36d3fe2688f516859dc87ec5c0 (patch)
tree82e12e9ea396b5fff05fbad186591c10472acbbe /components/script/dom/blob.rs
parent4d8d6bf7ff286a0257a3f42ea514f305670b6c15 (diff)
downloadservo-5e3bbdcafb9d4c36d3fe2688f516859dc87ec5c0.tar.gz
servo-5e3bbdcafb9d4c36d3fe2688f516859dc87ec5c0.zip
Remove global field from Blob
Diffstat (limited to 'components/script/dom/blob.rs')
-rw-r--r--components/script/dom/blob.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/components/script/dom/blob.rs b/components/script/dom/blob.rs
index 88202081bf3..6c1f3ddd436 100644
--- a/components/script/dom/blob.rs
+++ b/components/script/dom/blob.rs
@@ -5,7 +5,7 @@
use dom::bindings::codegen::Bindings::BlobBinding;
use dom::bindings::codegen::Bindings::BlobBinding::BlobMethods;
use dom::bindings::error::Fallible;
-use dom::bindings::global::{GlobalField, GlobalRef};
+use dom::bindings::global::{GlobalRef, global_root_from_reflector};
use dom::bindings::js::Root;
use dom::bindings::reflector::{Reflector, reflect_dom_object};
use dom::bindings::trace::JSTraceable;
@@ -76,7 +76,6 @@ pub struct Blob {
#[ignore_heap_size_of = "No clear owner"]
data: DataSlice,
typeString: String,
- global: GlobalField,
isClosed_: Cell<bool>,
}
@@ -87,8 +86,7 @@ fn is_ascii_printable(string: &str) -> bool {
}
impl Blob {
- pub fn new_inherited(global: GlobalRef,
- bytes: Arc<Vec<u8>>,
+ pub fn new_inherited(bytes: Arc<Vec<u8>>,
bytes_start: Option<i64>,
bytes_end: Option<i64>,
typeString: &str) -> Blob {
@@ -96,13 +94,12 @@ impl Blob {
reflector_: Reflector::new(),
data: DataSlice::new(bytes, bytes_start, bytes_end),
typeString: typeString.to_owned(),
- global: GlobalField::from_rooted(&global),
isClosed_: Cell::new(false),
}
}
pub fn new(global: GlobalRef, bytes: Vec<u8>, typeString: &str) -> Root<Blob> {
- let boxed_blob = box Blob::new_inherited(global, Arc::new(bytes), None, None, typeString);
+ let boxed_blob = box Blob::new_inherited(Arc::new(bytes), None, None, typeString);
reflect_dom_object(boxed_blob, global, BlobBinding::Wrap)
}
@@ -112,7 +109,7 @@ impl Blob {
bytes_end: Option<i64>,
typeString: &str) -> Root<Blob> {
- let boxed_blob = box Blob::new_inherited(global, bytes, bytes_start, bytes_end, typeString);
+ let boxed_blob = box Blob::new_inherited(bytes, bytes_start, bytes_end, typeString);
reflect_dom_object(boxed_blob, global, BlobBinding::Wrap)
}
@@ -171,7 +168,7 @@ impl BlobMethods for Blob {
}
}
};
- let global = self.global.root();
+ let global = global_root_from_reflector(self);
let bytes = self.data.bytes.clone();
Blob::new_sliced(global.r(), bytes, start, end, &relativeContentType)
}