| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013, Google Inc. All rights reserved. | 2 * Copyright (c) 2013, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef MockResourceClient_h | 31 #ifndef MockResourceClient_h |
| 32 #define MockResourceClient_h | 32 #define MockResourceClient_h |
| 33 | 33 |
| 34 #include "core/fetch/Resource.h" | 34 #include "platform/PlatformExport.h" |
| 35 #include "core/fetch/ResourceClient.h" | |
| 36 #include "platform/heap/Handle.h" | 35 #include "platform/heap/Handle.h" |
| 36 #include "platform/loader/fetch/Resource.h" |
| 37 #include "platform/loader/fetch/ResourceClient.h" |
| 37 | 38 |
| 38 namespace blink { | 39 namespace blink { |
| 39 | 40 |
| 40 class MockResourceClient : public GarbageCollectedFinalized<MockResourceClient>, | 41 class PLATFORM_EXPORT MockResourceClient |
| 41 public ResourceClient { | 42 : public GarbageCollectedFinalized<MockResourceClient>, |
| 43 public ResourceClient { |
| 42 USING_PRE_FINALIZER(MockResourceClient, dispose); | 44 USING_PRE_FINALIZER(MockResourceClient, dispose); |
| 43 USING_GARBAGE_COLLECTED_MIXIN(MockResourceClient); | 45 USING_GARBAGE_COLLECTED_MIXIN(MockResourceClient); |
| 44 | 46 |
| 45 public: | 47 public: |
| 46 explicit MockResourceClient(Resource*); | 48 explicit MockResourceClient(Resource*); |
| 47 ~MockResourceClient() override; | 49 ~MockResourceClient() override; |
| 48 | 50 |
| 49 void notifyFinished(Resource*) override; | 51 void notifyFinished(Resource*) override; |
| 50 String debugName() const override { return "MockResourceClient"; } | 52 String debugName() const override { return "MockResourceClient"; } |
| 51 virtual bool notifyFinishedCalled() const { return m_notifyFinishedCalled; } | 53 virtual bool notifyFinishedCalled() const { return m_notifyFinishedCalled; } |
| 52 | 54 |
| 53 size_t encodedSizeOnNotifyFinished() const { | 55 size_t encodedSizeOnNotifyFinished() const { |
| 54 return m_encodedSizeOnNotifyFinished; | 56 return m_encodedSizeOnNotifyFinished; |
| 55 } | 57 } |
| 56 | 58 |
| 57 virtual void removeAsClient(); | 59 virtual void removeAsClient(); |
| 58 virtual void dispose(); | 60 virtual void dispose(); |
| 59 | 61 |
| 60 DECLARE_TRACE(); | 62 DECLARE_TRACE(); |
| 61 | 63 |
| 62 protected: | 64 protected: |
| 63 Member<Resource> m_resource; | 65 Member<Resource> m_resource; |
| 64 bool m_notifyFinishedCalled; | 66 bool m_notifyFinishedCalled; |
| 65 size_t m_encodedSizeOnNotifyFinished; | 67 size_t m_encodedSizeOnNotifyFinished; |
| 66 }; | 68 }; |
| 67 | 69 |
| 68 } // namespace blink | 70 } // namespace blink |
| 69 | 71 |
| 70 #endif // MockResourceClient_h | 72 #endif // MockResourceClient_h |
| OLD | NEW |