| Index: third_party/WebKit/Source/core/fetch/MockResourceClients.h
|
| diff --git a/third_party/WebKit/Source/core/fetch/MockImageResourceClient.h b/third_party/WebKit/Source/core/fetch/MockResourceClients.h
|
| similarity index 74%
|
| rename from third_party/WebKit/Source/core/fetch/MockImageResourceClient.h
|
| rename to third_party/WebKit/Source/core/fetch/MockResourceClients.h
|
| index b877a92d9ff2275ef0ea6867f7c282664f971959..6fa5351f9865df3f7db99fe3a981ece75975a3f0 100644
|
| --- a/third_party/WebKit/Source/core/fetch/MockImageResourceClient.h
|
| +++ b/third_party/WebKit/Source/core/fetch/MockResourceClients.h
|
| @@ -28,40 +28,50 @@
|
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| */
|
|
|
| -#ifndef MockImageResourceClient_h
|
| -#define MockImageResourceClient_h
|
| +#ifndef MockResourceClients_h
|
| +#define MockResourceClients_h
|
|
|
| -#include "core/fetch/ImageResourceClient.h"
|
| +#include "core/fetch/ImageResourceObserver.h"
|
| #include "core/fetch/Resource.h"
|
| +#include "core/fetch/ResourceClient.h"
|
| #include "platform/heap/Handle.h"
|
|
|
| namespace blink {
|
|
|
| -class MockImageResourceClient final : public ImageResourceClient {
|
| +class MockResourceClient : public ResourceClient {
|
| public:
|
| - explicit MockImageResourceClient(const PassRefPtrWillBeRawPtr<Resource>);
|
| + explicit MockResourceClient(const PassRefPtrWillBeRawPtr<Resource>);
|
| + ~MockResourceClient() override;
|
| +
|
| + void notifyFinished(Resource*) override;
|
| + String debugName() const override { return "MockResourceClient"; }
|
| + bool notifyFinishedCalled() const { return m_notifyFinishedCalled; }
|
| +
|
| + virtual void removeAsClient();
|
| +
|
| +protected:
|
| + // TODO(Oilpan): properly trace when ResourceClient is on the heap.
|
| + RawPtrWillBeUntracedMember<Resource> m_resource;
|
| + bool m_notifyFinishedCalled;
|
| +};
|
| +
|
| +class MockImageResourceClient final : public MockResourceClient, public ImageResourceObserver {
|
| +public:
|
| + explicit MockImageResourceClient(const PassRefPtrWillBeRawPtr<ImageResource>);
|
| ~MockImageResourceClient() override;
|
|
|
| - void imageChanged(ImageResource*, const IntRect*) override
|
| - {
|
| - m_imageChangedCount++;
|
| - }
|
| + void imageChanged(ImageResource*, const IntRect*) override;
|
|
|
| - void notifyFinished(Resource*) override;
|
| String debugName() const override { return "MockImageResourceClient"; }
|
|
|
| - int imageChangedCount() const { return m_imageChangedCount; }
|
| - bool notifyFinishedCalled() const { return m_notifyFinishedCalled; }
|
| + void removeAsClient() override;
|
|
|
| - void removeAsClient();
|
| + int imageChangedCount() const { return m_imageChangedCount; }
|
|
|
| private:
|
| - // TODO(Oilpan): properly trace when ImageResourceClient is on the heap.
|
| - RawPtrWillBeUntracedMember<Resource> m_resource;
|
| int m_imageChangedCount;
|
| - bool m_notifyFinishedCalled;
|
| };
|
|
|
| } // namespace blink
|
|
|
| -#endif // MockImageResourceClient_h
|
| +#endif // MockResourceClients_h
|
|
|