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 de7f4d70cc27b8cf8f3512838623d5e1cff7cd3a..351b78d568cf96e97c5a9b1b4ef020587018564d 100644 |
--- a/third_party/WebKit/Source/core/fetch/Resource.h |
+++ b/third_party/WebKit/Source/core/fetch/Resource.h |
@@ -127,11 +127,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, |
@@ -142,8 +142,10 @@ public: |
PreloadResult getPreloadResult() const { return static_cast<PreloadResult>(m_preloadResult); } |
virtual void didAddClient(ResourceClient*); |
yhirano
2016/03/17 04:44:57
I think placing these two functions and willAddCli
hiroshige
2016/03/23 18:47:25
Done. Also make them protected.
|
- virtual void didRemoveClient(ResourceClient*) { } |
- virtual void allClientsRemoved(); |
+ |
+ // |this| object may be dead after didRemoveClientOrObserver(). |
+ void didRemoveClientOrObserver(); |
+ virtual void allClientsAndObserversRemoved(); |
unsigned count() const { return m_clients.size(); } |
@@ -267,6 +269,8 @@ protected: |
void finishPendingClients(); |
+ void willAddClientOrObserver(); |
+ |
HashCountedSet<ResourceClient*> m_clients; |
HashCountedSet<ResourceClient*> m_clientsAwaitingCallback; |
HashCountedSet<ResourceClient*> m_finishedClients; |