mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Refactor isClosed_ to is_closed and relativeContentType to relative_content_type.
This commit is contained in:
parent
e7ffbf819a
commit
dd4907c985
1 changed files with 7 additions and 7 deletions
|
@ -74,7 +74,7 @@ pub struct Blob {
|
||||||
blob_impl: DOMRefCell<BlobImpl>,
|
blob_impl: DOMRefCell<BlobImpl>,
|
||||||
/// content-type string
|
/// content-type string
|
||||||
type_string: String,
|
type_string: String,
|
||||||
isClosed_: Cell<bool>,
|
is_closed: Cell<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Blob {
|
impl Blob {
|
||||||
|
@ -92,13 +92,13 @@ impl Blob {
|
||||||
// NOTE: Guarding the format correctness here,
|
// NOTE: Guarding the format correctness here,
|
||||||
// https://w3c.github.io/FileAPI/#dfn-type
|
// https://w3c.github.io/FileAPI/#dfn-type
|
||||||
type_string: normalize_type_string(&type_string),
|
type_string: normalize_type_string(&type_string),
|
||||||
isClosed_: Cell::new(false),
|
is_closed: Cell::new(false),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
#[allow(unrooted_must_root)]
|
||||||
fn new_sliced(parent: &Blob, rel_pos: RelativePos,
|
fn new_sliced(parent: &Blob, rel_pos: RelativePos,
|
||||||
relativeContentType: DOMString) -> Root<Blob> {
|
relative_content_type: DOMString) -> Root<Blob> {
|
||||||
let global = parent.global();
|
let global = parent.global();
|
||||||
let blob_impl = match *parent.blob_impl.borrow() {
|
let blob_impl = match *parent.blob_impl.borrow() {
|
||||||
BlobImpl::File(_) => {
|
BlobImpl::File(_) => {
|
||||||
|
@ -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
|
// https://w3c.github.io/FileAPI/#constructorBlob
|
||||||
|
@ -381,18 +381,18 @@ impl BlobMethods for Blob {
|
||||||
|
|
||||||
// https://w3c.github.io/FileAPI/#dfn-isClosed
|
// https://w3c.github.io/FileAPI/#dfn-isClosed
|
||||||
fn IsClosed(&self) -> bool {
|
fn IsClosed(&self) -> bool {
|
||||||
self.isClosed_.get()
|
self.is_closed.get()
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://w3c.github.io/FileAPI/#dfn-close
|
// https://w3c.github.io/FileAPI/#dfn-close
|
||||||
fn Close(&self) {
|
fn Close(&self) {
|
||||||
// Step 1
|
// Step 1
|
||||||
if self.isClosed_.get() {
|
if self.is_closed.get() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Step 2
|
// Step 2
|
||||||
self.isClosed_.set(true);
|
self.is_closed.set(true);
|
||||||
|
|
||||||
// Step 3
|
// Step 3
|
||||||
self.clean_up_file_resource();
|
self.clean_up_file_resource();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue