| 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 #ifndef CHROMECAST_BROWSER_CAST_BROWSER_PROCESS_H_ | 5 #ifndef CHROMECAST_BROWSER_CAST_BROWSER_PROCESS_H_ |
| 6 #define CHROMECAST_BROWSER_CAST_BROWSER_PROCESS_H_ | 6 #define CHROMECAST_BROWSER_CAST_BROWSER_PROCESS_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 10 | 11 |
| 11 class PrefService; | 12 class PrefService; |
| 12 | 13 |
| 13 namespace breakpad { | 14 namespace breakpad { |
| 14 class CrashDumpManager; | 15 class CrashDumpManager; |
| 15 } // namespace breakpad | 16 } // namespace breakpad |
| 16 | 17 |
| 17 namespace chromecast { | 18 namespace chromecast { |
| 18 class CastService; | 19 class CastService; |
| 19 class WebCryptoServer; | 20 class ConnectivityChecker; |
| 20 | 21 |
| 21 namespace metrics { | 22 namespace metrics { |
| 22 class CastMetricsHelper; | 23 class CastMetricsHelper; |
| 23 class CastMetricsServiceClient; | 24 class CastMetricsServiceClient; |
| 24 } // namespace metrics | 25 } // namespace metrics |
| 25 | 26 |
| 26 namespace shell { | 27 namespace shell { |
| 27 class CastBrowserContext; | 28 class CastBrowserContext; |
| 29 class CastResourceDispatcherHostDelegate; |
| 28 class RemoteDebuggingServer; | 30 class RemoteDebuggingServer; |
| 29 | 31 |
| 30 class CastBrowserProcess { | 32 class CastBrowserProcess { |
| 31 public: | 33 public: |
| 32 // Gets the global instance of CastBrowserProcess. Does not create lazily and | 34 // Gets the global instance of CastBrowserProcess. Does not create lazily and |
| 33 // assumes the instance already exists. | 35 // assumes the instance already exists. |
| 34 static CastBrowserProcess* GetInstance(); | 36 static CastBrowserProcess* GetInstance(); |
| 35 | 37 |
| 36 CastBrowserProcess(); | 38 CastBrowserProcess(); |
| 37 virtual ~CastBrowserProcess(); | 39 virtual ~CastBrowserProcess(); |
| 38 | 40 |
| 39 void SetBrowserContext(scoped_ptr<CastBrowserContext> browser_context); | 41 void SetBrowserContext(scoped_ptr<CastBrowserContext> browser_context); |
| 40 void SetCastService(scoped_ptr<CastService> cast_service); | 42 void SetCastService(scoped_ptr<CastService> cast_service); |
| 41 void SetMetricsHelper(scoped_ptr<metrics::CastMetricsHelper> metrics_helper); | 43 void SetMetricsHelper(scoped_ptr<metrics::CastMetricsHelper> metrics_helper); |
| 42 void SetMetricsServiceClient( | 44 void SetMetricsServiceClient( |
| 43 scoped_ptr<metrics::CastMetricsServiceClient> metrics_service_client); | 45 scoped_ptr<metrics::CastMetricsServiceClient> metrics_service_client); |
| 44 void SetPrefService(scoped_ptr<PrefService> pref_service); | 46 void SetPrefService(scoped_ptr<PrefService> pref_service); |
| 45 void SetRemoteDebuggingServer( | 47 void SetRemoteDebuggingServer( |
| 46 scoped_ptr<RemoteDebuggingServer> remote_debugging_server); | 48 scoped_ptr<RemoteDebuggingServer> remote_debugging_server); |
| 49 void SetResourceDispatcherHostDelegate( |
| 50 scoped_ptr<CastResourceDispatcherHostDelegate> delegate); |
| 47 #if defined(OS_ANDROID) | 51 #if defined(OS_ANDROID) |
| 48 void SetCrashDumpManager( | 52 void SetCrashDumpManager( |
| 49 scoped_ptr<breakpad::CrashDumpManager> crash_dump_manager); | 53 scoped_ptr<breakpad::CrashDumpManager> crash_dump_manager); |
| 50 #endif // defined(OS_ANDROID) | 54 #endif // defined(OS_ANDROID) |
| 55 void SetConnectivityChecker( |
| 56 scoped_refptr<ConnectivityChecker> connectivity_checker); |
| 51 | 57 |
| 52 CastBrowserContext* browser_context() const { return browser_context_.get(); } | 58 CastBrowserContext* browser_context() const { return browser_context_.get(); } |
| 53 CastService* cast_service() const { return cast_service_.get(); } | 59 CastService* cast_service() const { return cast_service_.get(); } |
| 54 metrics::CastMetricsServiceClient* metrics_service_client() const { | 60 metrics::CastMetricsServiceClient* metrics_service_client() const { |
| 55 return metrics_service_client_.get(); | 61 return metrics_service_client_.get(); |
| 56 } | 62 } |
| 57 PrefService* pref_service() const { return pref_service_.get(); } | 63 PrefService* pref_service() const { return pref_service_.get(); } |
| 64 CastResourceDispatcherHostDelegate* resource_dispatcher_host_delegate() |
| 65 const { |
| 66 return resource_dispatcher_host_delegate_.get(); |
| 67 } |
| 68 ConnectivityChecker* connectivity_checker() const { |
| 69 return connectivity_checker_.get(); |
| 70 } |
| 58 | 71 |
| 59 private: | 72 private: |
| 60 // Note: The following order should match the order they are set in | 73 // Note: The following order should match the order they are set in |
| 61 // CastBrowserMainParts. | 74 // CastBrowserMainParts. |
| 62 scoped_ptr<metrics::CastMetricsHelper> metrics_helper_; | 75 scoped_ptr<metrics::CastMetricsHelper> metrics_helper_; |
| 63 scoped_ptr<PrefService> pref_service_; | 76 scoped_ptr<PrefService> pref_service_; |
| 77 scoped_refptr<ConnectivityChecker> connectivity_checker_; |
| 64 scoped_ptr<CastBrowserContext> browser_context_; | 78 scoped_ptr<CastBrowserContext> browser_context_; |
| 65 scoped_ptr<metrics::CastMetricsServiceClient> metrics_service_client_; | 79 scoped_ptr<metrics::CastMetricsServiceClient> metrics_service_client_; |
| 80 scoped_ptr<CastResourceDispatcherHostDelegate> |
| 81 resource_dispatcher_host_delegate_; |
| 66 #if defined(OS_ANDROID) | 82 #if defined(OS_ANDROID) |
| 67 scoped_ptr<breakpad::CrashDumpManager> crash_dump_manager_; | 83 scoped_ptr<breakpad::CrashDumpManager> crash_dump_manager_; |
| 68 #endif // defined(OS_ANDROID) | 84 #endif // defined(OS_ANDROID) |
| 69 scoped_ptr<RemoteDebuggingServer> remote_debugging_server_; | 85 scoped_ptr<RemoteDebuggingServer> remote_debugging_server_; |
| 70 | 86 |
| 71 // Note: CastService must be destroyed before others. | 87 // Note: CastService must be destroyed before others. |
| 72 scoped_ptr<CastService> cast_service_; | 88 scoped_ptr<CastService> cast_service_; |
| 73 | 89 |
| 74 DISALLOW_COPY_AND_ASSIGN(CastBrowserProcess); | 90 DISALLOW_COPY_AND_ASSIGN(CastBrowserProcess); |
| 75 }; | 91 }; |
| 76 | 92 |
| 77 } // namespace shell | 93 } // namespace shell |
| 78 } // namespace chromecast | 94 } // namespace chromecast |
| 79 | 95 |
| 80 #endif // CHROMECAST_BROWSER_CAST_BROWSER_PROCESS_H_ | 96 #endif // CHROMECAST_BROWSER_CAST_BROWSER_PROCESS_H_ |
| OLD | NEW |