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

Unified Diff: components/arc/arc_bridge_service.h

Issue 2436763004: More graceful shutdown for ArcSession. (Closed)
Patch Set: Created 4 years, 2 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 93f0767d9d8397f5c72ab728a43512e0331956fa..d6245c688f39eed32c24f07f5e3dc43f378aa9ab 100644
--- a/components/arc/arc_bridge_service.h
+++ b/components/arc/arc_bridge_service.h
@@ -103,11 +103,18 @@ class ArcBridgeService {
// HandleStartup() should be called upon profile startup. This will only
// launch an instance if the instance is enabled.
// This can only be called on the thread that this class was created on.
- virtual void HandleStartup() = 0;
- // Shutdown() should be called when the browser is shutting down. This can
- // only be called on the thread that this class was created on.
- virtual void Shutdown() = 0;
+ // Starts the ARC service, then it will connect the Mojo channel. When the
+ // bridge becomes ready, OnBridgeReady() is called.
+ virtual void RequestStart() = 0;
+
+ // Stops the ARC service.
+ virtual void RequestStop() = 0;
+
+ // OnShutdown() should be called when the browser is shutting down. This can
+ // only be called on the thread that this class was created on. We assume that
+ // when this function is called, MessageLoop is no longer exists.
+ virtual void OnShutdown() = 0;
Luis Héctor Chávez 2016/10/21 00:43:41 Can you add a simple unit test that uses this? I'd
hidehiko 2016/10/21 04:34:03 Added. But which DCHECK did you mean? If the one
Luis Héctor Chávez 2016/10/21 06:34:20 The current unit test here looks good enough for t
// Adds or removes observers. This can only be called on the thread that this
// class was created on. RemoveObserver does nothing if |observer| is not in
@@ -244,7 +251,7 @@ class ArcBridgeService {
friend class ArcBridgeTest;
FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, Basic);
FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, Prerequisites);
- FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, ShutdownMidStartup);
+ FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, StopMidStartup);
FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, Restart);
FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, OnBridgeStopped);

Powered by Google App Engine
This is Rietveld 408576698