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

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 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.h
diff --git a/third_party/WebKit/Source/core/fetch/FontResource.h b/third_party/WebKit/Source/core/fetch/FontResource.h
index e83ab315a525782642b34205c432c2d1cc84114f..e93ed7b87237ff8ddc7f43e37054bb76c4283a7e 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,9 @@ 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 { return true; }
kinuko 2016/11/15 05:43:47 It probably doesn't change anything but is the def
tbansal1 2016/11/15 08:17:04 Yes it is intentional. I have added more comments
Kunihiko Sakamoto 2016/11/15 09:34:53 A supplementary explanation: All subclasses of Res
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698