Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 COMPONENTS_ARC_ARC_SERVICE_MANAGER_H_ | 5 #ifndef COMPONENTS_ARC_ARC_SERVICE_MANAGER_H_ |
| 6 #define COMPONENTS_ARC_ARC_SERVICE_MANAGER_H_ | 6 #define COMPONENTS_ARC_ARC_SERVICE_MANAGER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/threading/thread_checker.h" | 10 #include "base/threading/thread_checker.h" |
| 11 #include "components/arc/common/net.mojom.h" | |
| 11 | 12 |
| 12 namespace arc { | 13 namespace arc { |
| 13 | 14 |
| 14 class ArcAuthService; | 15 class ArcAuthService; |
| 15 class ArcBridgeService; | 16 class ArcBridgeService; |
| 16 class ArcClipboardBridge; | 17 class ArcClipboardBridge; |
| 17 class ArcInputBridge; | 18 class ArcInputBridge; |
| 19 class ArcNetHostImpl; | |
| 18 class ArcSettingsBridge; | 20 class ArcSettingsBridge; |
| 19 class ArcPowerBridge; | 21 class ArcPowerBridge; |
| 20 | 22 |
| 21 // Manages creation and destruction of services that communicate with the ARC | 23 // Manages creation and destruction of services that communicate with the ARC |
| 22 // instance via the ArcBridgeService. | 24 // instance via the ArcBridgeService. |
| 23 class ArcServiceManager { | 25 class ArcServiceManager { |
| 24 public: | 26 public: |
| 25 ArcServiceManager(scoped_ptr<ArcAuthService> auth_service, | 27 ArcServiceManager(scoped_ptr<ArcAuthService> auth_service, |
| 26 scoped_ptr<ArcSettingsBridge> settings_bridge); | 28 scoped_ptr<ArcSettingsBridge> settings_bridge); |
| 27 virtual ~ArcServiceManager(); | 29 virtual ~ArcServiceManager(); |
| 28 | 30 |
| 29 // |arc_bridge_service| can only be accessed on the thread that this | 31 // |arc_bridge_service| can only be accessed on the thread that this |
| 30 // class was created on. | 32 // class was created on. |
| 31 ArcBridgeService* arc_bridge_service(); | 33 ArcBridgeService* arc_bridge_service(); |
| 32 | 34 |
| 33 // Gets the global instance of the ARC Service Manager. This can only be | 35 // Gets the global instance of the ARC Service Manager. This can only be |
| 34 // called on the thread that this class was created on. | 36 // called on the thread that this class was created on. |
| 35 static ArcServiceManager* Get(); | 37 static ArcServiceManager* Get(); |
| 36 | 38 |
| 37 private: | 39 private: |
| 38 base::ThreadChecker thread_checker_; | 40 base::ThreadChecker thread_checker_; |
| 39 scoped_ptr<ArcBridgeService> arc_bridge_service_; | 41 scoped_ptr<ArcBridgeService> arc_bridge_service_; |
| 40 | 42 |
| 41 // Individual services | 43 // Individual services |
| 42 scoped_ptr<ArcAuthService> arc_auth_service_; | 44 scoped_ptr<ArcAuthService> arc_auth_service_; |
| 43 scoped_ptr<ArcClipboardBridge> arc_clipboard_bridge_; | 45 scoped_ptr<ArcClipboardBridge> arc_clipboard_bridge_; |
| 44 scoped_ptr<ArcInputBridge> arc_input_bridge_; | 46 scoped_ptr<ArcInputBridge> arc_input_bridge_; |
| 47 scoped_ptr<arc::NetHost> arc_net_host_; | |
|
Luis Héctor Chávez
2016/01/12 17:32:32
Any reason you are not using scoped_ptr<ArcNetHost
| |
| 45 scoped_ptr<ArcSettingsBridge> arc_settings_bridge_; | 48 scoped_ptr<ArcSettingsBridge> arc_settings_bridge_; |
| 46 scoped_ptr<ArcPowerBridge> arc_power_bridge_; | 49 scoped_ptr<ArcPowerBridge> arc_power_bridge_; |
| 47 | 50 |
| 48 DISALLOW_COPY_AND_ASSIGN(ArcServiceManager); | 51 DISALLOW_COPY_AND_ASSIGN(ArcServiceManager); |
| 49 }; | 52 }; |
| 50 | 53 |
| 51 } // namespace arc | 54 } // namespace arc |
| 52 | 55 |
| 53 #endif // COMPONENTS_ARC_ARC_SERVICE_MANAGER_H_ | 56 #endif // COMPONENTS_ARC_ARC_SERVICE_MANAGER_H_ |
| OLD | NEW |