Skip to content

Commit

Permalink
ImageContext.aborted does not need to be inside a Cell
Browse files Browse the repository at this point in the history
  • Loading branch information
ferjm committed Jan 11, 2019
1 parent 9d5499b commit 1033d6b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions components/script/dom/htmlimageelement.rs
Expand Up @@ -167,7 +167,7 @@ struct ImageContext {
/// The cache ID for this request.
id: PendingImageId,
/// Used to mark abort
aborted: Cell<bool>,
aborted: bool,
/// The document associated with this request
doc: Trusted<Document>,
/// timing data for this resource
Expand All @@ -193,7 +193,7 @@ impl FetchResponseListener for ImageContext {
if let Some(ref content_type) = metadata.content_type {
let mime: Mime = content_type.clone().into_inner().into();
if mime.type_() == mime::MULTIPART && mime.subtype().as_str() == "x-mixed-replace" {
self.aborted.set(true);
self.aborted = true;
}
}
}
Expand Down Expand Up @@ -255,7 +255,7 @@ impl ResourceTimingListener for ImageContext {

impl PreInvoke for ImageContext {
fn should_invoke(&self) -> bool {
!self.aborted.get()
!self.aborted
}
}

Expand Down Expand Up @@ -301,7 +301,7 @@ impl HTMLImageElement {
image_cache: window.image_cache(),
status: Ok(()),
id: id,
aborted: Cell::new(false),
aborted: false,
doc: Trusted::new(&document),
resource_timing: ResourceFetchTiming::new(ResourceTimingType::Resource),
url: img_url.clone(),
Expand Down

0 comments on commit 1033d6b

Please sign in to comment.