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

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

Issue 1706083002: Split ImageResourceClient into ResourceClient and ImageResourceObserver [1/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/Resource.h
diff --git a/third_party/WebKit/Source/core/fetch/Resource.h b/third_party/WebKit/Source/core/fetch/Resource.h
index 1bea4ff2585c02ea93c8989744f9e5054adca8d8..ab9230de3214e5408f52f0060ab3e7dae252a020 100644
--- a/third_party/WebKit/Source/core/fetch/Resource.h
+++ b/third_party/WebKit/Source/core/fetch/Resource.h
@@ -132,11 +132,11 @@ public:
void setOptions(const ResourceLoaderOptions& options) { m_options = options; }
void didChangePriority(ResourceLoadPriority, int intraPriorityValue);
- ResourcePriority priorityFromClients();
+ virtual ResourcePriority priorityFromObservers() { return ResourcePriority(); }
void addClient(ResourceClient*);
void removeClient(ResourceClient*);
- bool hasClients() const { return !m_clients.isEmpty() || !m_clientsAwaitingCallback.isEmpty() || !m_finishedClients.isEmpty(); }
+ virtual bool hasClientsOrObservers() const { return !m_clients.isEmpty() || !m_clientsAwaitingCallback.isEmpty() || !m_finishedClients.isEmpty(); }
enum PreloadResult {
PreloadNotReferenced,
@@ -147,8 +147,10 @@ public:
PreloadResult getPreloadResult() const { return static_cast<PreloadResult>(m_preloadResult); }
virtual void didAddClient(ResourceClient*);
- virtual void didRemoveClient(ResourceClient*) { }
- virtual void allClientsRemoved();
+
+ // |this| object may be dead after didRemoveClient().
yhirano 2016/03/02 01:20:52 didRemoveClientOrObserver
hiroshige 2016/03/12 01:03:36 Done.
+ void didRemoveClientOrObserver();
+ virtual void allClientsAndObserversRemoved();
unsigned count() const { return m_clients.size(); }
@@ -279,6 +281,8 @@ protected:
void finishPendingClients();
+ void willAddClientOrObserver();
+
HashCountedSet<ResourceClient*> m_clients;
HashCountedSet<ResourceClient*> m_clientsAwaitingCallback;
HashCountedSet<ResourceClient*> m_finishedClients;

Powered by Google App Engine
This is Rietveld 408576698