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..5d191676fdda0b9fe85e1fce4d65117c56606b18 100644 |
--- a/third_party/WebKit/Source/core/fetch/FontResource.h |
+++ b/third_party/WebKit/Source/core/fetch/FontResource.h |
@@ -67,6 +67,8 @@ class CORE_EXPORT FontResource final : public Resource { |
bool italic, |
FontOrientation = FontOrientation::Horizontal); |
+ void willReloadAfterDiskCacheMiss() override; |
+ |
private: |
class FontResourceFactory : public ResourceFactory { |
public: |
@@ -83,12 +85,16 @@ class CORE_EXPORT FontResource final : public Resource { |
void checkNotify() override; |
void fontLoadShortLimitCallback(TimerBase*); |
void fontLoadLongLimitCallback(TimerBase*); |
+ void notifyClientsShortLimitExceeded(); |
+ void notifyClientsLongLimitExceeded(); |
+ // This is used in UMA histograms, should not change order. |
enum LoadLimitState { |
LoadNotStarted, |
UnderLimit, |
ShortLimitExceeded, |
- LongLimitExceeded |
+ LongLimitExceeded, |
+ LoadLimitStateEnumMax |
}; |
std::unique_ptr<FontCustomPlatformData> m_fontData; |
@@ -110,6 +116,11 @@ class FontResourceClient : public ResourceClient { |
return client->getResourceClientType() == FontType; |
} |
ResourceClientType getResourceClientType() const final { return FontType; } |
+ |
+ // If cache-aware loading is activated, both callbacks will be blocked until |
+ // disk cache miss. If called on cache miss, calls to addClient() and |
+ // removeClient() is prohibited to prevent race issues regarding current |
+ // loading state. |
virtual void fontLoadShortLimitExceeded(FontResource*) {} |
virtual void fontLoadLongLimitExceeded(FontResource*) {} |
}; |