| 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 instance running state. |
| 13 class ArcSessionObserver { |
| 14 public: |
| 15 // Describes the reason the ARC instance is stopped. |
| 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 OnSessionReady() {} |
| 36 |
| 37 // Called when ARC instance is stopped. This is called exactly once |
| 38 // per instance which is Start()ed. |
| 39 virtual void OnSessionStopped(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 |