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

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

Issue 1893233002: WebFonts: reset m_loadLimitState on memory cache revalidation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add a LayoutTest Created 4 years, 8 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
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 eb9da1f40a8a0eea29d37d227d7b2bd35de1e74c..a0e2c88eeb4b67321758657e2e87e18a1a9d95a2 100644
--- a/third_party/WebKit/Source/core/fetch/FontResource.cpp
+++ b/third_party/WebKit/Source/core/fetch/FontResource.cpp
@@ -105,11 +105,19 @@ void FontResource::didAddClient(ResourceClient* c)
static_cast<FontResourceClient*>(c)->fontLoadLongLimitExceeded(this);
}
+void FontResource::prepareToRevalidate()
+{
+ // Reload will use the same object, and needs to reset |m_loadLimitState|
+ // before any didAddClient() is called again.
+ m_loadLimitState = UnderLimit;
+}
+
void FontResource::startLoadLimitTimersIfNeeded()
{
ASSERT(!stillNeedsLoad());
if (isLoaded() || m_fontLoadLongLimitTimer.isActive())
return;
+ ASSERT(m_loadLimitState == UnderLimit);
m_fontLoadShortLimitTimer.startOneShot(fontLoadWaitShortLimitSec, BLINK_FROM_HERE);
m_fontLoadLongLimitTimer.startOneShot(fontLoadWaitLongLimitSec, BLINK_FROM_HERE);
}

Powered by Google App Engine
This is Rietveld 408576698