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

Unified Diff: third_party/WebKit/Source/core/fetch/MockResourceClients.cpp

Issue 2469873002: [ImageResource 4] Split ImageResource into Resource and Image parts (Closed)
Patch Set: style 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/MockResourceClients.cpp
diff --git a/third_party/WebKit/Source/core/fetch/MockResourceClients.cpp b/third_party/WebKit/Source/core/fetch/MockResourceClients.cpp
index 88a831e92a7dd0dfff33861bc1576999a5b58e69..8c8c86191fc42c194af86a789a1f53146db68323 100644
--- a/third_party/WebKit/Source/core/fetch/MockResourceClients.cpp
+++ b/third_party/WebKit/Source/core/fetch/MockResourceClients.cpp
@@ -5,6 +5,7 @@
#include "core/fetch/MockResourceClients.h"
#include "core/fetch/ImageResource.h"
+#include "core/fetch/ImageResourceContent.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace blink {
@@ -48,32 +49,32 @@ MockImageResourceClient::MockImageResourceClient(ImageResource* resource)
m_encodedSizeOnLastImageChanged(0),
m_imageNotifyFinishedCount(0),
m_encodedSizeOnImageNotifyFinished(0) {
- toImageResource(m_resource.get())->addObserver(this);
+ toImageResource(m_resource)->getContent()->addObserver(this);
}
MockImageResourceClient::~MockImageResourceClient() {}
void MockImageResourceClient::removeAsClient() {
- toImageResource(m_resource.get())->removeObserver(this);
+ toImageResource(m_resource)->getContent()->removeObserver(this);
MockResourceClient::removeAsClient();
}
void MockImageResourceClient::dispose() {
if (m_resource)
- toImageResource(m_resource.get())->removeObserver(this);
+ toImageResource(m_resource)->getContent()->removeObserver(this);
MockResourceClient::dispose();
}
-void MockImageResourceClient::imageChanged(ImageResource* image,
+void MockImageResourceClient::imageChanged(ImageResourceContent* image,
const IntRect*) {
m_imageChangedCount++;
- m_encodedSizeOnLastImageChanged = image->encodedSize();
+ m_encodedSizeOnLastImageChanged = m_resource->encodedSize();
}
-void MockImageResourceClient::imageNotifyFinished(ImageResource* image) {
+void MockImageResourceClient::imageNotifyFinished(ImageResourceContent* image) {
ASSERT_EQ(0, m_imageNotifyFinishedCount);
m_imageNotifyFinishedCount++;
- m_encodedSizeOnImageNotifyFinished = image->encodedSize();
+ m_encodedSizeOnImageNotifyFinished = m_resource->encodedSize();
}
bool MockImageResourceClient::notifyFinishedCalled() const {
« no previous file with comments | « third_party/WebKit/Source/core/fetch/MockResourceClients.h ('k') | third_party/WebKit/Source/core/frame/FrameSerializer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698