mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
ImageContext.aborted does not need to be inside a Cell
This commit is contained in:
parent
9d5499bbfb
commit
1033d6bc07
1 changed files with 4 additions and 4 deletions
|
@ -167,7 +167,7 @@ struct ImageContext {
|
||||||
/// The cache ID for this request.
|
/// The cache ID for this request.
|
||||||
id: PendingImageId,
|
id: PendingImageId,
|
||||||
/// Used to mark abort
|
/// Used to mark abort
|
||||||
aborted: Cell<bool>,
|
aborted: bool,
|
||||||
/// The document associated with this request
|
/// The document associated with this request
|
||||||
doc: Trusted<Document>,
|
doc: Trusted<Document>,
|
||||||
/// timing data for this resource
|
/// timing data for this resource
|
||||||
|
@ -193,7 +193,7 @@ impl FetchResponseListener for ImageContext {
|
||||||
if let Some(ref content_type) = metadata.content_type {
|
if let Some(ref content_type) = metadata.content_type {
|
||||||
let mime: Mime = content_type.clone().into_inner().into();
|
let mime: Mime = content_type.clone().into_inner().into();
|
||||||
if mime.type_() == mime::MULTIPART && mime.subtype().as_str() == "x-mixed-replace" {
|
if mime.type_() == mime::MULTIPART && mime.subtype().as_str() == "x-mixed-replace" {
|
||||||
self.aborted.set(true);
|
self.aborted = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -255,7 +255,7 @@ impl ResourceTimingListener for ImageContext {
|
||||||
|
|
||||||
impl PreInvoke for ImageContext {
|
impl PreInvoke for ImageContext {
|
||||||
fn should_invoke(&self) -> bool {
|
fn should_invoke(&self) -> bool {
|
||||||
!self.aborted.get()
|
!self.aborted
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -301,7 +301,7 @@ impl HTMLImageElement {
|
||||||
image_cache: window.image_cache(),
|
image_cache: window.image_cache(),
|
||||||
status: Ok(()),
|
status: Ok(()),
|
||||||
id: id,
|
id: id,
|
||||||
aborted: Cell::new(false),
|
aborted: false,
|
||||||
doc: Trusted::new(&document),
|
doc: Trusted::new(&document),
|
||||||
resource_timing: ResourceFetchTiming::new(ResourceTimingType::Resource),
|
resource_timing: ResourceFetchTiming::new(ResourceTimingType::Resource),
|
||||||
url: img_url.clone(),
|
url: img_url.clone(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue