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/MockResourceClients.h

Issue 2453813004: WebFonts cache-aware timeout adaptation (Closed)
Patch Set: rebase 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/MockResourceClients.h
diff --git a/third_party/WebKit/Source/core/fetch/MockResourceClients.h b/third_party/WebKit/Source/core/fetch/MockResourceClients.h
index f5a6313c81af8c16740fc0b35c9dc3581e35827d..000f58d6ad36c905e8f4cf95f70823e119e9981c 100644
--- a/third_party/WebKit/Source/core/fetch/MockResourceClients.h
+++ b/third_party/WebKit/Source/core/fetch/MockResourceClients.h
@@ -31,6 +31,7 @@
#ifndef MockResourceClients_h
#define MockResourceClients_h
+#include "core/fetch/FontResource.h"
#include "core/fetch/ImageResourceObserver.h"
#include "core/fetch/Resource.h"
#include "core/fetch/ResourceClient.h"
@@ -98,6 +99,42 @@ class MockImageResourceClient final : public MockResourceClient,
size_t m_encodedSizeOnImageNotifyFinished;
};
+class MockFontResourceClient final
+ : public GarbageCollectedFinalized<MockFontResourceClient>,
+ public FontResourceClient {
+ USING_PRE_FINALIZER(MockFontResourceClient, dispose);
+ USING_GARBAGE_COLLECTED_MIXIN(MockFontResourceClient);
+
+ public:
+ explicit MockFontResourceClient(Resource*);
+ ~MockFontResourceClient() override;
+
+ void fontLoadShortLimitExceeded(FontResource*) override;
+ void fontLoadLongLimitExceeded(FontResource*) override;
+
+ bool fontLoadShortLimitExceededCalled() const {
+ return m_fontLoadShortLimitExceededCalled;
+ }
+
+ bool fontLoadLongLimitExceededCalled() const {
+ return m_fontLoadLongLimitExceededCalled;
+ }
+
+ DEFINE_INLINE_TRACE() {
+ visitor->trace(m_resource);
+ FontResourceClient::trace(visitor);
+ }
+
+ String debugName() const override { return "MockFontResourceClient"; }
+
+ private:
+ void dispose();
+
+ Member<Resource> m_resource;
+ bool m_fontLoadShortLimitExceededCalled;
+ bool m_fontLoadLongLimitExceededCalled;
+};
+
} // namespace blink
#endif // MockResourceClients_h
« no previous file with comments | « third_party/WebKit/Source/core/fetch/FontResource.cpp ('k') | third_party/WebKit/Source/core/fetch/MockResourceClients.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698