Skip to content

Commit

Permalink
Refactor isClosed_ to is_closed and relativeContentType to relative_c…
Browse files Browse the repository at this point in the history
…ontent_type.
  • Loading branch information
bubbles231 committed Sep 18, 2016
1 parent e7ffbf8 commit dd4907c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions components/script/dom/blob.rs
Expand Up @@ -74,7 +74,7 @@ pub struct Blob {
blob_impl: DOMRefCell<BlobImpl>,
/// content-type string
type_string: String,
isClosed_: Cell<bool>,
is_closed: Cell<bool>,
}

impl Blob {
Expand All @@ -92,13 +92,13 @@ impl Blob {
// NOTE: Guarding the format correctness here,
// https://w3c.github.io/FileAPI/#dfn-type
type_string: normalize_type_string(&type_string),
isClosed_: Cell::new(false),
is_closed: Cell::new(false),
}
}

#[allow(unrooted_must_root)]
fn new_sliced(parent: &Blob, rel_pos: RelativePos,
relativeContentType: DOMString) -> Root<Blob> {
relative_content_type: DOMString) -> Root<Blob> {
let global = parent.global();
let blob_impl = match *parent.blob_impl.borrow() {
BlobImpl::File(_) => {
Expand All @@ -115,7 +115,7 @@ impl Blob {
}
};

Blob::new(global.r(), blob_impl, relativeContentType.into())
Blob::new(global.r(), blob_impl, relative_content_type.into())
}

// https://w3c.github.io/FileAPI/#constructorBlob
Expand Down Expand Up @@ -381,18 +381,18 @@ impl BlobMethods for Blob {

// https://w3c.github.io/FileAPI/#dfn-isClosed
fn IsClosed(&self) -> bool {
self.isClosed_.get()
self.is_closed.get()
}

// https://w3c.github.io/FileAPI/#dfn-close
fn Close(&self) {
// Step 1
if self.isClosed_.get() {
if self.is_closed.get() {
return;
}

// Step 2
self.isClosed_.set(true);
self.is_closed.set(true);

// Step 3
self.clean_up_file_resource();
Expand Down

0 comments on commit dd4907c

Please sign in to comment.