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

Unified Diff: third_party/WebKit/Source/core/fetch/ImageResource.h

Issue 2552653002: Explicitly clear the image in the first updateImage() call (Closed)
Patch Set: 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/fetch/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/fetch/ImageResource.h
diff --git a/third_party/WebKit/Source/core/fetch/ImageResource.h b/third_party/WebKit/Source/core/fetch/ImageResource.h
index f28b46eea73b69e73c84c22c601f033610d89870..152777e57229f666d6fda7066f26041a661f0bf7 100644
--- a/third_party/WebKit/Source/core/fetch/ImageResource.h
+++ b/third_party/WebKit/Source/core/fetch/ImageResource.h
@@ -24,6 +24,7 @@
#define ImageResource_h
#include "core/CoreExport.h"
+#include "core/fetch/ImageResourceContent.h"
hajimehoshi 2016/12/06 07:26:00 I couldn't find this file.
#include "core/fetch/MultipartImageResourceParser.h"
#include "core/fetch/Resource.h"
#include <memory>
@@ -34,7 +35,6 @@ class FetchRequest;
class ResourceClient;
class ResourceFetcher;
class SecurityOrigin;
-class ImageResourceContent;
// ImageResource is the resource-related part of image loading.
// Image-related things (blink::Image and ImageResourceObserver) are handled by
@@ -135,12 +135,23 @@ class CORE_EXPORT ImageResource final
void destroyDecodedDataIfPossible() override;
void destroyDecodedDataForFailedRevalidation() override;
+ // When ClearImageOption is KeepExistingImage but this is the first
+ // updateImage() call, then ClearExistingImage is used instead to enforce
+ // new image creation.
+ void updateImage(PassRefPtr<SharedBuffer>,
+ ImageResourceContent::ClearImageOption,
+ bool allDataReceived);
void flushImageIfNeeded(TimerBase*);
bool willPaintBrokenImage() const;
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;
+
float m_devicePixelRatioHeaderValue;
Member<MultipartImageResourceParser> m_multipartParser;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/fetch/ImageResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698