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

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

Issue 2615793002: arc: Fix situation when ARC cannot be disabled safely. (Closed)
Patch Set: comments updated Created 3 years, 11 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 | no next file » | 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 3544f007a7645d368c16cdb8ec58aa1cd3f15a64..4c0c75381a1401110bfacb5b9d449686e63733c3 100644
--- a/chrome/browser/chromeos/arc/arc_session_manager.cc
+++ b/chrome/browser/chromeos/arc/arc_session_manager.cc
@@ -282,6 +282,17 @@ void ArcSessionManager::MaybeReenableArc() {
void ArcSessionManager::OnProvisioningFinished(ProvisioningResult result) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ // If the Mojo message to notify finishing the provisioning is already sent
+ // from the container, it will be processed even after requesting to stop the
+ // container. Ignore all |result|s arriving while ARC is disabled, in order to
+ // avoid popping up an error message triggered below. This code intentionally
+ // does not support the case of reenabling.
+ if (!IsArcEnabled()) {
+ LOG(WARNING) << "Provisioning result received after Arc was disabled. "
+ << "Ignoring result " << static_cast<int>(result) << ".";
+ return;
+ }
+
// Due asynchronous nature of stopping the ARC instance,
// OnProvisioningFinished may arrive after setting the |State::STOPPED| state
// and |State::Active| is not guaranteed to be set here.
@@ -293,8 +304,8 @@ void ArcSessionManager::OnProvisioningFinished(ProvisioningResult result) {
DCHECK_NE(result, ProvisioningResult::SUCCESS);
// TODO (khmel): Consider changing LOG to NOTREACHED once we guaranty that
// no double message can happen in production.
- LOG(WARNING) << " Provisioning result was already reported. Ignoring "
- << " additional result " << static_cast<int>(result) << ".";
+ LOG(WARNING) << "Provisioning result was already reported. Ignoring "
+ << "additional result " << static_cast<int>(result) << ".";
return;
}
provisioning_reported_ = true;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698