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> |
11 | 11 |
12 #include "base/files/scoped_file.h" | 12 #include "base/files/scoped_file.h" |
13 #include "base/gtest_prod_util.h" | |
14 #include "base/macros.h" | 13 #include "base/macros.h" |
15 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
16 #include "base/task_runner.h" | 15 #include "base/task_runner.h" |
17 #include "components/arc/arc_bridge_service.h" | 16 #include "components/arc/arc_bridge_service.h" |
18 #include "components/arc/arc_session_observer.h" | 17 #include "components/arc/arc_session_observer.h" |
19 #include "mojo/public/cpp/bindings/binding.h" | 18 #include "mojo/public/cpp/bindings/binding.h" |
20 | 19 |
21 namespace arc { | 20 namespace arc { |
22 | 21 |
23 class ArcSession; | 22 class ArcSession; |
(...skipping 21 matching lines...) Expand all Loading... |
45 | 44 |
46 // Returns the current ArcSession instance for testing purpose. | 45 // Returns the current ArcSession instance for testing purpose. |
47 ArcSession* GetArcSessionForTesting() { return arc_session_.get(); } | 46 ArcSession* GetArcSessionForTesting() { return arc_session_.get(); } |
48 | 47 |
49 // Normally, reconnecting after connection shutdown happens after a short | 48 // Normally, reconnecting after connection shutdown happens after a short |
50 // delay. When testing, however, we'd like it to happen immediately to avoid | 49 // delay. When testing, however, we'd like it to happen immediately to avoid |
51 // adding unnecessary delays. | 50 // adding unnecessary delays. |
52 void DisableReconnectDelayForTesting(); | 51 void DisableReconnectDelayForTesting(); |
53 | 52 |
54 private: | 53 private: |
55 friend class ArcBridgeTest; | |
56 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, Restart); | |
57 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, OnBridgeStopped); | |
58 | |
59 // If all pre-requisites are true (ARC is available, it has been enabled, and | 54 // If all pre-requisites are true (ARC is available, it has been enabled, and |
60 // the session has started), and ARC is stopped, start ARC. If ARC is running | 55 // the session has started), and ARC is stopped, start ARC. If ARC is running |
61 // and the pre-requisites stop being true, stop ARC. | 56 // and the pre-requisites stop being true, stop ARC. |
62 void PrerequisitesChanged(); | 57 void PrerequisitesChanged(); |
63 | 58 |
64 // Stops the running instance. | 59 // Stops the running instance. |
65 void StopInstance(); | 60 void StopInstance(); |
66 | 61 |
67 // ArcSessionObserver: | 62 // ArcSessionObserver: |
68 void OnSessionReady() override; | 63 void OnSessionReady() override; |
(...skipping 16 matching lines...) Expand all Loading... |
85 | 80 |
86 // WeakPtrFactory to use callbacks. | 81 // WeakPtrFactory to use callbacks. |
87 base::WeakPtrFactory<ArcBridgeServiceImpl> weak_factory_; | 82 base::WeakPtrFactory<ArcBridgeServiceImpl> weak_factory_; |
88 | 83 |
89 DISALLOW_COPY_AND_ASSIGN(ArcBridgeServiceImpl); | 84 DISALLOW_COPY_AND_ASSIGN(ArcBridgeServiceImpl); |
90 }; | 85 }; |
91 | 86 |
92 } // namespace arc | 87 } // namespace arc |
93 | 88 |
94 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_IMPL_H_ | 89 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_IMPL_H_ |
OLD | NEW |