Changeset 181412 in webkit


Ignore:
Timestamp:
Mar 11, 2015 3:52:43 PM (9 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r179340 and r179344.
https://bugs.webkit.org/show_bug.cgi?id=142598

Caused images to stay alive forever when navigating away from
the page before they finish loading. (Requested by kling on
#webkit).

Reverted changesets:

"CachedImage: ensure clients overrides imageChanged instead of
notifyFinished"
https://bugs.webkit.org/show_bug.cgi?id=140722
http://trac.webkit.org/changeset/179340

"HTMLImageLoader: fix build failure on assert condition after
r179340"
https://bugs.webkit.org/show_bug.cgi?id=140722
http://trac.webkit.org/changeset/179344

Location:
trunk/Source/WebCore
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r181411 r181412  
     12015-03-11  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r179340 and r179344.
     4        https://bugs.webkit.org/show_bug.cgi?id=142598
     5
     6        Caused images to stay alive forever when navigating away from
     7        the page before they finish loading. (Requested by kling on
     8        #webkit).
     9
     10        Reverted changesets:
     11
     12        "CachedImage: ensure clients overrides imageChanged instead of
     13        notifyFinished"
     14        https://bugs.webkit.org/show_bug.cgi?id=140722
     15        http://trac.webkit.org/changeset/179340
     16
     17        "HTMLImageLoader: fix build failure on assert condition after
     18        r179340"
     19        https://bugs.webkit.org/show_bug.cgi?id=140722
     20        http://trac.webkit.org/changeset/179344
     21
    1222015-03-11  Geoffrey Garen  <ggaren@apple.com>
    223
  • trunk/Source/WebCore/html/HTMLImageLoader.cpp

    r181411 r181412  
    7474}
    7575
    76 void HTMLImageLoader::imageChanged(CachedImage* cachedImage, const IntRect*)
     76void HTMLImageLoader::notifyFinished(CachedResource*)
    7777{
    78     ASSERT(cachedImage == image());
    79 
    80     if (!cachedImage->isLoaded())
    81         return;
     78    CachedImage* cachedImage = image();
    8279
    8380    Ref<Element> protect(element());
    84     ImageLoader::imageChanged(cachedImage);
     81    ImageLoader::notifyFinished(cachedImage);
    8582
    8683    bool loadError = cachedImage->errorOccurred() || cachedImage->response().httpStatusCode() >= 400;
  • trunk/Source/WebCore/html/HTMLImageLoader.h

    r179340 r181412  
    3636    virtual String sourceURI(const AtomicString&) const override;
    3737
    38     virtual void imageChanged(CachedImage*, const IntRect* = nullptr) override;
     38    virtual void notifyFinished(CachedResource*) override;
    3939};
    4040
  • trunk/Source/WebCore/loader/ImageLoader.cpp

    r179340 r181412  
    273273}
    274274
    275 void ImageLoader::imageChanged(CachedImage* cachedImage, const IntRect*)
     275void ImageLoader::notifyFinished(CachedResource* resource)
    276276{
    277277    ASSERT(m_failedLoadURL.isEmpty());
    278     ASSERT(cachedImage == m_image.get());
    279 
    280     if (!cachedImage->isLoaded())
    281         return;
     278    ASSERT(resource == m_image.get());
    282279
    283280    m_imageComplete = true;
     
    290287    if (element().fastHasAttribute(HTMLNames::crossoriginAttr)
    291288        && !element().document().securityOrigin()->canRequest(image()->response().url())
    292         && !cachedImage->passesAccessControlCheck(element().document().securityOrigin())) {
     289        && !resource->passesAccessControlCheck(element().document().securityOrigin())) {
    293290
    294291        setImageWithoutConsideringPendingLoadEvent(0);
     
    308305    }
    309306
    310     if (cachedImage->wasCanceled()) {
     307    if (resource->wasCanceled()) {
    311308        m_hasPendingLoadEvent = false;
    312309        // Only consider updating the protection ref-count of the Element immediately before returning
  • trunk/Source/WebCore/loader/ImageLoader.h

    r179340 r181412  
    7474protected:
    7575    explicit ImageLoader(Element&);
    76     virtual void imageChanged(CachedImage*, const IntRect* = nullptr) override;
     76    virtual void notifyFinished(CachedResource*) override;
    7777
    7878private:
  • trunk/Source/WebCore/loader/cache/CachedImage.cpp

    r179626 r181412  
    430430    }
    431431
     432    notifyObservers();
    432433    if (m_image)
    433434        setEncodedSize(m_image->data() ? m_image->data()->size() : 0);
    434 
    435     setLoading(false);
    436     notifyObservers();
     435    CachedResource::finishLoading(data);
    437436}
    438437
  • trunk/Source/WebCore/loader/cache/CachedImageClient.h

    r179340 r181412  
    3939    // Called whenever a frame of an image changes because we got more data from the network.
    4040    // If not null, the IntRect is the changed rect of the image.
    41     virtual void imageChanged(CachedImage*, const IntRect* = nullptr) { }
     41    virtual void imageChanged(CachedImage*, const IntRect* = 0) { }
    4242
    4343    // Called when GIF animation progresses.
    4444    virtual void newImageAnimationFrameAvailable(CachedImage& image) { imageChanged(&image); }
    45 
    46     // Use imageChanged instead.
    47     virtual void notifyFinished(CachedResource*) override final { }
    4845};
    4946
  • trunk/Source/WebCore/rendering/RenderImage.cpp

    r179488 r181412  
    365365}
    366366
     367void RenderImage::notifyFinished(CachedResource* newImage)
     368{
     369    if (documentBeingDestroyed())
     370        return;
     371
     372    invalidateBackgroundObscurationStatus();
     373
     374    if (newImage == imageResource().cachedImage()) {
     375        // tell any potential compositing layers
     376        // that the image is done and they can reference it directly.
     377        contentChanged(ImageChanged);
     378    }
     379}
     380
    367381void RenderImage::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
    368382{
  • trunk/Source/WebCore/rendering/RenderImage.h

    r179340 r181412  
    100100    virtual LayoutUnit minimumReplacedHeight() const override;
    101101
     102    virtual void notifyFinished(CachedResource*) override final;
    102103    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) override final;
    103104
  • trunk/Source/WebCore/svg/SVGFEImageElement.cpp

    r179810 r181412  
    191191}
    192192
    193 void SVGFEImageElement::imageChanged(CachedImage* cachedImage, const IntRect*)
    194 {
    195     if (!cachedImage || !cachedImage->isLoaded())
    196         return;
    197 
     193void SVGFEImageElement::notifyFinished(CachedResource*)
     194{
    198195    if (!inDocument())
    199196        return;
  • trunk/Source/WebCore/svg/SVGFEImageElement.h

    r179340 r181412  
    5252    virtual void parseAttribute(const QualifiedName&, const AtomicString&) override;
    5353    virtual void svgAttributeChanged(const QualifiedName&) override;
    54     virtual void imageChanged(CachedImage*, const IntRect* = nullptr) override;
     54    virtual void notifyFinished(CachedResource*) override;
    5555
    5656    virtual void addSubresourceAttributeURLs(ListHashSet<URL>&) const override;
Note: See TracChangeset for help on using the changeset viewer.