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
3 // found in the LICENSE file.
5 #include "chromecast/shell/browser/cast_browser_process.h"
7 #include "base/logging.h"
8 #include "chromecast/metrics/cast_metrics_service_client.h"
9 #include "chromecast/service/cast_service.h"
10 #include "chromecast/shell/browser/cast_browser_context.h"
11 #include "chromecast/shell/browser/devtools/remote_debugging_server.h"
13 namespace chromecast {
17 CastBrowserProcess* g_instance = NULL;
21 CastBrowserProcess* CastBrowserProcess::GetInstance() {
26 CastBrowserProcess::CastBrowserProcess() {
31 CastBrowserProcess::~CastBrowserProcess() {
32 DCHECK_EQ(g_instance, this);
36 void CastBrowserProcess::SetBrowserContext(
37 CastBrowserContext* browser_context) {
38 DCHECK(!browser_context_);
39 browser_context_.reset(browser_context);
42 void CastBrowserProcess::SetCastService(CastService* cast_service) {
43 DCHECK(!cast_service_);
44 cast_service_.reset(cast_service);
47 void CastBrowserProcess::SetRemoteDebuggingServer(
48 RemoteDebuggingServer* remote_debugging_server) {
49 DCHECK(!remote_debugging_server_);
50 remote_debugging_server_.reset(remote_debugging_server);
53 void CastBrowserProcess::SetMetricsServiceClient(
54 metrics::CastMetricsServiceClient* metrics_service_client) {
55 DCHECK(!metrics_service_client_);
56 metrics_service_client_.reset(metrics_service_client);
60 } // namespace chromecast