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_IMPL_H_ | 5 #ifndef COMPONENTS_ARC_ARC_BRIDGE_SERVICE_IMPL_H_ |
6 #define COMPONENTS_ARC_ARC_BRIDGE_SERVICE_IMPL_H_ | 6 #define COMPONENTS_ARC_ARC_BRIDGE_SERVICE_IMPL_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 26 matching lines...) Expand all Loading... |
37 void Shutdown() override; | 37 void Shutdown() override; |
38 | 38 |
39 // Normally, reconnecting after connection shutdown happens after a short | 39 // Normally, reconnecting after connection shutdown happens after a short |
40 // delay. When testing, however, we'd like it to happen immediately to avoid | 40 // delay. When testing, however, we'd like it to happen immediately to avoid |
41 // adding unnecessary delays. | 41 // adding unnecessary delays. |
42 void DisableReconnectDelayForTesting(); | 42 void DisableReconnectDelayForTesting(); |
43 | 43 |
44 private: | 44 private: |
45 friend class ArcBridgeTest; | 45 friend class ArcBridgeTest; |
46 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, Restart); | 46 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, Restart); |
| 47 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, BootFailure); |
| 48 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, Crash); |
47 | 49 |
48 // If all pre-requisites are true (ARC is available, it has been enabled, and | 50 // If all pre-requisites are true (ARC is available, it has been enabled, and |
49 // the session has started), and ARC is stopped, start ARC. If ARC is running | 51 // the session has started), and ARC is stopped, start ARC. If ARC is running |
50 // and the pre-requisites stop being true, stop ARC. | 52 // and the pre-requisites stop being true, stop ARC. |
51 void PrerequisitesChanged(); | 53 void PrerequisitesChanged(); |
52 | 54 |
53 // Stops the running instance. | 55 // Stops the running instance. |
54 void StopInstance(); | 56 void StopInstance(); |
55 | 57 |
56 // ArcBridgeBootstrap::Delegate: | 58 // ArcBridgeBootstrap::Delegate: |
57 void OnConnectionEstablished(mojom::ArcBridgeInstancePtr instance) override; | 59 void OnConnectionEstablished(mojom::ArcBridgeInstancePtr instance) override; |
58 void OnStopped() override; | 60 void OnStopped(ArcBridgeBootstrap::StopReason reason) override; |
59 | 61 |
60 // Called when the bridge channel is closed. This typically only happens when | 62 // Called when the bridge channel is closed. This typically only happens when |
61 // the ARC instance crashes. This is not called during shutdown. | 63 // the ARC instance crashes. This is not called during shutdown. |
62 void OnChannelClosed(); | 64 void OnChannelClosed(); |
63 | 65 |
64 std::unique_ptr<ArcBridgeBootstrap> bootstrap_; | 66 std::unique_ptr<ArcBridgeBootstrap> bootstrap_; |
65 | 67 |
66 // Mojo endpoints. | 68 // Mojo endpoints. |
67 mojo::Binding<mojom::ArcBridgeHost> binding_; | 69 mojo::Binding<mojom::ArcBridgeHost> binding_; |
68 mojom::ArcBridgeInstancePtr instance_ptr_; | 70 mojom::ArcBridgeInstancePtr instance_ptr_; |
(...skipping 10 matching lines...) Expand all Loading... |
79 | 81 |
80 // WeakPtrFactory to use callbacks. | 82 // WeakPtrFactory to use callbacks. |
81 base::WeakPtrFactory<ArcBridgeServiceImpl> weak_factory_; | 83 base::WeakPtrFactory<ArcBridgeServiceImpl> weak_factory_; |
82 | 84 |
83 DISALLOW_COPY_AND_ASSIGN(ArcBridgeServiceImpl); | 85 DISALLOW_COPY_AND_ASSIGN(ArcBridgeServiceImpl); |
84 }; | 86 }; |
85 | 87 |
86 } // namespace arc | 88 } // namespace arc |
87 | 89 |
88 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_IMPL_H_ | 90 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_IMPL_H_ |
OLD | NEW |