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

Unified Diff: third_party/WebKit/Source/core/loader/resource/MockFontResourceClient.h

Issue 2556683003: Reland: WebFonts cache-aware timeout adaptation (Closed)
Patch Set: rebase Created 4 years 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/loader/resource/MockFontResourceClient.h
diff --git a/third_party/WebKit/Source/core/loader/resource/MockFontResourceClient.h b/third_party/WebKit/Source/core/loader/resource/MockFontResourceClient.h
new file mode 100644
index 0000000000000000000000000000000000000000..948c980b6b12bc741d89b3e1208c3d594fc3cfc4
--- /dev/null
+++ b/third_party/WebKit/Source/core/loader/resource/MockFontResourceClient.h
@@ -0,0 +1,53 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MockFontResourceClient_h
+#define MockFontResourceClient_h
+
+#include "core/fetch/Resource.h"
+#include "core/fetch/ResourceClient.h"
+#include "core/loader/resource/FontResource.h"
+#include "platform/heap/Handle.h"
+
+namespace blink {
+
+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 // MockFontResourceClient_h

Powered by Google App Engine
This is Rietveld 408576698