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

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

Issue 1327653004: Have uses of MockImageResourceClient leak less. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Clean up MockImageResourceClient somewhat Created 5 years, 3 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
« no previous file with comments | « Source/core/fetch/MemoryCacheTest.cpp ('k') | Source/core/fetch/MockImageResourceClient.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/MockImageResourceClient.h
diff --git a/Source/core/fetch/MockImageResourceClient.h b/Source/core/fetch/MockImageResourceClient.h
index 3a472ab923150bf0a608c1d6a9a4b5372028c943..ee643ee6552d1b982378bf918314d0fb8145a492 100644
--- a/Source/core/fetch/MockImageResourceClient.h
+++ b/Source/core/fetch/MockImageResourceClient.h
@@ -33,38 +33,35 @@
#include "core/fetch/ImageResourceClient.h"
-#include <gtest/gtest.h>
-
namespace blink {
+template<typename T> class ResourcePtr;
+
+class Resource;
+
class MockImageResourceClient final : public ImageResourceClient {
public:
- MockImageResourceClient()
- : m_imageChangedCount(0)
- , m_notifyFinishedCalled(false)
- {
- }
+ explicit MockImageResourceClient(const ResourcePtr<Resource>&);
+ ~MockImageResourceClient() override;
- ~MockImageResourceClient() override {}
void imageChanged(ImageResource*, const IntRect*) override
{
m_imageChangedCount++;
}
- void notifyFinished(Resource*) override
- {
- ASSERT_FALSE(m_notifyFinishedCalled);
- m_notifyFinishedCalled = true;
- }
+ void notifyFinished(Resource*) override;
int imageChangedCount() const { return m_imageChangedCount; }
bool notifyFinishedCalled() const { return m_notifyFinishedCalled; }
+ void removeAsClient();
+
private:
+ Resource* m_resource;
int m_imageChangedCount;
bool m_notifyFinishedCalled;
};
} // namespace blink
-#endif // ImageResourceTest_h
+#endif // MockImageResourceClient_h
« no previous file with comments | « Source/core/fetch/MemoryCacheTest.cpp ('k') | Source/core/fetch/MockImageResourceClient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698