Changeset 218502 in webkit


Ignore:
Timestamp:
Jun 19, 2017 1:12:41 PM (7 years ago)
Author:
beidson@apple.com
Message:

Cleanup IconLoader stuff when a DocumentLoader detaches from its frame.
<rdar://problem/31418761> and https://bugs.webkit.org/show_bug.cgi?id=173473

Reviewed by Alex Christensen.

No new tests (No known change in behavior)

I discovered the need to make these changes here due to a transient bug
introduced in r218015 but already explicitly fixed in r218409.

This change adds an assert to guard against a detached DocumentLoader having active IconLoaders.

It also clears out all pending IconLoader and icon load decisions when stopLoading() is called,
as even attempting to start an icon load after detachment is a waste of cycles.

  • loader/DocumentLoader.cpp:

(WebCore::DocumentLoader::stopLoading): Also explicitly clear all IconLoaders and icons pending

load decision.

(WebCore::DocumentLoader::finishedLoadingIcon): Assert that this DocumentLoader is not detached.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r218501 r218502  
     12017-06-19  Brady Eidson  <beidson@apple.com>
     2
     3        Cleanup IconLoader stuff when a DocumentLoader detaches from its frame.
     4        <rdar://problem/31418761> and https://bugs.webkit.org/show_bug.cgi?id=173473
     5
     6        Reviewed by Alex Christensen.
     7
     8        No new tests (No known change in behavior)
     9
     10        I discovered the need to make these changes here due to a transient bug
     11        introduced in r218015 but already explicitly fixed in r218409.
     12       
     13        This change adds an assert to guard against a detached DocumentLoader having active IconLoaders.
     14
     15        It also clears out all pending IconLoader and icon load decisions when stopLoading() is called,
     16        as even attempting to start an icon load after detachment is a waste of cycles.
     17       
     18        * loader/DocumentLoader.cpp:
     19        (WebCore::DocumentLoader::stopLoading): Also explicitly clear all IconLoaders and icons pending
     20          load decision.
     21        (WebCore::DocumentLoader::finishedLoadingIcon): Assert that this DocumentLoader is not detached.
     22
    1232017-06-19  Chris Dumez  <cdumez@apple.com>
    224
  • trunk/Source/WebCore/loader/DocumentLoader.cpp

    r218409 r218502  
    283283    }
    284284
     285    m_iconsPendingLoadDecision.clear();
     286    m_iconLoaders.clear();
     287
    285288    // Always cancel multipart loaders
    286289    cancelAll(m_multipartSubresourceLoaders);
     
    16901693void DocumentLoader::finishedLoadingIcon(IconLoader& loader, SharedBuffer* buffer)
    16911694{
     1695    // If the DocumentLoader has detached from its frame, all icon loads should have already been cancelled.
     1696    ASSERT(m_frame);
     1697
    16921698    auto loadIdentifier = m_iconLoaders.take(&loader);
    16931699    ASSERT(loadIdentifier);
Note: See TracChangeset for help on using the changeset viewer.