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

Side by Side Diff: chromecast/browser/cast_browser_main_parts.cc

Issue 1216443002: [Chromecast] Add net logging. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « chromecast/browser/cast_browser_main_parts.h ('k') | chromecast/browser/cast_net_log.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chromecast/browser/cast_browser_main_parts.h" 5 #include "chromecast/browser/cast_browser_main_parts.h"
6 6
7 #include <string> 7 #include <string>
8 #if !defined(OS_ANDROID) 8 #if !defined(OS_ANDROID)
9 #include <signal.h> 9 #include <signal.h>
10 #include <sys/prctl.h> 10 #include <sys/prctl.h>
11 #endif 11 #endif
12 12
13 #include "base/command_line.h" 13 #include "base/command_line.h"
14 #include "base/files/file_util.h" 14 #include "base/files/file_util.h"
15 #include "base/message_loop/message_loop.h" 15 #include "base/message_loop/message_loop.h"
16 #include "base/path_service.h" 16 #include "base/path_service.h"
17 #include "base/prefs/pref_registry_simple.h" 17 #include "base/prefs/pref_registry_simple.h"
18 #include "base/run_loop.h" 18 #include "base/run_loop.h"
19 #include "base/thread_task_runner_handle.h" 19 #include "base/thread_task_runner_handle.h"
20 #include "cc/base/switches.h" 20 #include "cc/base/switches.h"
21 #include "chromecast/base/cast_paths.h" 21 #include "chromecast/base/cast_paths.h"
22 #include "chromecast/base/cast_sys_info_util.h" 22 #include "chromecast/base/cast_sys_info_util.h"
23 #include "chromecast/base/chromecast_switches.h" 23 #include "chromecast/base/chromecast_switches.h"
24 #include "chromecast/base/metrics/cast_metrics_helper.h" 24 #include "chromecast/base/metrics/cast_metrics_helper.h"
25 #include "chromecast/base/metrics/grouped_histogram.h" 25 #include "chromecast/base/metrics/grouped_histogram.h"
26 #include "chromecast/browser/cast_browser_context.h" 26 #include "chromecast/browser/cast_browser_context.h"
27 #include "chromecast/browser/cast_browser_process.h" 27 #include "chromecast/browser/cast_browser_process.h"
28 #include "chromecast/browser/cast_net_log.h"
28 #include "chromecast/browser/devtools/remote_debugging_server.h" 29 #include "chromecast/browser/devtools/remote_debugging_server.h"
29 #include "chromecast/browser/metrics/cast_metrics_prefs.h" 30 #include "chromecast/browser/metrics/cast_metrics_prefs.h"
30 #include "chromecast/browser/metrics/cast_metrics_service_client.h" 31 #include "chromecast/browser/metrics/cast_metrics_service_client.h"
31 #include "chromecast/browser/pref_service_helper.h" 32 #include "chromecast/browser/pref_service_helper.h"
32 #include "chromecast/browser/service/cast_service.h" 33 #include "chromecast/browser/service/cast_service.h"
33 #include "chromecast/browser/url_request_context_factory.h" 34 #include "chromecast/browser/url_request_context_factory.h"
34 #include "chromecast/common/platform_client_auth.h" 35 #include "chromecast/common/platform_client_auth.h"
35 #include "chromecast/media/base/key_systems_common.h" 36 #include "chromecast/media/base/key_systems_common.h"
36 #include "chromecast/net/connectivity_checker.h" 37 #include "chromecast/net/connectivity_checker.h"
37 #include "chromecast/public/cast_media_shlib.h" 38 #include "chromecast/public/cast_media_shlib.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 } // namespace 203 } // namespace
203 204
204 CastBrowserMainParts::CastBrowserMainParts( 205 CastBrowserMainParts::CastBrowserMainParts(
205 const content::MainFunctionParams& parameters, 206 const content::MainFunctionParams& parameters,
206 URLRequestContextFactory* url_request_context_factory, 207 URLRequestContextFactory* url_request_context_factory,
207 scoped_ptr<::media::AudioManagerFactory> audio_manager_factory) 208 scoped_ptr<::media::AudioManagerFactory> audio_manager_factory)
208 : BrowserMainParts(), 209 : BrowserMainParts(),
209 cast_browser_process_(new CastBrowserProcess()), 210 cast_browser_process_(new CastBrowserProcess()),
210 parameters_(parameters), 211 parameters_(parameters),
211 url_request_context_factory_(url_request_context_factory), 212 url_request_context_factory_(url_request_context_factory),
212 audio_manager_factory_(audio_manager_factory.Pass()) { 213 audio_manager_factory_(audio_manager_factory.Pass()),
214 net_log_(new CastNetLog()) {
213 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 215 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
214 AddDefaultCommandLineSwitches(command_line); 216 AddDefaultCommandLineSwitches(command_line);
215 } 217 }
216 218
217 CastBrowserMainParts::~CastBrowserMainParts() { 219 CastBrowserMainParts::~CastBrowserMainParts() {
218 } 220 }
219 221
220 void CastBrowserMainParts::PreMainMessageLoopStart() { 222 void CastBrowserMainParts::PreMainMessageLoopStart() {
221 // GroupedHistograms needs to be initialized before any threads are created 223 // GroupedHistograms needs to be initialized before any threads are created
222 // to prevent race conditions between calls to Preregister and those threads 224 // to prevent race conditions between calls to Preregister and those threads
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 #else 300 #else
299 if (cmd_line->HasSwitch(switches::kEnableCmaMediaPipeline)) 301 if (cmd_line->HasSwitch(switches::kEnableCmaMediaPipeline))
300 ::media::SetBrowserCdmFactory(new media::CastBrowserCdmFactory()); 302 ::media::SetBrowserCdmFactory(new media::CastBrowserCdmFactory());
301 #endif // defined(OS_ANDROID) 303 #endif // defined(OS_ANDROID)
302 304
303 cast_browser_process_->SetConnectivityChecker( 305 cast_browser_process_->SetConnectivityChecker(
304 ConnectivityChecker::Create( 306 ConnectivityChecker::Create(
305 content::BrowserThread::GetMessageLoopProxyForThread( 307 content::BrowserThread::GetMessageLoopProxyForThread(
306 content::BrowserThread::IO))); 308 content::BrowserThread::IO)));
307 309
308 url_request_context_factory_->InitializeOnUIThread(); 310 url_request_context_factory_->InitializeOnUIThread(net_log_.get());
309 311
310 cast_browser_process_->SetBrowserContext( 312 cast_browser_process_->SetBrowserContext(
311 make_scoped_ptr(new CastBrowserContext(url_request_context_factory_))); 313 make_scoped_ptr(new CastBrowserContext(url_request_context_factory_)));
312 cast_browser_process_->SetMetricsServiceClient( 314 cast_browser_process_->SetMetricsServiceClient(
313 metrics::CastMetricsServiceClient::Create( 315 metrics::CastMetricsServiceClient::Create(
314 content::BrowserThread::GetBlockingPool(), 316 content::BrowserThread::GetBlockingPool(),
315 cast_browser_process_->pref_service(), 317 cast_browser_process_->pref_service(),
316 cast_browser_process_->browser_context()->GetRequestContext())); 318 cast_browser_process_->browser_context()->GetRequestContext()));
317 319
318 if (!PlatformClientAuth::Initialize()) 320 if (!PlatformClientAuth::Initialize())
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 #endif 387 #endif
386 388
387 DeregisterKillOnAlarm(); 389 DeregisterKillOnAlarm();
388 #endif 390 #endif
389 391
390 media::CastMediaShlib::Finalize(); 392 media::CastMediaShlib::Finalize();
391 } 393 }
392 394
393 } // namespace shell 395 } // namespace shell
394 } // namespace chromecast 396 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/browser/cast_browser_main_parts.h ('k') | chromecast/browser/cast_net_log.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698