Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(515)

Unified Diff: third_party/WebKit/Source/core/fetch/FontResource.cpp

Issue 2419753002: Prevent FontResource load limit timers from restarting during loading (Closed)
Patch Set: new LoadLimitState, text-only test Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/fetch/FontResource.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/fetch/FontResource.cpp
diff --git a/third_party/WebKit/Source/core/fetch/FontResource.cpp b/third_party/WebKit/Source/core/fetch/FontResource.cpp
index a5314e845fb10fa6267466f8558e4ad47ea417ab..2de0a247cda364998c55aca696d0456f8f37c313 100644
--- a/third_party/WebKit/Source/core/fetch/FontResource.cpp
+++ b/third_party/WebKit/Source/core/fetch/FontResource.cpp
@@ -83,7 +83,7 @@ FontResource* FontResource::fetch(FetchRequest& request,
FontResource::FontResource(const ResourceRequest& resourceRequest,
const ResourceLoaderOptions& options)
: Resource(resourceRequest, Font, options),
- m_loadLimitState(UnderLimit),
+ m_loadLimitState(LoadNotStarted),
m_corsFailed(false),
m_fontLoadShortLimitTimer(this,
&FontResource::fontLoadShortLimitCallback),
@@ -105,15 +105,14 @@ void FontResource::didAddClient(ResourceClient* c) {
void FontResource::setRevalidatingRequest(const ResourceRequest& request) {
// Reload will use the same object, and needs to reset |m_loadLimitState|
// before any didAddClient() is called again.
- m_loadLimitState = UnderLimit;
+ m_loadLimitState = LoadNotStarted;
Resource::setRevalidatingRequest(request);
}
-void FontResource::startLoadLimitTimersIfNeeded() {
- DCHECK(!stillNeedsLoad());
- if (isLoaded() || m_fontLoadLongLimitTimer.isActive())
- return;
- DCHECK_EQ(m_loadLimitState, UnderLimit);
+void FontResource::startLoadLimitTimers() {
+ DCHECK(isLoading());
+ DCHECK_EQ(m_loadLimitState, LoadNotStarted);
+ m_loadLimitState = UnderLimit;
m_fontLoadShortLimitTimer.startOneShot(fontLoadWaitShortLimitSec,
BLINK_FROM_HERE);
m_fontLoadLongLimitTimer.startOneShot(fontLoadWaitLongLimitSec,
« no previous file with comments | « third_party/WebKit/Source/core/fetch/FontResource.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698