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

Unified Diff: third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp

Issue 2494243003: Set WebFont priority to very low if the network is detected to be slow (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | 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/css/RemoteFontFaceSource.cpp
diff --git a/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp b/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp
index e6f9a8c7845dd7d7ec5e0fb09577a04afb6d853a..ac48e7bb40087b8e33094a3699ab1e9992829a2a 100644
--- a/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp
+++ b/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp
@@ -17,6 +17,7 @@
#include "platform/fonts/FontCache.h"
#include "platform/fonts/FontDescription.h"
#include "platform/fonts/SimpleFontData.h"
+#include "platform/network/ResourceLoadPriority.h"
#include "public/platform/WebEffectiveConnectionType.h"
#include "wtf/CurrentTime.h"
@@ -73,6 +74,10 @@ RemoteFontFaceSource::RemoteFontFaceSource(FontResource* font,
OtherMessageSource, InfoMessageLevel,
"Slow network is detected. Fallback font will be used while loading: " +
m_font->url().elidedString()));
+ if (!font->url().protocolIsData() && !font->isLoaded() &&
Takashi Toyoshima 2016/11/14 03:53:56 |font| is shared by multiple RemoteFontFaceSource
tbansal1 2016/11/14 20:12:08 Done.
+ m_display == FontDisplayAuto) {
+ m_font->didChangePriority(ResourceLoadPriorityVeryLow, 0);
+ }
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698