| 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_BRIDGE_SERVICE_H_ | 5 #ifndef COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ |
| 6 #define COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ | 6 #define COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ |
| 7 | 7 |
| 8 #include "base/files/scoped_file.h" | 8 #include "base/files/scoped_file.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
| 12 #include "components/arc/common/arc_message_types.h" | 12 #include "components/arc/common/arc_message_types.h" |
| 13 | 13 |
| 14 namespace base { | 14 namespace base { |
| 15 class CommandLine; | 15 class CommandLine; |
| 16 class SequencedTaskRunner; | 16 class SequencedTaskRunner; |
| 17 class SingleThreadTaskRunner; | 17 class SingleThreadTaskRunner; |
| 18 } // namespace base | 18 } // namespace base |
| 19 | 19 |
| 20 namespace arc { | 20 namespace arc { |
| 21 | 21 |
| 22 // The Chrome-side service that handles ARC instances and ARC bridge creation. | 22 // The Chrome-side service that handles ARC instances and ARC bridge creation. |
| 23 // This service handles the lifetime of ARC instances and sets up the | 23 // This service handles the lifetime of ARC instances and sets up the |
| 24 // communication channel (the ARC bridge) used to send and receive messages. | 24 // communication channel (the ARC bridge) used to send and receive messages. |
| 25 class ArcBridgeService { | 25 class ArcBridgeService : public base::SupportsWeakPtr<ArcBridgeService> { |
| 26 public: | 26 public: |
| 27 // The possible states of the bridge. In the normal flow, the state changes | 27 // The possible states of the bridge. In the normal flow, the state changes |
| 28 // in the following sequence: | 28 // in the following sequence: |
| 29 // | 29 // |
| 30 // STOPPED | 30 // STOPPED |
| 31 // SetAvailable(true) + HandleStartup() -> SocketConnect() -> | 31 // SetAvailable(true) + HandleStartup() -> SocketConnect() -> |
| 32 // CONNECTING | 32 // CONNECTING |
| 33 // Connect() -> | 33 // Connect() -> |
| 34 // CONNECTED | 34 // CONNECTED |
| 35 // SocketConnectAfterSetSocketPermissions() -> | 35 // SocketConnectAfterSetSocketPermissions() -> |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 | 154 |
| 155 // The current state of the bridge. | 155 // The current state of the bridge. |
| 156 ArcBridgeService::State state_; | 156 ArcBridgeService::State state_; |
| 157 | 157 |
| 158 DISALLOW_COPY_AND_ASSIGN(ArcBridgeService); | 158 DISALLOW_COPY_AND_ASSIGN(ArcBridgeService); |
| 159 }; | 159 }; |
| 160 | 160 |
| 161 } // namespace arc | 161 } // namespace arc |
| 162 | 162 |
| 163 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ | 163 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ |
| OLD | NEW |