diff options
author | derekjchow <derekjchow@chromium.org> | 2015-07-09 11:39:53 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-09 18:40:52 +0000 |
commit | 4a2ab5de340d829280352eaf96ff476123c1245d (patch) | |
tree | d3186717715052e5f47899a02456a4df3a75c7f2 | |
parent | 55c7ca9a478748365dd805e27c2e1c3eed41a378 (diff) | |
download | chromium_src-4a2ab5de340d829280352eaf96ff476123c1245d.zip chromium_src-4a2ab5de340d829280352eaf96ff476123c1245d.tar.gz chromium_src-4a2ab5de340d829280352eaf96ff476123c1245d.tar.bz2 |
Add NetLog to CastBrowserProcess.
Makes it easier for internal net components to access NetLog.
BUG=internal b/21616650
R=gunsch@chromium.org
Review URL: https://codereview.chromium.org/1226203006
Cr-Commit-Position: refs/heads/master@{#338095}
-rw-r--r-- | chromecast/browser/cast_browser_main_parts.cc | 2 | ||||
-rw-r--r-- | chromecast/browser/cast_browser_process.cc | 8 | ||||
-rw-r--r-- | chromecast/browser/cast_browser_process.h | 8 |
3 files changed, 17 insertions, 1 deletions
diff --git a/chromecast/browser/cast_browser_main_parts.cc b/chromecast/browser/cast_browser_main_parts.cc index bef558f9..5e0a879 100644 --- a/chromecast/browser/cast_browser_main_parts.cc +++ b/chromecast/browser/cast_browser_main_parts.cc @@ -310,6 +310,8 @@ void CastBrowserMainParts::PreMainMessageLoopRun() { content::BrowserThread::GetMessageLoopProxyForThread( content::BrowserThread::IO))); + cast_browser_process_->SetNetLog(net_log_.get()); + url_request_context_factory_->InitializeOnUIThread(net_log_.get()); cast_browser_process_->SetBrowserContext( diff --git a/chromecast/browser/cast_browser_process.cc b/chromecast/browser/cast_browser_process.cc index 1a67bef..d3cfbfa 100644 --- a/chromecast/browser/cast_browser_process.cc +++ b/chromecast/browser/cast_browser_process.cc @@ -35,7 +35,8 @@ CastBrowserProcess* CastBrowserProcess::GetInstance() { return g_instance; } -CastBrowserProcess::CastBrowserProcess() { +CastBrowserProcess::CastBrowserProcess() + : net_log_(nullptr) { DCHECK(!g_instance); g_instance = this; } @@ -108,5 +109,10 @@ void CastBrowserProcess::SetConnectivityChecker( connectivity_checker_.swap(connectivity_checker); } +void CastBrowserProcess::SetNetLog(net::NetLog* net_log) { + DCHECK(!net_log_); + net_log_ = net_log; +} + } // namespace shell } // namespace chromecast diff --git a/chromecast/browser/cast_browser_process.h b/chromecast/browser/cast_browser_process.h index c63724d..2af917a 100644 --- a/chromecast/browser/cast_browser_process.h +++ b/chromecast/browser/cast_browser_process.h @@ -15,6 +15,10 @@ namespace breakpad { class CrashDumpManager; } // namespace breakpad +namespace net { +class NetLog; +} // namespace net + namespace chromecast { class CastService; class CastScreen; @@ -58,6 +62,7 @@ class CastBrowserProcess { #endif // defined(OS_ANDROID) void SetConnectivityChecker( scoped_refptr<ConnectivityChecker> connectivity_checker); + void SetNetLog(net::NetLog* net_log); CastBrowserContext* browser_context() const { return browser_context_.get(); } CastService* cast_service() const { return cast_service_.get(); } @@ -75,6 +80,7 @@ class CastBrowserProcess { ConnectivityChecker* connectivity_checker() const { return connectivity_checker_.get(); } + net::NetLog* net_log() const { return net_log_; } private: // Note: The following order should match the order they are set in @@ -94,6 +100,8 @@ class CastBrowserProcess { #endif // defined(OS_ANDROID) scoped_ptr<RemoteDebuggingServer> remote_debugging_server_; + net::NetLog* net_log_; + // Note: CastService must be destroyed before others. scoped_ptr<CastService> cast_service_; |