| 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, OnBridgeStopped); |
| 47 | 48 |
| 48 // If all pre-requisites are true (ARC is available, it has been enabled, and | 49 // 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 | 50 // the session has started), and ARC is stopped, start ARC. If ARC is running |
| 50 // and the pre-requisites stop being true, stop ARC. | 51 // and the pre-requisites stop being true, stop ARC. |
| 51 void PrerequisitesChanged(); | 52 void PrerequisitesChanged(); |
| 52 | 53 |
| 53 // Stops the running instance. | 54 // Stops the running instance. |
| 54 void StopInstance(); | 55 void StopInstance(); |
| 55 | 56 |
| 56 // ArcBridgeBootstrap::Delegate: | 57 // ArcBridgeBootstrap::Delegate: |
| 57 void OnConnectionEstablished(mojom::ArcBridgeInstancePtr instance) override; | 58 void OnConnectionEstablished(mojom::ArcBridgeInstancePtr instance) override; |
| 58 void OnStopped() override; | 59 void OnStopped(StopReason reason) override; |
| 59 | 60 |
| 60 // Called when the bridge channel is closed. This typically only happens when | 61 // Called when the bridge channel is closed. This typically only happens when |
| 61 // the ARC instance crashes. This is not called during shutdown. | 62 // the ARC instance crashes. This is not called during shutdown. |
| 62 void OnChannelClosed(); | 63 void OnChannelClosed(); |
| 63 | 64 |
| 64 std::unique_ptr<ArcBridgeBootstrap> bootstrap_; | 65 std::unique_ptr<ArcBridgeBootstrap> bootstrap_; |
| 65 | 66 |
| 66 // Mojo endpoints. | 67 // Mojo endpoints. |
| 67 mojo::Binding<mojom::ArcBridgeHost> binding_; | 68 mojo::Binding<mojom::ArcBridgeHost> binding_; |
| 68 mojom::ArcBridgeInstancePtr instance_ptr_; | 69 mojom::ArcBridgeInstancePtr instance_ptr_; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 79 | 80 |
| 80 // WeakPtrFactory to use callbacks. | 81 // WeakPtrFactory to use callbacks. |
| 81 base::WeakPtrFactory<ArcBridgeServiceImpl> weak_factory_; | 82 base::WeakPtrFactory<ArcBridgeServiceImpl> weak_factory_; |
| 82 | 83 |
| 83 DISALLOW_COPY_AND_ASSIGN(ArcBridgeServiceImpl); | 84 DISALLOW_COPY_AND_ASSIGN(ArcBridgeServiceImpl); |
| 84 }; | 85 }; |
| 85 | 86 |
| 86 } // namespace arc | 87 } // namespace arc |
| 87 | 88 |
| 88 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_IMPL_H_ | 89 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_IMPL_H_ |
| OLD | NEW |