| 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_SESSION_H_ | 5 #ifndef COMPONENTS_ARC_ARC_SESSION_H_ |
| 6 #define COMPONENTS_ARC_ARC_SESSION_H_ | 6 #define COMPONENTS_ARC_ARC_SESSION_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 // Called when ARC instance is stopped. This is called exactly once | 37 // Called when ARC instance is stopped. This is called exactly once |
| 38 // per instance which is Start()ed. | 38 // per instance which is Start()ed. |
| 39 virtual void OnStopped(ArcBridgeService::StopReason reason) = 0; | 39 virtual void OnStopped(ArcBridgeService::StopReason reason) = 0; |
| 40 | 40 |
| 41 private: | 41 private: |
| 42 DISALLOW_COPY_AND_ASSIGN(Observer); | 42 DISALLOW_COPY_AND_ASSIGN(Observer); |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 // Creates a default instance of ArcSession. | 45 // Creates a default instance of ArcSession. |
| 46 static std::unique_ptr<ArcSession> Create( | 46 static std::unique_ptr<ArcSession> Create( |
| 47 ArcBridgeService* arc_bridge_service, |
| 47 const scoped_refptr<base::TaskRunner>& blocking_task_runner); | 48 const scoped_refptr<base::TaskRunner>& blocking_task_runner); |
| 48 virtual ~ArcSession(); | 49 virtual ~ArcSession(); |
| 49 | 50 |
| 50 // Starts and bootstraps a connection with the instance. The Observer's | 51 // Starts and bootstraps a connection with the instance. The Observer's |
| 51 // OnReady() will be called if the bootstrapping is successful, or | 52 // OnReady() will be called if the bootstrapping is successful, or |
| 52 // OnStopped() if it is not. Start() should not be called twice or more. | 53 // OnStopped() if it is not. Start() should not be called twice or more. |
| 53 virtual void Start() = 0; | 54 virtual void Start() = 0; |
| 54 | 55 |
| 55 // Requests to stop the currently-running instance. | 56 // Requests to stop the currently-running instance. |
| 56 // The completion is notified via OnStopped() of the Delegate. | 57 // The completion is notified via OnStopped() of the Delegate. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 68 | 69 |
| 69 base::ObserverList<Observer> observer_list_; | 70 base::ObserverList<Observer> observer_list_; |
| 70 | 71 |
| 71 private: | 72 private: |
| 72 DISALLOW_COPY_AND_ASSIGN(ArcSession); | 73 DISALLOW_COPY_AND_ASSIGN(ArcSession); |
| 73 }; | 74 }; |
| 74 | 75 |
| 75 } // namespace arc | 76 } // namespace arc |
| 76 | 77 |
| 77 #endif // COMPONENTS_ARC_ARC_SESSION_H_ | 78 #endif // COMPONENTS_ARC_ARC_SESSION_H_ |
| OLD | NEW |