Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(386)

Side by Side Diff: components/arc/arc_session_observer.h

Issue 2567083002: Migrate ArcBridgeService::Observer and ArcSession::Observer. (Closed)
Patch Set: rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/arc/arc_session.cc ('k') | components/arc/arc_session_observer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_
OLDNEW
« no previous file with comments | « components/arc/arc_session.cc ('k') | components/arc/arc_session_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698