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

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

Issue 2587503002: Merge clearImage() and clearImageAndNotifyObservers() into updateImage() (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
Index: third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h
diff --git a/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h b/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h
index 8ef0838e179e4cc97762b7f85cdebdcd4341cb87..8d18c4424237690ca5679a420384adcb8e3ed474 100644
--- a/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h
+++ b/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h
@@ -111,13 +111,20 @@ class CORE_EXPORT ImageResourceContent final
// For ImageResource only.
void setImageResourceInfo(ImageResourceInfo*);
- enum ClearImageOption { ClearExistingImage, KeepExistingImage };
+ enum UpdateImageOption {
+ // Updates the image (including placeholder and decode error handling
+ // and notifying observers).
+ UpdateImage,
+
+ // Clears the image and then updates the image.
+ ClearAndUpdateImage,
+
+ // Clears the image and notifies observers only (without updating).
+ ClearImageOnly,
+ };
void updateImage(PassRefPtr<SharedBuffer>,
- ClearImageOption,
+ UpdateImageOption,
bool allDataReceived);
- enum NotifyFinishOption { ShouldNotifyFinish, DoNotNotifyFinish };
- void clearImage();
- void clearImageAndNotifyObservers(NotifyFinishOption);
ResourcePriority priorityFromObservers() const;
void destroyDecodedData();
void doResetAnimation();
@@ -140,6 +147,9 @@ class CORE_EXPORT ImageResourceContent final
void changedInRect(const blink::Image*, const IntRect&) override;
PassRefPtr<Image> createImage();
+ void clearImage();
+
+ enum NotifyFinishOption { ShouldNotifyFinish, DoNotNotifyFinish };
// If not null, changeRect is the changed part of the image.
void notifyObservers(NotifyFinishOption, const IntRect* changeRect = nullptr);

Powered by Google App Engine
This is Rietveld 408576698