mirror of
https://github.com/servo/servo.git
synced 2025-07-22 14:53:49 +01:00
Remove support for Blob::{close, isClosed}
This commit is contained in:
parent
050d9d9097
commit
44e05e224c
5 changed files with 5 additions and 59 deletions
|
@ -18,7 +18,6 @@ use ipc_channel::ipc;
|
|||
use net_traits::{CoreResourceMsg, IpcSend};
|
||||
use net_traits::blob_url_store::{BlobBuf, get_blob_origin};
|
||||
use net_traits::filemanager_thread::{FileManagerThreadMsg, ReadFileProgress, RelativePos};
|
||||
use std::cell::Cell;
|
||||
use std::mem;
|
||||
use std::ops::Index;
|
||||
use std::path::PathBuf;
|
||||
|
@ -75,7 +74,6 @@ pub struct Blob {
|
|||
blob_impl: DOMRefCell<BlobImpl>,
|
||||
/// content-type string
|
||||
type_string: String,
|
||||
is_closed: Cell<bool>,
|
||||
}
|
||||
|
||||
impl Blob {
|
||||
|
@ -95,7 +93,6 @@ impl Blob {
|
|||
// NOTE: Guarding the format correctness here,
|
||||
// https://w3c.github.io/FileAPI/#dfn-type
|
||||
type_string: normalize_type_string(&type_string),
|
||||
is_closed: Cell::new(false),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -297,9 +294,7 @@ impl Blob {
|
|||
|
||||
impl Drop for Blob {
|
||||
fn drop(&mut self) {
|
||||
if !self.IsClosed() {
|
||||
self.clean_up_file_resource();
|
||||
}
|
||||
self.clean_up_file_resource();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -375,25 +370,6 @@ impl BlobMethods for Blob {
|
|||
let rel_pos = RelativePos::from_opts(start, end);
|
||||
Blob::new_sliced(self, rel_pos, content_type.unwrap_or(DOMString::from("")))
|
||||
}
|
||||
|
||||
// https://w3c.github.io/FileAPI/#dfn-isClosed
|
||||
fn IsClosed(&self) -> bool {
|
||||
self.is_closed.get()
|
||||
}
|
||||
|
||||
// https://w3c.github.io/FileAPI/#dfn-close
|
||||
fn Close(&self) {
|
||||
// Step 1
|
||||
if self.is_closed.get() {
|
||||
return;
|
||||
}
|
||||
|
||||
// Step 2
|
||||
self.is_closed.set(true);
|
||||
|
||||
// Step 3
|
||||
self.clean_up_file_resource();
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the normalized, MIME-parsable type string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue