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

Unified Diff: third_party/WebKit/Source/core/fetch/MockImageResourceClient.h

Issue 2559703002: Loading: split MockResourceClients into multiple files type by type (Closed)
Patch Set: [rebase to trunk] Created 4 years 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/fetch/MockImageResourceClient.h
diff --git a/third_party/WebKit/Source/core/fetch/MockImageResourceClient.h b/third_party/WebKit/Source/core/fetch/MockImageResourceClient.h
new file mode 100644
index 0000000000000000000000000000000000000000..ecbfb8af379daad75b03cd997bf071735a5ffa7a
--- /dev/null
+++ b/third_party/WebKit/Source/core/fetch/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/fetch/ImageResource.h"
+#include "core/fetch/ImageResourceContent.h"
+#include "core/fetch/ImageResourceObserver.h"
+#include "core/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