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/browser/cast_browser_process.h"
7 #include "base/logging.h"
8 #include "chromecast/base/metrics/cast_metrics_helper.h"
9 #include "chromecast/browser/cast_browser_context.h"
10 #include "chromecast/browser/devtools/remote_debugging_server.h"
11 #include "chromecast/browser/metrics/cast_metrics_service_client.h"
12 #include "chromecast/browser/service/cast_service.h"
14 #if defined(OS_ANDROID)
15 #include "components/crash/browser/crash_dump_manager_android.h"
16 #endif // defined(OS_ANDROID)
19 #include "ui/aura/env.h"
22 namespace chromecast
{
26 CastBrowserProcess
* g_instance
= NULL
;
30 CastBrowserProcess
* CastBrowserProcess::GetInstance() {
35 CastBrowserProcess::CastBrowserProcess() {
40 CastBrowserProcess::~CastBrowserProcess() {
41 DCHECK_EQ(g_instance
, this);
43 aura::Env::DeleteInstance();
48 void CastBrowserProcess::SetBrowserContext(
49 CastBrowserContext
* browser_context
) {
50 DCHECK(!browser_context_
);
51 browser_context_
.reset(browser_context
);
54 void CastBrowserProcess::SetCastService(CastService
* cast_service
) {
55 DCHECK(!cast_service_
);
56 cast_service_
.reset(cast_service
);
59 void CastBrowserProcess::SetRemoteDebuggingServer(
60 RemoteDebuggingServer
* remote_debugging_server
) {
61 DCHECK(!remote_debugging_server_
);
62 remote_debugging_server_
.reset(remote_debugging_server
);
65 void CastBrowserProcess::SetMetricsHelper(
66 metrics::CastMetricsHelper
* metrics_helper
) {
67 DCHECK(!metrics_helper_
);
68 metrics_helper_
.reset(metrics_helper
);
71 void CastBrowserProcess::SetMetricsServiceClient(
72 metrics::CastMetricsServiceClient
* metrics_service_client
) {
73 DCHECK(!metrics_service_client_
);
74 metrics_service_client_
.reset(metrics_service_client
);
77 #if defined(OS_ANDROID)
78 void CastBrowserProcess::SetCrashDumpManager(
79 breakpad::CrashDumpManager
* crash_dump_manager
) {
80 DCHECK(!crash_dump_manager_
);
81 crash_dump_manager_
.reset(crash_dump_manager
);
83 #endif // defined(OS_ANDROID)
86 } // namespace chromecast