Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_ARC_ARC_SESSION_OBSERVER_H_ | |
| 6 #define COMPONENTS_ARC_ARC_SESSION_OBSERVER_H_ | |
| 7 | |
| 8 #include <ostream> | |
| 9 | |
| 10 namespace arc { | |
| 11 | |
| 12 // Interface to observe the ARC container running state. | |
|
Luis Héctor Chávez
2016/12/13 18:02:54
This file has "ARC container", "ArcSession", and "
hidehiko
2016/12/14 01:23:32
Let's use ARC instance, then. According to git gre
| |
| 13 class ArcSessionObserver { | |
| 14 public: | |
| 15 // Describes the reason the bridge is stopped. | |
|
Luis Héctor Chávez
2016/12/13 18:02:54
nit: s/bridge/ARC xxx/ (for whatever xxx we standa
hidehiko
2016/12/14 01:23:32
Done.
| |
| 16 enum class StopReason { | |
| 17 // ARC instance has been gracefully shut down. | |
| 18 SHUTDOWN, | |
| 19 | |
| 20 // Errors occurred during the ARC instance boot. This includes any failures | |
| 21 // before the instance is actually attempted to be started, and also | |
| 22 // failures on bootstrapping IPC channels with Android. | |
| 23 GENERIC_BOOT_FAILURE, | |
| 24 | |
| 25 // The device is critically low on disk space. | |
| 26 LOW_DISK_SPACE, | |
| 27 | |
| 28 // ARC instance has crashed. | |
| 29 CRASH, | |
| 30 }; | |
| 31 | |
| 32 virtual ~ArcSessionObserver() = default; | |
| 33 | |
| 34 // Called when the connection with ARC instance has been established. | |
| 35 virtual void OnReady() {} | |
|
Luis Héctor Chávez
2016/12/13 18:02:54
How about OnSessionReady / OnSessionStopped? We us
hidehiko
2016/12/14 01:23:32
Done.
| |
| 36 | |
| 37 // Called when ARC instance is stopped. This is called exactly once | |
| 38 // per instance which is Start()ed. | |
| 39 virtual void OnStopped(StopReason reason) {} | |
| 40 }; | |
| 41 | |
| 42 // Defines "<<" operator for LOGging purpose. | |
| 43 std::ostream& operator<<(std::ostream& os, | |
| 44 ArcSessionObserver::StopReason reason); | |
| 45 | |
| 46 } // namespace arc | |
| 47 | |
| 48 #endif // COMPONENTS_ARC_ARC_SESSION_OBSERVER_H_ | |
| OLD | NEW |