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/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 | 11 |
12 namespace base { | 12 namespace base { |
13 | 13 |
14 class SequencedTaskRunner; | 14 class SequencedTaskRunner; |
15 class SingleThreadTaskRunner; | 15 class SingleThreadTaskRunner; |
16 | 16 |
17 } // namespace base | 17 } // namespace base |
18 | 18 |
19 namespace arc { | 19 namespace arc { |
20 | 20 |
21 class ArcBridgeService; | 21 class ArcBridgeService; |
22 class ArcInputBridge; | |
22 | 23 |
23 // Manages creation and destruction of ARC related services. | 24 // Manages creation and destruction of ARC related services. |
24 class ArcServiceManager { | 25 class ArcServiceManager { |
25 public: | 26 public: |
26 ArcServiceManager( | 27 ArcServiceManager( |
27 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner, | 28 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner, |
28 const scoped_refptr<base::SequencedTaskRunner>& file_task_runner); | 29 const scoped_refptr<base::SequencedTaskRunner>& file_task_runner); |
29 virtual ~ArcServiceManager(); | 30 virtual ~ArcServiceManager(); |
30 | 31 |
31 // |arc_bridge_service| can only be accessed on the thread that this | 32 // |arc_bridge_service| can only be accessed on the thread that this |
32 // class was created on. | 33 // class was created on. |
33 ArcBridgeService* arc_bridge_service(); | 34 ArcBridgeService* arc_bridge_service(); |
34 | 35 |
35 // Gets the global instance of the ARC Service Manager. This can only be | 36 // Gets the global instance of the ARC Service Manager. This can only be |
36 // called on the thread that this class was created on. | 37 // called on the thread that this class was created on. |
37 static ArcServiceManager* Get(); | 38 static ArcServiceManager* Get(); |
38 | 39 |
39 private: | 40 private: |
40 scoped_refptr<base::SequencedTaskRunner> origin_task_runner_; | 41 scoped_refptr<base::SequencedTaskRunner> origin_task_runner_; |
42 scoped_ptr<ArcInputBridge> arc_input_bridge_; | |
43 | |
44 // The arc bridge service should be destroyed last. | |
41 scoped_ptr<ArcBridgeService> arc_bridge_service_; | 45 scoped_ptr<ArcBridgeService> arc_bridge_service_; |
Luis Héctor Chávez
2015/12/04 17:59:59
If you want to destroy it last, shouldn't it be de
denniskempin
2015/12/04 22:35:29
yes.. of course!
| |
42 | 46 |
43 DISALLOW_COPY_AND_ASSIGN(ArcServiceManager); | 47 DISALLOW_COPY_AND_ASSIGN(ArcServiceManager); |
44 }; | 48 }; |
45 | 49 |
46 } // namespace arc | 50 } // namespace arc |
47 | 51 |
48 #endif // COMPONENTS_ARC_ARC_SERVICE_MANAGER_H_ | 52 #endif // COMPONENTS_ARC_ARC_SERVICE_MANAGER_H_ |
OLD | NEW |