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

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

Issue 1728313003: Split ImageResourceClient into ResourceClient and ImageResourceObserver [2/2] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit refine. Created 4 years, 10 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
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 e085120358f1d814ad63137b00984ff5f7035b2f..3ba4f1b8a8997145afeb92f8f3e317de1440f55e 100644
--- a/third_party/WebKit/Source/core/fetch/ImageResource.h
+++ b/third_party/WebKit/Source/core/fetch/ImageResource.h
@@ -38,7 +38,6 @@ namespace blink {
class FetchRequest;
class FloatSize;
class ImageResourceObserver;
-class Length;
class MemoryCache;
class ResourceClient;
class ResourceFetcher;
@@ -102,7 +101,7 @@ public:
void addObserver(ImageResourceObserver*);
void removeObserver(ImageResourceObserver*);
- bool hasClientsOrObservers() const override { return Resource::hasClientsOrObservers() || !m_observers.isEmpty(); }
+ bool hasClientsOrObservers() const override { return Resource::hasClientsOrObservers() || !m_observers.isEmpty() || !m_finishedObservers.isEmpty(); }
ResourcePriority priorityFromObservers() override;
@@ -161,7 +160,8 @@ private:
void updateImage(bool allDataReceived);
void clearImage();
// If not null, changeRect is the changed part of the image.
- void notifyObservers(const IntRect* changeRect = nullptr);
+ void notifyObservers(bool isNotifyingFinish, const IntRect* changeRect = nullptr);
+ void notifyObserver(ImageResourceObserver*, bool isNotifyingFinish, const IntRect* changeRect = nullptr);
float m_devicePixelRatioHeaderValue;
@@ -169,6 +169,7 @@ private:
RefPtr<blink::Image> m_image;
bool m_hasDevicePixelRatioHeaderValue;
HashCountedSet<ImageResourceObserver*> m_observers;
+ HashCountedSet<ImageResourceObserver*> m_finishedObservers;
};
DEFINE_RESOURCE_TYPE_CASTS(Image);

Powered by Google App Engine
This is Rietveld 408576698