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

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

Issue 2646853002: [Merge M56] arc: Fix situation when ARC cannot be disabled safely. (Closed)
Patch Set: resolve conflicts 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_auth_service.cc
diff --git a/chrome/browser/chromeos/arc/arc_auth_service.cc b/chrome/browser/chromeos/arc/arc_auth_service.cc
index 9dc63e38014cfbd176f14b1e937a35a1e99c9de5..fae06a64a0ff0aa8750d41ee1a977b73c8faf138 100644
--- a/chrome/browser/chromeos/arc/arc_auth_service.cc
+++ b/chrome/browser/chromeos/arc/arc_auth_service.cc
@@ -505,6 +505,17 @@ void ArcAuthService::OnSignInFailed(mojom::ArcSignInFailureReason reason) {
void ArcAuthService::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 Arc bridge, OnProvisioningFinished may
// arrive after setting the |State::STOPPED| state and |State::Active| is not
// guaranty set here. prefs::kArcDataRemoveRequested is also can be active
« 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