⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 93717 in webkit


Ignore:
Timestamp:
Aug 24, 2011, 11:28:12 AM (15 years ago)
Author:
weinig@apple.com
Message:

JSHTMLImageElement (and associated Node) is abandoned when image load is canceled
<rdar://problem/9925630>
https://bugs.webkit.org/show_bug.cgi?id=66864

Reviewed by Anders Carlsson.

In the JSC bindings, we use HTMLImageElement::hasPendingActivity() (which in turn calls
HTMLImageLoader::haveFiredLoadEvent()) to reason about the liveness of JSHTMLImageElements.
In the case that an image load is canceled, the haveFiredLoadEvent never true, so the
JSHTMLImageElement is kept alive forever (and since it references the global object, it
keeps the entire graph alive as well).

  • loader/ImageLoader.cpp:

(WebCore::ImageLoader::notifyFinished):
Set m_firedLoad to true in the case of a canceled load, to reset the state back to
its initial values.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r93713 r93717  
     12011-08-24  Sam Weinig  <sam@webkit.org>
     2
     3        JSHTMLImageElement (and associated Node) is abandoned when image load is canceled
     4        <rdar://problem/9925630>
     5        https://bugs.webkit.org/show_bug.cgi?id=66864
     6
     7        Reviewed by Anders Carlsson.
     8
     9        In the JSC bindings, we use HTMLImageElement::hasPendingActivity() (which in turn calls
     10        HTMLImageLoader::haveFiredLoadEvent()) to reason about the liveness of JSHTMLImageElements.
     11        In the case that an image load is canceled, the haveFiredLoadEvent never true, so the
     12        JSHTMLImageElement is kept alive forever (and since it references the global object, it
     13        keeps the entire graph alive as well).
     14
     15        * loader/ImageLoader.cpp:
     16        (WebCore::ImageLoader::notifyFinished):
     17        Set m_firedLoad to true in the case of a canceled load, to reset the state back to
     18        its initial values.
     19
    1202011-08-24  Tommy Widenflycht  <tommyw@google.com>
    221
  • trunk/Source/WebCore/loader/ImageLoader.cpp

    r87633 r93717  
    235235        return;
    236236
    237     if (resource->wasCanceled())
    238         return;
     237    if (resource->wasCanceled()) {
     238        m_firedLoad = true;
     239        return;
     240    }
    239241
    240242    loadEventSender().dispatchEventSoon(this);
Note: See TracChangeset for help on using the changeset viewer.