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

Unified Diff: components/arc/arc_bridge_service.h

Issue 2133653002: arc: Notify ARC instance failures via callbacks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 months 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 side-by-side diff with in-line comments
Download patch
Index: components/arc/arc_bridge_service.h
diff --git a/components/arc/arc_bridge_service.h b/components/arc/arc_bridge_service.h
index 3d719694314ee0219463b873144255e23136cbde..0dd1fd44c64680716c5940a28d0b40ffae752a1d 100644
--- a/components/arc/arc_bridge_service.h
+++ b/components/arc/arc_bridge_service.h
@@ -21,8 +21,6 @@ class CommandLine;
namespace arc {
-class ArcBridgeBootstrap;
-
// The Chrome-side service that handles ARC instances and ARC bridge creation.
// This service handles the lifetime of ARC instances and sets up the
// communication channel (the ARC bridge) used to send and receive messages.
@@ -63,13 +61,34 @@ class ArcBridgeService : public mojom::ArcBridgeHost {
STOPPING,
};
+ // Describes the reason the bridge is being aborted.
+ enum class AbortReason {
+ // ARC instance boot failed for unknown errors.
Luis Héctor Chávez 2016/07/08 18:01:02 nit: it's better to say that this is just any erro
Shuhei Takahashi 2016/07/11 08:25:19 Thanks, I've updated the comment. Does it look goo
Luis Héctor Chávez 2016/07/11 22:28:50 It does, thanks!
+ GENERIC_BOOT_FAILURE,
+
+ // ARC instance has crashed.
+ CRASH,
+ };
+
// Notifies life cycle events of ArcBridgeService.
class Observer {
public:
// Called whenever the state of the bridge has changed.
// TODO(lchavez): Rename to OnStateChangedForTest
virtual void OnStateChanged(State state) {}
+
+ // Called whenever the bridge got ready.
Luis Héctor Chávez 2016/07/08 18:01:02 nit: the bridge is ready.
Shuhei Takahashi 2016/07/11 08:25:19 Done.
virtual void OnBridgeReady() {}
+
+ // Called whenever the bridge is being aborted due to errors.
+ // After this callback is invoked, the ARC instance will be stopped, so
+ // you do not need to call ArcBridgeServiceImpl::StopInstance() in the
+ // callback.
+ virtual void OnBridgeAborting(AbortReason reason) {}
+
+ // Called whenever the bridge stopped.
Luis Héctor Chávez 2016/07/08 18:01:02 nit: the bridge is stopped.
Shuhei Takahashi 2016/07/11 08:25:19 Done.
+ // When the bridge aborted due to errors, OnBridgeAborting() is called
+ // first, then OnBridgeStopped() is called once the instance is stopped.
virtual void OnBridgeStopped() {}
// Called whenever ARC's availability has changed for this system.

Powered by Google App Engine
This is Rietveld 408576698