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_BOOTSTRAP_H_ | 5 #ifndef COMPONENTS_ARC_ARC_BRIDGE_BOOTSTRAP_H_ |
6 #define COMPONENTS_ARC_ARC_BRIDGE_BOOTSTRAP_H_ | 6 #define COMPONENTS_ARC_ARC_BRIDGE_BOOTSTRAP_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/sequenced_task_runner.h" | 10 #include "base/sequenced_task_runner.h" |
(...skipping 22 matching lines...) Expand all Loading... | |
33 void set_delegate(Delegate* delegate) { delegate_ = delegate; } | 33 void set_delegate(Delegate* delegate) { delegate_ = delegate; } |
34 | 34 |
35 // Starts and bootstraps a connection with the instance. The Delegate's | 35 // Starts and bootstraps a connection with the instance. The Delegate's |
36 // OnConnectionEstablished() will be called if the bootstrapping is | 36 // OnConnectionEstablished() will be called if the bootstrapping is |
37 // successful, or OnStopped() if it is not. | 37 // successful, or OnStopped() if it is not. |
38 virtual void Start() = 0; | 38 virtual void Start() = 0; |
39 | 39 |
40 // Stops the currently-running instance. | 40 // Stops the currently-running instance. |
41 virtual void Stop() = 0; | 41 virtual void Stop() = 0; |
42 | 42 |
43 // Set instance for testing. ArcBridgeBootstrap owns |bootstrap| | |
hidehiko
2016/03/15 07:01:53
ArcBridgeBootstrap is not a singleton, so Set*ForT
Polina Bondarenko
2016/03/15 16:16:00
Done.
| |
44 // until Create() is called, then passes ownership to the caller. | |
45 static void SetBootstrapForTesting( | |
46 scoped_ptr<ArcBridgeBootstrap> bootstrap); | |
43 protected: | 47 protected: |
44 ArcBridgeBootstrap(); | 48 ArcBridgeBootstrap(); |
45 | 49 |
46 // Owned by the caller. | 50 // Owned by the caller. |
47 Delegate* delegate_ = nullptr; | 51 Delegate* delegate_ = nullptr; |
48 | 52 |
49 private: | 53 private: |
50 DISALLOW_COPY_AND_ASSIGN(ArcBridgeBootstrap); | 54 DISALLOW_COPY_AND_ASSIGN(ArcBridgeBootstrap); |
51 }; | 55 }; |
52 | 56 |
53 } // namespace arc | 57 } // namespace arc |
54 | 58 |
55 #endif // COMPONENTS_ARC_ARC_BRIDGE_BOOTSTRAP_H_ | 59 #endif // COMPONENTS_ARC_ARC_BRIDGE_BOOTSTRAP_H_ |
OLD | NEW |