Index: Source/core/loader/ThreadableLoaderClientWrapper.h |
diff --git a/Source/core/loader/ThreadableLoaderClientWrapper.h b/Source/core/loader/ThreadableLoaderClientWrapper.h |
index eb3782ecf5b5461f61fd53893bd60fe735a5dd3c..5a57ffb5713c58d56a679ed2195247c0ebb58807 100644 |
--- a/Source/core/loader/ThreadableLoaderClientWrapper.h |
+++ b/Source/core/loader/ThreadableLoaderClientWrapper.h |
@@ -41,6 +41,11 @@ namespace blink { |
class ThreadableLoaderClientWrapper : public ThreadSafeRefCounted<ThreadableLoaderClientWrapper> { |
public: |
+ class ResourceTimingClient { |
+ public: |
+ virtual void didReceiveResourceTiming(const ResourceTimingInfo&) = 0; |
+ }; |
+ |
static PassRefPtr<ThreadableLoaderClientWrapper> create(ThreadableLoaderClient* client) |
{ |
return adoptRef(new ThreadableLoaderClientWrapper(client)); |
@@ -50,6 +55,7 @@ public: |
{ |
m_done = true; |
m_client = 0; |
+ clearResourceTimingClient(); |
} |
bool done() const |
@@ -57,6 +63,16 @@ public: |
return m_done; |
} |
+ void setResourceTimingClient(ResourceTimingClient* client) |
+ { |
+ m_resourceTimingClient = client; |
+ } |
+ |
+ void clearResourceTimingClient() |
+ { |
+ m_resourceTimingClient = nullptr; |
+ } |
+ |
void didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent) |
{ |
if (m_client) |
@@ -124,14 +140,22 @@ public: |
m_client->didDownloadData(dataLength); |
} |
+ void didReceiveResourceTiming(const ResourceTimingInfo& info) |
+ { |
+ if (m_resourceTimingClient) |
+ m_resourceTimingClient->didReceiveResourceTiming(info); |
+ } |
+ |
protected: |
explicit ThreadableLoaderClientWrapper(ThreadableLoaderClient* client) |
: m_client(client) |
+ , m_resourceTimingClient(nullptr) |
, m_done(false) |
{ |
} |
ThreadableLoaderClient* m_client; |
+ ResourceTimingClient* m_resourceTimingClient; |
bool m_done; |
}; |