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

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

Issue 1327723002: [Chromecast] Raises CastService creation to CastContentBrowserClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 5 years, 3 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
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_content_browser_client.h"
28 #include "chromecast/browser/cast_net_log.h" 29 #include "chromecast/browser/cast_net_log.h"
29 #include "chromecast/browser/devtools/remote_debugging_server.h" 30 #include "chromecast/browser/devtools/remote_debugging_server.h"
30 #include "chromecast/browser/metrics/cast_metrics_prefs.h" 31 #include "chromecast/browser/metrics/cast_metrics_prefs.h"
31 #include "chromecast/browser/metrics/cast_metrics_service_client.h" 32 #include "chromecast/browser/metrics/cast_metrics_service_client.h"
32 #include "chromecast/browser/pref_service_helper.h" 33 #include "chromecast/browser/pref_service_helper.h"
33 #include "chromecast/browser/service/cast_service.h" 34 #include "chromecast/browser/service/cast_service.h"
34 #include "chromecast/browser/url_request_context_factory.h" 35 #include "chromecast/browser/url_request_context_factory.h"
35 #include "chromecast/common/platform_client_auth.h" 36 #include "chromecast/common/platform_client_auth.h"
36 #include "chromecast/media/base/key_systems_common.h" 37 #include "chromecast/media/base/key_systems_common.h"
37 #include "chromecast/media/base/media_message_loop.h" 38 #include "chromecast/media/base/media_message_loop.h"
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 LOG(ERROR) << "PlatformClientAuth::Initialize failed."; 328 LOG(ERROR) << "PlatformClientAuth::Initialize failed.";
328 329
329 cast_browser_process_->SetRemoteDebuggingServer( 330 cast_browser_process_->SetRemoteDebuggingServer(
330 make_scoped_ptr(new RemoteDebuggingServer())); 331 make_scoped_ptr(new RemoteDebuggingServer()));
331 332
332 media::MediaMessageLoop::GetTaskRunner()->PostTask( 333 media::MediaMessageLoop::GetTaskRunner()->PostTask(
333 FROM_HERE, 334 FROM_HERE,
334 base::Bind(&media::CastMediaShlib::Initialize, cmd_line->argv())); 335 base::Bind(&media::CastMediaShlib::Initialize, cmd_line->argv()));
335 ::media::InitializeMediaLibrary(); 336 ::media::InitializeMediaLibrary();
336 337
337 cast_browser_process_->SetCastService(CastService::Create( 338 cast_browser_process_->SetCastService(
338 cast_browser_process_->browser_context(), 339 cast_browser_process_->browser_client()->CreateCastService(
339 cast_browser_process_->pref_service(), 340 cast_browser_process_->browser_context(),
340 cast_browser_process_->metrics_service_client(), 341 cast_browser_process_->pref_service(),
byungchul 2015/09/01 23:18:01 Remove only metrics service client because others
gunsch 2015/09/01 23:42:49 Hmm, good question. I'd like to eventually elimina
341 url_request_context_factory_->GetSystemGetter())); 342 url_request_context_factory_->GetSystemGetter()));
342 cast_browser_process_->cast_service()->Initialize(); 343 cast_browser_process_->cast_service()->Initialize();
343 344
344 // Initializing metrics service and network delegates must happen after cast 345 // Initializing metrics service and network delegates must happen after cast
345 // service is intialized because CastMetricsServiceClient and 346 // service is intialized because CastMetricsServiceClient and
346 // CastNetworkDelegate may use components initialized by cast service. 347 // CastNetworkDelegate may use components initialized by cast service.
347 cast_browser_process_->metrics_service_client() 348 cast_browser_process_->metrics_service_client()
348 ->Initialize(cast_browser_process_->cast_service()); 349 ->Initialize(cast_browser_process_->cast_service());
349 url_request_context_factory_->InitializeNetworkDelegates(); 350 url_request_context_factory_->InitializeNetworkDelegates();
350 351
351 cast_browser_process_->cast_service()->Start(); 352 cast_browser_process_->cast_service()->Start();
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 #if defined(USE_AURA) 394 #if defined(USE_AURA)
394 aura::Env::DeleteInstance(); 395 aura::Env::DeleteInstance();
395 #endif 396 #endif
396 397
397 DeregisterKillOnAlarm(); 398 DeregisterKillOnAlarm();
398 #endif 399 #endif
399 } 400 }
400 401
401 } // namespace shell 402 } // namespace shell
402 } // namespace chromecast 403 } // namespace chromecast
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698