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

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: address hiroshige's comments at #11 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..2ca8b83f8b8874a6b41eabb4538d28791ca08ddb 100644
--- a/third_party/WebKit/Source/core/fetch/FontResource.cpp
+++ b/third_party/WebKit/Source/core/fetch/FontResource.cpp
@@ -105,11 +105,20 @@ void FontResource::didAddClient(ResourceClient* c)
static_cast<FontResourceClient*>(c)->fontLoadLongLimitExceeded(this);
}
+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;
+ Resource::setRevalidatingRequest(request);
+}
+
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