aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/blob.rs
diff options
context:
space:
mode:
authorMichael Wu <mwu@mozilla.com>2015-04-06 19:27:56 -0400
committerMichael Wu <mwu@mozilla.com>2015-06-19 18:42:48 -0400
commit675267b7822d2d6c30c0e36fc22e0191b741b973 (patch)
tree640b22869e8a7eb7d5657df3074f0b0ccd528c29 /components/script/dom/blob.rs
parenta256f39796270cd3a5f40f33eaa4e407117b0cc6 (diff)
downloadservo-675267b7822d2d6c30c0e36fc22e0191b741b973.tar.gz
servo-675267b7822d2d6c30c0e36fc22e0191b741b973.zip
Upgrade to SM 39
Diffstat (limited to 'components/script/dom/blob.rs')
-rw-r--r--components/script/dom/blob.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/components/script/dom/blob.rs b/components/script/dom/blob.rs
index 63536fdd296..a727e3d3c74 100644
--- a/components/script/dom/blob.rs
+++ b/components/script/dom/blob.rs
@@ -4,7 +4,7 @@
use dom::bindings::codegen::InheritTypes::FileDerived;
use dom::bindings::global::{GlobalRef, GlobalField};
-use dom::bindings::js::{JSRef, Temporary};
+use dom::bindings::js::Root;
use dom::bindings::utils::{Reflector, reflect_dom_object};
use dom::bindings::error::Fallible;
use dom::bindings::codegen::Bindings::BlobBinding;
@@ -54,20 +54,20 @@ impl Blob {
}
pub fn new(global: GlobalRef, bytes: Option<Vec<u8>>,
- typeString: &str) -> Temporary<Blob> {
+ typeString: &str) -> Root<Blob> {
reflect_dom_object(box Blob::new_inherited(global, BlobTypeId::Blob, bytes, typeString),
global,
BlobBinding::Wrap)
}
// http://dev.w3.org/2006/webapi/FileAPI/#constructorBlob
- pub fn Constructor(global: GlobalRef) -> Fallible<Temporary<Blob>> {
+ pub fn Constructor(global: GlobalRef) -> Fallible<Root<Blob>> {
Ok(Blob::new(global, None, ""))
}
// http://dev.w3.org/2006/webapi/FileAPI/#constructorBlob
pub fn Constructor_(global: GlobalRef, blobParts: DOMString,
- blobPropertyBag: &BlobBinding::BlobPropertyBag) -> Fallible<Temporary<Blob>> {
+ blobPropertyBag: &BlobBinding::BlobPropertyBag) -> Fallible<Root<Blob>> {
//TODO: accept other blobParts types - ArrayBuffer or ArrayBufferView or Blob
let bytes: Option<Vec<u8>> = Some(blobParts.into_bytes());
let typeString = if is_ascii_printable(&blobPropertyBag.type_) {
@@ -79,7 +79,7 @@ impl Blob {
}
}
-impl<'a> BlobMethods for JSRef<'a, Blob> {
+impl<'a> BlobMethods for &'a Blob {
// http://dev.w3.org/2006/webapi/FileAPI/#dfn-size
fn Size(self) -> u64{
match self.bytes {
@@ -95,7 +95,7 @@ impl<'a> BlobMethods for JSRef<'a, Blob> {
// http://dev.w3.org/2006/webapi/FileAPI/#slice-method-algo
fn Slice(self, start: Option<i64>, end: Option<i64>,
- contentType: Option<DOMString>) -> Temporary<Blob> {
+ contentType: Option<DOMString>) -> Root<Blob> {
let size: i64 = self.Size().to_i64().unwrap();
let relativeStart: i64 = match start {
None => 0,