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

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 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
« 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..eecb2c080c139bd28ade22a7243cbe3f56d89a07 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,11 @@ class CORE_EXPORT ImageResource final
Member<ImageResourceContent> m_content;
+ // Indicates whether updateImage() is called for this resource, or for this
+ // part (in case of multipart images), and is used for enforcing creation of
+ // new blink::Image in ImageResourceContent for the first updateImage().
+ bool m_isUpdateImageCalled = false;
kouhei (in TOK) 2016/12/19 01:32:04 This flag name is quite confusing, as onePartIn~()
hiroshige 2016/12/27 23:25:31 Done in Patch Set 10.
+
// 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