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

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: More consistent Client/Observer 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 fb1f31fe4a687103d510adff2a989b614d419429..8ec8b4ecb727f6e3d051a0e5a257ab7861c17382 100644
--- a/third_party/WebKit/Source/core/fetch/Resource.h
+++ b/third_party/WebKit/Source/core/fetch/Resource.h
@@ -132,11 +132,12 @@ public:
void setOptions(const ResourceLoaderOptions& options) { m_options = options; }
void didChangePriority(ResourceLoadPriority, int intraPriorityValue);
- ResourcePriority priorityFromClients();
+ virtual ResourcePriority priorityFromClients() { return ResourcePriority(); }
void addClient(ResourceClient*);
void removeClient(ResourceClient*);
- bool hasClients() const { return !m_clients.isEmpty() || !m_clientsAwaitingCallback.isEmpty() || !m_finishedClients.isEmpty(); }
+ // TODO(hiroshige): ClientsOrObservers
+ virtual bool hasClients() const { return !m_clients.isEmpty() || !m_clientsAwaitingCallback.isEmpty() || !m_finishedClients.isEmpty(); }
hiroshige 2016/02/20 02:00:19 In this CL, hasClients() counts not only ResourceC
enum PreloadResult {
PreloadNotReferenced,
@@ -147,7 +148,11 @@ public:
PreloadResult preloadResult() const { return static_cast<PreloadResult>(m_preloadResult); }
virtual void didAddClient(ResourceClient*);
- virtual void didRemoveClient(ResourceClient*) { }
+
+ // |this| object may be dead after didRemoveClient().
+ // TODO(hiroshige): ClientOrObserver
+ void didRemoveClient();
+ // TODO(hiroshige): ClientsOrObservers
virtual void allClientsRemoved();
unsigned count() const { return m_clients.size(); }
@@ -278,6 +283,9 @@ protected:
void finishPendingClients();
+ // TODO(hiroshige): ClientsOrObservers
+ void willAddClient();
+
HashCountedSet<ResourceClient*> m_clients;
HashCountedSet<ResourceClient*> m_clientsAwaitingCallback;
HashCountedSet<ResourceClient*> m_finishedClients;
« no previous file with comments | « third_party/WebKit/Source/core/fetch/RawResourceTest.cpp ('k') | third_party/WebKit/Source/core/fetch/Resource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698