| OLD | NEW |
| 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_process.h" | 5 #include "chromecast/browser/cast_browser_process.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chromecast/browser/cast_browser_context.h" | 8 #include "chromecast/browser/cast_browser_context.h" |
| 9 #include "chromecast/browser/devtools/remote_debugging_server.h" | 9 #include "chromecast/browser/devtools/remote_debugging_server.h" |
| 10 #include "chromecast/browser/metrics/cast_metrics_service_client.h" | 10 #include "chromecast/browser/metrics/cast_metrics_service_client.h" |
| 11 #include "chromecast/browser/service/cast_service.h" | 11 #include "chromecast/browser/service/cast_service.h" |
| 12 | 12 |
| 13 #if defined(OS_ANDROID) | 13 #if defined(OS_ANDROID) |
| 14 #include "components/crash/browser/crash_dump_manager_android.h" | 14 #include "components/crash/browser/crash_dump_manager_android.h" |
| 15 #endif // defined(OS_ANDROID) | 15 #endif // defined(OS_ANDROID) |
| 16 | 16 |
| 17 #if defined(USE_AURA) |
| 18 #include "ui/aura/env.h" |
| 19 #endif |
| 20 |
| 17 namespace chromecast { | 21 namespace chromecast { |
| 18 namespace shell { | 22 namespace shell { |
| 19 | 23 |
| 20 namespace { | 24 namespace { |
| 21 CastBrowserProcess* g_instance = NULL; | 25 CastBrowserProcess* g_instance = NULL; |
| 22 } // namespace | 26 } // namespace |
| 23 | 27 |
| 24 // static | 28 // static |
| 25 CastBrowserProcess* CastBrowserProcess::GetInstance() { | 29 CastBrowserProcess* CastBrowserProcess::GetInstance() { |
| 26 DCHECK(g_instance); | 30 DCHECK(g_instance); |
| 27 return g_instance; | 31 return g_instance; |
| 28 } | 32 } |
| 29 | 33 |
| 30 CastBrowserProcess::CastBrowserProcess() { | 34 CastBrowserProcess::CastBrowserProcess() { |
| 31 DCHECK(!g_instance); | 35 DCHECK(!g_instance); |
| 32 g_instance = this; | 36 g_instance = this; |
| 33 } | 37 } |
| 34 | 38 |
| 35 CastBrowserProcess::~CastBrowserProcess() { | 39 CastBrowserProcess::~CastBrowserProcess() { |
| 36 DCHECK_EQ(g_instance, this); | 40 DCHECK_EQ(g_instance, this); |
| 41 #if defined(USE_AURA) |
| 42 aura::Env::DeleteInstance(); |
| 43 #endif |
| 37 g_instance = NULL; | 44 g_instance = NULL; |
| 38 } | 45 } |
| 39 | 46 |
| 40 void CastBrowserProcess::SetBrowserContext( | 47 void CastBrowserProcess::SetBrowserContext( |
| 41 CastBrowserContext* browser_context) { | 48 CastBrowserContext* browser_context) { |
| 42 DCHECK(!browser_context_); | 49 DCHECK(!browser_context_); |
| 43 browser_context_.reset(browser_context); | 50 browser_context_.reset(browser_context); |
| 44 } | 51 } |
| 45 | 52 |
| 46 void CastBrowserProcess::SetCastService(CastService* cast_service) { | 53 void CastBrowserProcess::SetCastService(CastService* cast_service) { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 63 #if defined(OS_ANDROID) | 70 #if defined(OS_ANDROID) |
| 64 void CastBrowserProcess::SetCrashDumpManager( | 71 void CastBrowserProcess::SetCrashDumpManager( |
| 65 breakpad::CrashDumpManager* crash_dump_manager) { | 72 breakpad::CrashDumpManager* crash_dump_manager) { |
| 66 DCHECK(!crash_dump_manager_); | 73 DCHECK(!crash_dump_manager_); |
| 67 crash_dump_manager_.reset(crash_dump_manager); | 74 crash_dump_manager_.reset(crash_dump_manager); |
| 68 } | 75 } |
| 69 #endif // defined(OS_ANDROID) | 76 #endif // defined(OS_ANDROID) |
| 70 | 77 |
| 71 } // namespace shell | 78 } // namespace shell |
| 72 } // namespace chromecast | 79 } // namespace chromecast |
| OLD | NEW |