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

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

Issue 2494243003: Set WebFont priority to very low if the network is detected to be slow (Closed)
Patch Set: addressed 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.h
diff --git a/third_party/WebKit/Source/core/fetch/FontResource.h b/third_party/WebKit/Source/core/fetch/FontResource.h
index e83ab315a525782642b34205c432c2d1cc84114f..1a4d0ae51db8b44ffbf66354e00057ec4709b2b3 100644
--- a/third_party/WebKit/Source/core/fetch/FontResource.h
+++ b/third_party/WebKit/Source/core/fetch/FontResource.h
@@ -67,6 +67,11 @@ class CORE_EXPORT FontResource final : public Resource {
bool italic,
FontOrientation = FontOrientation::Horizontal);
+ // Returns true if the loading priority of the remote font resource can be
+ // lowered. The loading priority of the font can be lowered only if the
+ // font is not needed for painting the text.
+ bool isLowPriorityLoadingAllowedForRemoteFont() const;
+
private:
class FontResourceFactory : public ResourceFactory {
public:
@@ -112,6 +117,14 @@ class FontResourceClient : public ResourceClient {
ResourceClientType getResourceClientType() const final { return FontType; }
virtual void fontLoadShortLimitExceeded(FontResource*) {}
virtual void fontLoadLongLimitExceeded(FontResource*) {}
+
+ // Returns true if loading priority of remote font resources can be lowered.
+ virtual bool isLowPriorityLoadingAllowedForRemoteFont() const {
+ // Only the RemoteFontFaceSources clients can prevent lowering of loading
+ // priority of the remote fonts. Set the default to true to prevent
+ // other clients from incorrectly returning false.
+ return true;
+ }
};
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp ('k') | third_party/WebKit/Source/core/fetch/FontResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698