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

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

Issue 2552653002: Explicitly clear the image in the first updateImage() call (Closed)
Patch Set: Rebase 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/resource/ImageResource.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/loader/resource/ImageResource.h
diff --git a/third_party/WebKit/Source/core/loader/resource/ImageResource.h b/third_party/WebKit/Source/core/loader/resource/ImageResource.h
index 3872761ac4bf6f0448d118f47e8bff1a1a5c7a16..4e6fcede77f530b6511ca1791a6f91ba16096581 100644
--- a/third_party/WebKit/Source/core/loader/resource/ImageResource.h
+++ b/third_party/WebKit/Source/core/loader/resource/ImageResource.h
@@ -25,6 +25,7 @@
#include "core/CoreExport.h"
#include "core/fetch/Resource.h"
+#include "core/loader/resource/ImageResourceContent.h"
#include "core/loader/resource/ImageResourceInfo.h"
#include "core/loader/resource/MultipartImageResourceParser.h"
#include "platform/Timer.h"
@@ -129,6 +130,12 @@ class CORE_EXPORT ImageResource final
void destroyDecodedDataIfPossible() override;
void destroyDecodedDataForFailedRevalidation() override;
+ // When UpdateImageOption is UpdateImage but this is the first
+ // updateImage() call, then ClearAndUpdateImage is used instead to enforce
+ // new image creation.
+ void updateImage(PassRefPtr<SharedBuffer>,
+ ImageResourceContent::UpdateImageOption,
+ bool allDataReceived);
void flushImageIfNeeded(TimerBase*);
bool shouldReloadBrokenPlaceholder() const {
@@ -139,6 +146,10 @@ class CORE_EXPORT ImageResource final
Member<ImageResourceContent> m_content;
+ // Indicates we should clear the image (and then create a new image) in the
+ // next updateImage() call.
+ bool m_shouldEnforceClearImage = true;
+
// TODO(hiroshige): move |m_devicePixelRatioHeaderValue| and
// |m_hasDevicePixelRatioHeaderValue| to ImageResourceContent and update
// it via ImageResourceContent::updateImage().
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/resource/ImageResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698