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

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

Issue 2556273002: [Merge-M56] arc: Fix double provisioning failure reporting. (Closed)
Patch Set: resolve conflicts Created 4 years 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_auth_service.cc
diff --git a/chrome/browser/chromeos/arc/arc_auth_service.cc b/chrome/browser/chromeos/arc/arc_auth_service.cc
index 311b4417837d51208387c6ad11d12dbf797de92b..dbd72a671d922821df79851fb9678ed355501178 100644
--- a/chrome/browser/chromeos/arc/arc_auth_service.cc
+++ b/chrome/browser/chromeos/arc/arc_auth_service.cc
@@ -505,6 +505,18 @@ void ArcAuthService::OnProvisioningFinished(ProvisioningResult result) {
// guaranty set here. prefs::kArcDataRemoveRequested is also can be active
// for now.
+ if (provisioning_reported_) {
+ // We don't expect ProvisioningResult::SUCCESS is reported twice or reported
+ // after an error.
+ 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) << ".";
+ return;
+ }
+ provisioning_reported_ = true;
+
if (result == ProvisioningResult::CHROME_SERVER_COMMUNICATION_ERROR) {
// For backwards compatibility, use NETWORK_ERROR for
// CHROME_SERVER_COMMUNICATION_ERROR case.
@@ -858,6 +870,8 @@ void ArcAuthService::StartArc() {
// Arc must be started only if no pending data removal request exists.
DCHECK(!profile_->GetPrefs()->GetBoolean(prefs::kArcDataRemoveRequested));
+ provisioning_reported_ = false;
+
arc_bridge_service()->RequestStart();
SetState(State::ACTIVE);
}
« no previous file with comments | « chrome/browser/chromeos/arc/arc_auth_service.h ('k') | chrome/browser/chromeos/arc/arc_auth_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698