Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.



Canonical link: https://commits.webkit.org/142029@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158702 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Gavin Barraclough committed Nov 6, 2013
1 parent 99814d8 commit 18634a0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
21 changes: 21 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,24 @@
2013-11-05 Gavin Barraclough <barraclough@apple.com>

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.

2013-11-05 Tim Horton <timothy_horton@apple.com>

[mac] PDFDocumentImage is too big if PDF has a crop box smaller than the media box
Expand Down
6 changes: 0 additions & 6 deletions Source/WebCore/loader/SubresourceLoader.cpp
Expand Up @@ -109,8 +109,6 @@ bool SubresourceLoader::init(const ResourceRequest& request)

ASSERT(!reachedTerminalState());
m_state = Initialized;
if (m_frame && m_frame->page() && !m_activityAssertion)
m_activityAssertion = m_frame->page()->createActivityToken();
m_documentLoader->addSubresourceLoader(this);
return true;
}
Expand Down Expand Up @@ -260,7 +258,6 @@ bool SubresourceLoader::checkForHTTPStatusCodeError()
return false;

m_state = Finishing;
m_activityAssertion = nullptr;
m_resource->error(CachedResource::LoadError);
cancel();
return true;
Expand All @@ -278,7 +275,6 @@ void SubresourceLoader::didFinishLoading(double finishTime)
Ref<SubresourceLoader> protect(*this);
CachedResourceHandle<CachedResource> protectResource(m_resource);
m_state = Finishing;
m_activityAssertion = nullptr;
m_resource->setLoadFinishTime(finishTime);
m_resource->finishLoading(resourceData());

Expand All @@ -303,7 +299,6 @@ void SubresourceLoader::didFail(const ResourceError& error)
Ref<SubresourceLoader> protect(*this);
CachedResourceHandle<CachedResource> protectResource(m_resource);
m_state = Finishing;
m_activityAssertion = nullptr;
if (m_resource->resourceToRevalidate())
memoryCache()->revalidationFailed(m_resource);
m_resource->setResourceError(error);
Expand All @@ -326,7 +321,6 @@ void SubresourceLoader::willCancel(const ResourceError& error)

Ref<SubresourceLoader> protect(*this);
m_state = Finishing;
m_activityAssertion = nullptr;
if (m_resource->resourceToRevalidate())
memoryCache()->revalidationFailed(m_resource);
m_resource->setResourceError(error);
Expand Down
1 change: 0 additions & 1 deletion Source/WebCore/loader/SubresourceLoader.h
Expand Up @@ -102,7 +102,6 @@ class SubresourceLoader : public ResourceLoader {
bool m_loadingMultipartContent;
SubresourceLoaderState m_state;
OwnPtr<RequestCountTracker> m_requestCountTracker;
std::unique_ptr<PageActivityAssertionToken> m_activityAssertion;
};

}
Expand Down

0 comments on commit 18634a0

Please sign in to comment.