Changeset 158702 in webkit


Ignore:
Timestamp:
Nov 5, 2013 5:26:53 PM (10 years ago)
Author:
barraclough@apple.com
Message:

Subresource loads should not prevent page throttling
https://bugs.webkit.org/show_bug.cgi?id=123757

Reviewed by Alexey Proskuryakov.

The page-is-loading test for inhibiting process supression is currently
too conservative, preventing supression of pages with infinitely loading
resources (commonly XHRs). Instead, just rely on the FrameLoader being
active (with hysteresis).

  • loader/SubresourceLoader.cpp:

(WebCore::SubresourceLoader::init):
(WebCore::SubresourceLoader::checkForHTTPStatusCodeError):
(WebCore::SubresourceLoader::didFinishLoading):
(WebCore::SubresourceLoader::didFail):
(WebCore::SubresourceLoader::willCancel):

  • loader/SubresourceLoader.h:
    • remove m_activityAssertion from SubresourceLoader.
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r158701 r158702  
     12013-11-05  Gavin Barraclough  <barraclough@apple.com>
     2
     3        Subresource loads should not prevent page throttling
     4        https://bugs.webkit.org/show_bug.cgi?id=123757
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        The page-is-loading test for inhibiting process supression is currently
     9        too conservative, preventing supression of pages with infinitely loading
     10        resources (commonly XHRs). Instead, just rely on the FrameLoader being
     11        active (with hysteresis).
     12
     13        * loader/SubresourceLoader.cpp:
     14        (WebCore::SubresourceLoader::init):
     15        (WebCore::SubresourceLoader::checkForHTTPStatusCodeError):
     16        (WebCore::SubresourceLoader::didFinishLoading):
     17        (WebCore::SubresourceLoader::didFail):
     18        (WebCore::SubresourceLoader::willCancel):
     19        * loader/SubresourceLoader.h:
     20            - remove m_activityAssertion from SubresourceLoader.
     21
    1222013-11-05  Tim Horton  <timothy_horton@apple.com>
    223
  • trunk/Source/WebCore/loader/SubresourceLoader.cpp

    r157979 r158702  
    110110    ASSERT(!reachedTerminalState());
    111111    m_state = Initialized;
    112     if (m_frame && m_frame->page() && !m_activityAssertion)
    113         m_activityAssertion = m_frame->page()->createActivityToken();
    114112    m_documentLoader->addSubresourceLoader(this);
    115113    return true;
     
    261259
    262260    m_state = Finishing;
    263     m_activityAssertion = nullptr;
    264261    m_resource->error(CachedResource::LoadError);
    265262    cancel();
     
    279276    CachedResourceHandle<CachedResource> protectResource(m_resource);
    280277    m_state = Finishing;
    281     m_activityAssertion = nullptr;
    282278    m_resource->setLoadFinishTime(finishTime);
    283279    m_resource->finishLoading(resourceData());
     
    304300    CachedResourceHandle<CachedResource> protectResource(m_resource);
    305301    m_state = Finishing;
    306     m_activityAssertion = nullptr;
    307302    if (m_resource->resourceToRevalidate())
    308303        memoryCache()->revalidationFailed(m_resource);
     
    327322    Ref<SubresourceLoader> protect(*this);
    328323    m_state = Finishing;
    329     m_activityAssertion = nullptr;
    330324    if (m_resource->resourceToRevalidate())
    331325        memoryCache()->revalidationFailed(m_resource);
  • trunk/Source/WebCore/loader/SubresourceLoader.h

    r157044 r158702  
    103103    SubresourceLoaderState m_state;
    104104    OwnPtr<RequestCountTracker> m_requestCountTracker;
    105     std::unique_ptr<PageActivityAssertionToken> m_activityAssertion;
    106105};
    107106
Note: See TracChangeset for help on using the changeset viewer.