OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef COMPONENTS_ARC_ARC_SERVICE_MANAGER_H_ |
| 6 #define COMPONENTS_ARC_ARC_SERVICE_MANAGER_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" |
| 11 |
| 12 namespace base { |
| 13 |
| 14 class SequencedTaskRunner; |
| 15 class SingleThreadTaskRunner; |
| 16 |
| 17 } // namespace base |
| 18 |
| 19 namespace arc { |
| 20 |
| 21 class ArcBridgeService; |
| 22 |
| 23 // Manages creation and destruction of services that communicate with the ARC |
| 24 // instance via the ArcBridgeService. |
| 25 class ArcServiceManager { |
| 26 public: |
| 27 ArcServiceManager( |
| 28 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner, |
| 29 const scoped_refptr<base::SequencedTaskRunner>& file_task_runner); |
| 30 virtual ~ArcServiceManager(); |
| 31 |
| 32 // |arc_bridge_service| can only be accessed on the thread that this |
| 33 // class was created on. |
| 34 ArcBridgeService* arc_bridge_service(); |
| 35 |
| 36 // Gets the global instance of the ARC Service Manager. This can only be |
| 37 // called on the thread that this class was created on. |
| 38 static ArcServiceManager* Get(); |
| 39 |
| 40 private: |
| 41 scoped_refptr<base::SequencedTaskRunner> origin_task_runner_; |
| 42 scoped_ptr<ArcBridgeService> arc_bridge_service_; |
| 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(ArcServiceManager); |
| 45 }; |
| 46 |
| 47 } // namespace arc |
| 48 |
| 49 #endif // COMPONENTS_ARC_ARC_SERVICE_MANAGER_H_ |
OLD | NEW |