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

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

Issue 2584423002: Loading: move core/fetch to platform/loader/fetch (Closed)
Patch Set: another try Created 3 years, 11 months 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/MockImageResourceClient.h
diff --git a/third_party/WebKit/Source/core/loader/resource/MockImageResourceClient.h b/third_party/WebKit/Source/core/loader/resource/MockImageResourceClient.h
new file mode 100644
index 0000000000000000000000000000000000000000..ecbc913097b6beebd8887e72c70ef4eaf29adfd6
--- /dev/null
+++ b/third_party/WebKit/Source/core/loader/resource/MockImageResourceClient.h
@@ -0,0 +1,50 @@
+// 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 MockImageResourceClient_h
+#define MockImageResourceClient_h
+
+#include "core/loader/resource/ImageResource.h"
+#include "core/loader/resource/ImageResourceContent.h"
+#include "core/loader/resource/ImageResourceObserver.h"
+#include "platform/loader/fetch/MockResourceClient.h"
+
+namespace blink {
+
+class MockImageResourceClient final : public MockResourceClient,
+ public ImageResourceObserver {
+ public:
+ explicit MockImageResourceClient(ImageResource*);
+ ~MockImageResourceClient() override;
+
+ void imageNotifyFinished(ImageResourceContent*) override;
+ void imageChanged(ImageResourceContent*, const IntRect*) override;
+
+ String debugName() const override { return "MockImageResourceClient"; }
+
+ bool notifyFinishedCalled() const override;
+
+ void removeAsClient() override;
+ void dispose() override;
+
+ int imageChangedCount() const { return m_imageChangedCount; }
+ int imageNotifyFinishedCount() const { return m_imageNotifyFinishedCount; }
+
+ size_t encodedSizeOnLastImageChanged() const {
+ return m_encodedSizeOnLastImageChanged;
+ }
+ size_t encodedSizeOnImageNotifyFinished() const {
+ return m_encodedSizeOnImageNotifyFinished;
+ }
+
+ private:
+ int m_imageChangedCount;
+ size_t m_encodedSizeOnLastImageChanged;
+ int m_imageNotifyFinishedCount;
+ size_t m_encodedSizeOnImageNotifyFinished;
+};
+
+} // namespace blink
+
+#endif // MockImageResourceClient_h

Powered by Google App Engine
This is Rietveld 408576698