Index: content/browser/loader/netlog_observer.h |
diff --git a/content/browser/loader/netlog_observer.h b/content/browser/loader/netlog_observer.h |
index 330a502e50afd7643ac8a5acb1e2d22f858d3c59..33a83807d1c684033a198773ede9449bdb6f3494 100644 |
--- a/content/browser/loader/netlog_observer.h |
+++ b/content/browser/loader/netlog_observer.h |
@@ -8,8 +8,10 @@ |
#include <stdint.h> |
#include "base/containers/hash_tables.h" |
+#include "base/lazy_instance.h" |
#include "base/macros.h" |
#include "base/memory/ref_counted.h" |
+#include "base/single_thread_task_runner.h" |
#include "content/public/common/resource_devtools_info.h" |
#include "net/log/net_log.h" |
@@ -34,9 +36,13 @@ class NetLogObserver : public net::NetLog::ThreadSafeObserver { |
// net::NetLog::ThreadSafeObserver implementation: |
void OnAddEntry(const net::NetLog::Entry& entry) override; |
- void OnAddURLRequestEntry(const net::NetLog::Entry& entry); |
+ // The NetLog instance is passed in via the |net_log| parameter. |
+ // A reference to the IO thread task runner is passed via the |
+ // |io_thread_runner| parameter. |
+ static void Attach( |
+ net::NetLog* net_log, |
+ scoped_refptr<base::SingleThreadTaskRunner> io_thread_runner); |
- static void Attach(); |
static void Detach(); |
// Must be called on the IO thread. May return NULL if no observers |
@@ -52,10 +58,16 @@ class NetLogObserver : public net::NetLog::ThreadSafeObserver { |
ResourceInfo* GetResourceInfo(uint32_t id); |
+ void OnAddURLRequestEntry(const net::NetLog::Entry& entry); |
+ |
typedef base::hash_map<uint32_t, scoped_refptr<ResourceInfo>> |
RequestToInfoMap; |
RequestToInfoMap request_to_info_; |
+ // Contains the IO thread task runner instance. |
+ static base::LazyInstance<scoped_refptr<base::SingleThreadTaskRunner>>::Leaky |
+ io_thread_task_runner_; |
+ |
DISALLOW_COPY_AND_ASSIGN(NetLogObserver); |
}; |