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| | |
44 // until Create() is called, passes ownership to a caller. | |
bartfab (slow)
2016/03/02 14:45:40
Nit 1: s/passes/then passes/
Nit 2: s/ a / the /
Polina Bondarenko
2016/03/06 20:22:33
Done.
| |
45 static void SetBootstrapForTesting(ArcBridgeBootstrap* bootstrap); | |
bartfab (slow)
2016/03/02 14:45:40
Use a scoped_ptr to indicate ownership transfer.
Polina Bondarenko
2016/03/06 20:22:33
Done.
| |
43 protected: | 46 protected: |
44 ArcBridgeBootstrap(); | 47 ArcBridgeBootstrap(); |
45 | 48 |
46 // Owned by the caller. | 49 // Owned by the caller. |
47 Delegate* delegate_ = nullptr; | 50 Delegate* delegate_ = nullptr; |
48 | 51 |
49 private: | 52 private: |
50 DISALLOW_COPY_AND_ASSIGN(ArcBridgeBootstrap); | 53 DISALLOW_COPY_AND_ASSIGN(ArcBridgeBootstrap); |
51 }; | 54 }; |
52 | 55 |
53 } // namespace arc | 56 } // namespace arc |
54 | 57 |
55 #endif // COMPONENTS_ARC_ARC_BRIDGE_BOOTSTRAP_H_ | 58 #endif // COMPONENTS_ARC_ARC_BRIDGE_BOOTSTRAP_H_ |
OLD | NEW |