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

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

Issue 2494243003: Set WebFont priority to very low if the network is detected to be slow (Closed)
Patch Set: Addressed toyoshim comments Created 4 years, 1 month 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 2de0a247cda364998c55aca696d0456f8f37c313..86f9a9fad5012fba0c931fd8816aacc872311495 100644
--- a/third_party/WebKit/Source/core/fetch/FontResource.cpp
+++ b/third_party/WebKit/Source/core/fetch/FontResource.cpp
@@ -175,4 +175,16 @@ void FontResource::checkNotify() {
Resource::checkNotify();
}
+bool FontResource::isLowPriorityLoadingAllowedForRemoteFont() const {
+ assert(!url().protocolIsData());
+ assert(!isLoaded());
hiroshige 2016/11/15 06:05:41 Please use DCHECK() instead of assert().
tbansal1 2016/11/15 08:17:04 Done. Thanks for catching this.
+ ResourceClientWalker<FontResourceClient> walker(clients());
+ while (FontResourceClient* client = walker.next()) {
+ if (!client->isLowPriorityLoadingAllowedForRemoteFont()) {
+ return false;
+ }
+ }
+ return true;
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698