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 MockResourceClients_h | 31 #ifndef MockResourceClients_h |
32 #define MockResourceClients_h | 32 #define MockResourceClients_h |
33 | 33 |
| 34 #include "core/fetch/ImageResource.h" |
| 35 #include "core/fetch/ImageResourceContent.h" |
34 #include "core/fetch/ImageResourceObserver.h" | 36 #include "core/fetch/ImageResourceObserver.h" |
35 #include "core/fetch/Resource.h" | 37 #include "core/fetch/Resource.h" |
36 #include "core/fetch/ResourceClient.h" | 38 #include "core/fetch/ResourceClient.h" |
37 #include "platform/heap/Handle.h" | 39 #include "platform/heap/Handle.h" |
38 | 40 |
39 namespace blink { | 41 namespace blink { |
40 | 42 |
41 class MockResourceClient : public GarbageCollectedFinalized<MockResourceClient>, | 43 class MockResourceClient : public GarbageCollectedFinalized<MockResourceClient>, |
42 public ResourceClient { | 44 public ResourceClient { |
43 USING_PRE_FINALIZER(MockResourceClient, dispose); | 45 USING_PRE_FINALIZER(MockResourceClient, dispose); |
(...skipping 21 matching lines...) Expand all Loading... |
65 bool m_notifyFinishedCalled; | 67 bool m_notifyFinishedCalled; |
66 size_t m_encodedSizeOnNotifyFinished; | 68 size_t m_encodedSizeOnNotifyFinished; |
67 }; | 69 }; |
68 | 70 |
69 class MockImageResourceClient final : public MockResourceClient, | 71 class MockImageResourceClient final : public MockResourceClient, |
70 public ImageResourceObserver { | 72 public ImageResourceObserver { |
71 public: | 73 public: |
72 explicit MockImageResourceClient(ImageResource*); | 74 explicit MockImageResourceClient(ImageResource*); |
73 ~MockImageResourceClient() override; | 75 ~MockImageResourceClient() override; |
74 | 76 |
75 void imageNotifyFinished(ImageResource*) override; | 77 void imageNotifyFinished(ImageResourceContent*) override; |
76 void imageChanged(ImageResource*, const IntRect*) override; | 78 void imageChanged(ImageResourceContent*, const IntRect*) override; |
77 | 79 |
78 String debugName() const override { return "MockImageResourceClient"; } | 80 String debugName() const override { return "MockImageResourceClient"; } |
79 | 81 |
80 bool notifyFinishedCalled() const override; | 82 bool notifyFinishedCalled() const override; |
81 | 83 |
82 void removeAsClient() override; | 84 void removeAsClient() override; |
83 void dispose() override; | 85 void dispose() override; |
84 | 86 |
85 int imageChangedCount() const { return m_imageChangedCount; } | 87 int imageChangedCount() const { return m_imageChangedCount; } |
86 int imageNotifyFinishedCount() const { return m_imageNotifyFinishedCount; } | 88 int imageNotifyFinishedCount() const { return m_imageNotifyFinishedCount; } |
87 | 89 |
88 size_t encodedSizeOnLastImageChanged() const { | 90 size_t encodedSizeOnLastImageChanged() const { |
89 return m_encodedSizeOnLastImageChanged; | 91 return m_encodedSizeOnLastImageChanged; |
90 } | 92 } |
91 size_t encodedSizeOnImageNotifyFinished() const { | 93 size_t encodedSizeOnImageNotifyFinished() const { |
92 return m_encodedSizeOnImageNotifyFinished; | 94 return m_encodedSizeOnImageNotifyFinished; |
93 } | 95 } |
94 | 96 |
95 private: | 97 private: |
96 int m_imageChangedCount; | 98 int m_imageChangedCount; |
97 size_t m_encodedSizeOnLastImageChanged; | 99 size_t m_encodedSizeOnLastImageChanged; |
98 int m_imageNotifyFinishedCount; | 100 int m_imageNotifyFinishedCount; |
99 size_t m_encodedSizeOnImageNotifyFinished; | 101 size_t m_encodedSizeOnImageNotifyFinished; |
100 }; | 102 }; |
101 | 103 |
102 } // namespace blink | 104 } // namespace blink |
103 | 105 |
104 #endif // MockResourceClients_h | 106 #endif // MockResourceClients_h |
OLD | NEW |