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

Side by Side Diff: chrome/browser/chromeos/arc/arc_session_manager.cc

Issue 2615793002: arc: Fix situation when ARC cannot be disabled safely. (Closed)
Patch Set: add comment, discard arc_support_host fix 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/arc/arc_session_manager.h" 5 #include "chrome/browser/chromeos/arc/arc_session_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/common/shelf/shelf_delegate.h" 9 #include "ash/common/shelf/shelf_delegate.h"
10 #include "ash/common/wm_shell.h" 10 #include "ash/common/wm_shell.h"
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 // Restart ARC anyway. Let the enterprise reporting instance decide whether 275 // Restart ARC anyway. Let the enterprise reporting instance decide whether
276 // the ARC user data wipe is still required or not. 276 // the ARC user data wipe is still required or not.
277 reenable_arc_ = false; 277 reenable_arc_ = false;
278 VLOG(1) << "Reenable ARC"; 278 VLOG(1) << "Reenable ARC";
279 EnableArc(); 279 EnableArc();
280 } 280 }
281 281
282 void ArcSessionManager::OnProvisioningFinished(ProvisioningResult result) { 282 void ArcSessionManager::OnProvisioningFinished(ProvisioningResult result) {
283 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 283 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
284 284
285 // Due the async nature of closing mojo channel, some sign in error may arrive
hidehiko 2017/01/06 14:25:36 "some sign in error" sounds ambiguous, because in
khmel 2017/01/10 02:17:12 Done.
286 // after stopping ARC. Ignore all results arriving after disabling ARC.
hidehiko 2017/01/06 14:25:36 In precise, "after disabling ARC" sounds misleadin
khmel 2017/01/10 02:17:12 Done.
287 if (!IsArcEnabled()) {
hidehiko 2017/01/06 14:25:36 Please also explicitly comment that this code inte
khmel 2017/01/10 02:17:12 Done.
288 LOG(WARNING) << "Provisioning result received after Arc was disabled. "
289 << " Ignoring result " << static_cast<int>(result) << ".";
hidehiko 2017/01/06 14:25:36 Please address previous comment:
khmel 2017/01/10 02:17:12 Done.
290 return;
291 }
292
285 // Due asynchronous nature of stopping the ARC instance, 293 // Due asynchronous nature of stopping the ARC instance,
286 // OnProvisioningFinished may arrive after setting the |State::STOPPED| state 294 // OnProvisioningFinished may arrive after setting the |State::STOPPED| state
287 // and |State::Active| is not guaranteed to be set here. 295 // and |State::Active| is not guaranteed to be set here.
288 // prefs::kArcDataRemoveRequested also can be active for now. 296 // prefs::kArcDataRemoveRequested also can be active for now.
289 297
290 if (provisioning_reported_) { 298 if (provisioning_reported_) {
291 // We don't expect ProvisioningResult::SUCCESS is reported twice or reported 299 // We don't expect ProvisioningResult::SUCCESS is reported twice or reported
292 // after an error. 300 // after an error.
293 DCHECK_NE(result, ProvisioningResult::SUCCESS); 301 DCHECK_NE(result, ProvisioningResult::SUCCESS);
294 // TODO (khmel): Consider changing LOG to NOTREACHED once we guaranty that 302 // TODO (khmel): Consider changing LOG to NOTREACHED once we guaranty that
295 // no double message can happen in production. 303 // no double message can happen in production.
296 LOG(WARNING) << " Provisioning result was already reported. Ignoring " 304 LOG(WARNING) << "Provisioning result was already reported. Ignoring "
297 << " additional result " << static_cast<int>(result) << "."; 305 << " additional result " << static_cast<int>(result) << ".";
298 return; 306 return;
299 } 307 }
300 provisioning_reported_ = true; 308 provisioning_reported_ = true;
301 309
302 if (result == ProvisioningResult::CHROME_SERVER_COMMUNICATION_ERROR) { 310 if (result == ProvisioningResult::CHROME_SERVER_COMMUNICATION_ERROR) {
303 if (IsArcKioskMode()) { 311 if (IsArcKioskMode()) {
304 VLOG(1) << "Robot account auth code fetching error"; 312 VLOG(1) << "Robot account auth code fetching error";
305 // Log out the user. All the cleanup will be done in Shutdown() method. 313 // Log out the user. All the cleanup will be done in Shutdown() method.
306 // The callback is not called because auth code is empty. 314 // The callback is not called because auth code is empty.
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
986 return os << "ACTIVE"; 994 return os << "ACTIVE";
987 } 995 }
988 996
989 // Some compiler reports an error even if all values of an enum-class are 997 // Some compiler reports an error even if all values of an enum-class are
990 // covered indivisually in a switch statement. 998 // covered indivisually in a switch statement.
991 NOTREACHED(); 999 NOTREACHED();
992 return os; 1000 return os;
993 } 1001 }
994 1002
995 } // namespace arc 1003 } // namespace arc
OLDNEW
« 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