OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef MockFontResourceClient_h |
| 6 #define MockFontResourceClient_h |
| 7 |
| 8 #include "core/fetch/Resource.h" |
| 9 #include "core/fetch/ResourceClient.h" |
| 10 #include "core/loader/resource/FontResource.h" |
| 11 #include "platform/heap/Handle.h" |
| 12 |
| 13 namespace blink { |
| 14 |
| 15 class MockFontResourceClient final |
| 16 : public GarbageCollectedFinalized<MockFontResourceClient>, |
| 17 public FontResourceClient { |
| 18 USING_PRE_FINALIZER(MockFontResourceClient, dispose); |
| 19 USING_GARBAGE_COLLECTED_MIXIN(MockFontResourceClient); |
| 20 |
| 21 public: |
| 22 explicit MockFontResourceClient(Resource*); |
| 23 ~MockFontResourceClient() override; |
| 24 |
| 25 void fontLoadShortLimitExceeded(FontResource*) override; |
| 26 void fontLoadLongLimitExceeded(FontResource*) override; |
| 27 |
| 28 bool fontLoadShortLimitExceededCalled() const { |
| 29 return m_fontLoadShortLimitExceededCalled; |
| 30 } |
| 31 |
| 32 bool fontLoadLongLimitExceededCalled() const { |
| 33 return m_fontLoadLongLimitExceededCalled; |
| 34 } |
| 35 |
| 36 DEFINE_INLINE_TRACE() { |
| 37 visitor->trace(m_resource); |
| 38 FontResourceClient::trace(visitor); |
| 39 } |
| 40 |
| 41 String debugName() const override { return "MockFontResourceClient"; } |
| 42 |
| 43 private: |
| 44 void dispose(); |
| 45 |
| 46 Member<Resource> m_resource; |
| 47 bool m_fontLoadShortLimitExceededCalled; |
| 48 bool m_fontLoadLongLimitExceededCalled; |
| 49 }; |
| 50 |
| 51 } // namespace blink |
| 52 |
| 53 #endif // MockFontResourceClient_h |
OLD | NEW |