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

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

Issue 2407573002: Wait to notify completion until after a Lo-Fi image is reloaded. (Closed)
Patch Set: removed unnecessary m_isSchedulingReload check Created 4 years, 2 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 | « third_party/WebKit/Source/core/fetch/MockResourceClients.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1250f13edf777a88ce2c274f82afdb729059055b..bc597055ccb2065913e9e3ca1638d540cc52aeb5 100644
--- a/third_party/WebKit/Source/core/fetch/MockResourceClients.cpp
+++ b/third_party/WebKit/Source/core/fetch/MockResourceClients.cpp
@@ -10,16 +10,19 @@
namespace blink {
MockResourceClient::MockResourceClient(Resource* resource)
- : m_resource(resource), m_notifyFinishedCalled(false) {
+ : m_resource(resource),
+ m_notifyFinishedCalled(false),
+ m_encodedSizeOnNotifyFinished(0) {
ThreadState::current()->registerPreFinalizer(this);
m_resource->addClient(this);
}
MockResourceClient::~MockResourceClient() {}
-void MockResourceClient::notifyFinished(Resource*) {
+void MockResourceClient::notifyFinished(Resource* resource) {
ASSERT_FALSE(m_notifyFinishedCalled);
m_notifyFinishedCalled = true;
+ m_encodedSizeOnNotifyFinished = resource->encodedSize();
}
void MockResourceClient::removeAsClient() {
@@ -42,7 +45,9 @@ DEFINE_TRACE(MockResourceClient) {
MockImageResourceClient::MockImageResourceClient(ImageResource* resource)
: MockResourceClient(resource),
m_imageChangedCount(0),
- m_imageNotifyFinishedCount(0) {
+ m_encodedSizeOnLastImageChanged(0),
+ m_imageNotifyFinishedCount(0),
+ m_encodedSizeOnImageNotifyFinished(0) {
toImageResource(m_resource.get())->addObserver(this);
}
@@ -59,13 +64,16 @@ void MockImageResourceClient::dispose() {
MockResourceClient::dispose();
}
-void MockImageResourceClient::imageChanged(ImageResource*, const IntRect*) {
+void MockImageResourceClient::imageChanged(ImageResource* image,
+ const IntRect*) {
m_imageChangedCount++;
+ m_encodedSizeOnLastImageChanged = image->encodedSize();
}
-void MockImageResourceClient::imageNotifyFinished(ImageResource*) {
+void MockImageResourceClient::imageNotifyFinished(ImageResource* image) {
ASSERT_EQ(0, m_imageNotifyFinishedCount);
m_imageNotifyFinishedCount++;
+ m_encodedSizeOnImageNotifyFinished = image->encodedSize();
}
bool MockImageResourceClient::notifyFinishedCalled() const {
« no previous file with comments | « third_party/WebKit/Source/core/fetch/MockResourceClients.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698