Chromecast: adds crash handling for Android build.
[chromium-blink-merge.git] / chromecast / shell / browser / cast_browser_process.cc
blobf89e6956ae7970f4919a94875528075e878deaa8
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 #if defined(OS_ANDROID)
14 #include "components/crash/browser/crash_dump_manager_android.h"
15 #endif // defined(OS_ANDROID)
17 namespace chromecast {
18 namespace shell {
20 namespace {
21 CastBrowserProcess* g_instance = NULL;
22 } // namespace
24 // static
25 CastBrowserProcess* CastBrowserProcess::GetInstance() {
26 DCHECK(g_instance);
27 return g_instance;
30 CastBrowserProcess::CastBrowserProcess() {
31 DCHECK(!g_instance);
32 g_instance = this;
35 CastBrowserProcess::~CastBrowserProcess() {
36 DCHECK_EQ(g_instance, this);
37 g_instance = NULL;
40 void CastBrowserProcess::SetBrowserContext(
41 CastBrowserContext* browser_context) {
42 DCHECK(!browser_context_);
43 browser_context_.reset(browser_context);
46 void CastBrowserProcess::SetCastService(CastService* cast_service) {
47 DCHECK(!cast_service_);
48 cast_service_.reset(cast_service);
51 void CastBrowserProcess::SetRemoteDebuggingServer(
52 RemoteDebuggingServer* remote_debugging_server) {
53 DCHECK(!remote_debugging_server_);
54 remote_debugging_server_.reset(remote_debugging_server);
57 void CastBrowserProcess::SetMetricsServiceClient(
58 metrics::CastMetricsServiceClient* metrics_service_client) {
59 DCHECK(!metrics_service_client_);
60 metrics_service_client_.reset(metrics_service_client);
63 #if defined(OS_ANDROID)
64 void CastBrowserProcess::SetCrashDumpManager(
65 breakpad::CrashDumpManager* crash_dump_manager) {
66 DCHECK(!crash_dump_manager_);
67 crash_dump_manager_.reset(crash_dump_manager);
69 #endif // defined(OS_ANDROID)
71 } // namespace shell
72 } // namespace chromecast