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

Unified Diff: chrome/browser/chromeos/arc/arc_session_manager.cc

Issue 2720303002: Do nothing on OnSessionStopped if ARC is being restarted. (Closed)
Patch Set: Created 3 years, 10 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: chrome/browser/chromeos/arc/arc_session_manager.cc
diff --git a/chrome/browser/chromeos/arc/arc_session_manager.cc b/chrome/browser/chromeos/arc/arc_session_manager.cc
index 8e8edba118b43fcf11f24d4317efe20ad19b2c81..979119e2e9a6be5b23d03da1c720f0629a309ed0 100644
--- a/chrome/browser/chromeos/arc/arc_session_manager.cc
+++ b/chrome/browser/chromeos/arc/arc_session_manager.cc
@@ -142,12 +142,14 @@ void ArcSessionManager::EnableCheckAndroidManagementForTesting() {
g_enable_check_android_management_for_testing = true;
}
-void ArcSessionManager::OnSessionReady() {
- for (auto& observer : arc_session_observer_list_)
- observer.OnSessionReady();
-}
+void ArcSessionManager::OnSessionStopped(StopReason reason, bool restarting) {
+ if (restarting) {
+ // If ARC is being restarted, here do nothing, and just wait for its
+ // next run.
+ VLOG(1) << "ARC session is stopped, but being restarted: " << reason;
+ return;
+ }
-void ArcSessionManager::OnSessionStopped(StopReason reason) {
// TODO(crbug.com/625923): Use |reason| to report more detailed errors.
if (arc_sign_in_timer_.IsRunning())
hidehiko 2017/02/28 16:33:48 Note: this case is the biggest change in this CL.
OnProvisioningFinished(ProvisioningResult::ARC_STOPPED);
@@ -167,8 +169,8 @@ void ArcSessionManager::OnSessionStopped(StopReason reason) {
weak_ptr_factory_.GetWeakPtr()));
}
- for (auto& observer : arc_session_observer_list_)
- observer.OnSessionStopped(reason);
+ for (auto& observer : observer_list_)
+ observer.OnArcSessionStopped(reason);
hidehiko 2017/02/28 16:33:48 Note: The only use case of this is ArcBootNotifica
}
void ArcSessionManager::RemoveArcData() {
@@ -577,16 +579,6 @@ void ArcSessionManager::RemoveObserver(Observer* observer) {
observer_list_.RemoveObserver(observer);
}
-void ArcSessionManager::AddSessionObserver(ArcSessionObserver* observer) {
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- arc_session_observer_list_.AddObserver(observer);
-}
-
-void ArcSessionManager::RemoveSessionObserver(ArcSessionObserver* observer) {
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- arc_session_observer_list_.RemoveObserver(observer);
-}
-
bool ArcSessionManager::IsSessionRunning() const {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
return arc_session_runner_->IsRunning();

Powered by Google App Engine
This is Rietveld 408576698