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

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

Issue 2887363003: Read container_instance_id. (Closed)
Patch Set: Address comments. Created 3 years, 7 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
« no previous file with comments | « no previous file | chromeos/dbus/fake_session_manager_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f3ab8b7a2911ee590d2191efb52f09589700c5d4..16a3423ef690745f0015b5aa78707d00c877846e 100644
--- a/chrome/browser/chromeos/arc/arc_session_manager.cc
+++ b/chrome/browser/chromeos/arc/arc_session_manager.cc
@@ -212,6 +212,8 @@ void ArcSessionManager::OnSessionStopped(ArcStopReason reason,
return;
}
+ SetState(State::STOPPED);
+
// TODO(crbug.com/625923): Use |reason| to report more detailed errors.
if (arc_sign_in_timer_.IsRunning())
OnProvisioningFinished(ProvisioningResult::ARC_STOPPED);
@@ -219,19 +221,6 @@ void ArcSessionManager::OnSessionStopped(ArcStopReason reason,
for (auto& observer : observer_list_)
observer.OnArcSessionStopped(reason);
- // Transition to the ARC data remove state.
- if (!profile_->GetPrefs()->GetBoolean(prefs::kArcDataRemoveRequested)) {
- // TODO(crbug.com/665316): This is the workaround for the bug.
- // If it is not necessary to remove the data, MaybeStartArcDataRemoval()
- // synchronously calls MaybeReenableArc(), which causes unexpected
- // ARC session stop. (Please see the bug for details).
- SetState(State::REMOVING_DATA_DIR);
- base::ThreadTaskRunnerHandle::Get()->PostTask(
- FROM_HERE, base::Bind(&ArcSessionManager::MaybeReenableArc,
- weak_ptr_factory_.GetWeakPtr()));
- return;
- }
-
MaybeStartArcDataRemoval();
}
@@ -879,9 +868,7 @@ void ArcSessionManager::MaybeStartArcDataRemoval() {
DCHECK(profile_);
// Data removal cannot run in parallel with ARC session.
DCHECK(arc_session_runner_->IsStopped());
-
- // TODO(hidehiko): DCHECK the previous state, when the state machine is
- // fixed.
+ DCHECK_EQ(State::STOPPED, state_);
SetState(State::REMOVING_DATA_DIR);
// TODO(hidehiko): Extract the implementation of data removal, so that
« no previous file with comments | « no previous file | chromeos/dbus/fake_session_manager_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698