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

Side by Side Diff: chrome/browser/chromeos/policy/enrollment_handler_chromeos.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/policy/enrollment_handler_chromeos.h" 5 #include "chrome/browser/chromeos/policy/enrollment_handler_chromeos.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h" 10 #include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 enrollment_step_ = STEP_STORE_POLICY; 200 enrollment_step_ = STEP_STORE_POLICY;
201 store_->InstallInitialPolicy(*policy_); 201 store_->InstallInitialPolicy(*policy_);
202 return; 202 return;
203 case EnterpriseInstallAttributes::LOCK_NOT_READY: 203 case EnterpriseInstallAttributes::LOCK_NOT_READY:
204 // We wait up to |kLockRetryTimeoutMs| milliseconds and if it hasn't 204 // We wait up to |kLockRetryTimeoutMs| milliseconds and if it hasn't
205 // succeeded by then show an error to the user and stop the enrollment. 205 // succeeded by then show an error to the user and stop the enrollment.
206 if (lockbox_init_duration_ < kLockRetryTimeoutMs) { 206 if (lockbox_init_duration_ < kLockRetryTimeoutMs) {
207 // InstallAttributes not ready yet, retry later. 207 // InstallAttributes not ready yet, retry later.
208 LOG(WARNING) << "Install Attributes not ready yet will retry in " 208 LOG(WARNING) << "Install Attributes not ready yet will retry in "
209 << kLockRetryIntervalMs << "ms."; 209 << kLockRetryIntervalMs << "ms.";
210 MessageLoop::current()->PostDelayedTask( 210 base::MessageLoop::current()->PostDelayedTask(
211 FROM_HERE, 211 FROM_HERE,
212 base::Bind(&EnrollmentHandlerChromeOS::WriteInstallAttributes, 212 base::Bind(&EnrollmentHandlerChromeOS::WriteInstallAttributes,
213 weak_factory_.GetWeakPtr(), 213 weak_factory_.GetWeakPtr(),
214 user, device_mode, device_id), 214 user,
215 device_mode,
216 device_id),
215 base::TimeDelta::FromMilliseconds(kLockRetryIntervalMs)); 217 base::TimeDelta::FromMilliseconds(kLockRetryIntervalMs));
216 lockbox_init_duration_ += kLockRetryIntervalMs; 218 lockbox_init_duration_ += kLockRetryIntervalMs;
217 } else { 219 } else {
218 ReportResult(EnrollmentStatus::ForStatus( 220 ReportResult(EnrollmentStatus::ForStatus(
219 EnrollmentStatus::STATUS_LOCK_TIMEOUT)); 221 EnrollmentStatus::STATUS_LOCK_TIMEOUT));
220 } 222 }
221 return; 223 return;
222 case EnterpriseInstallAttributes::LOCK_BACKEND_ERROR: 224 case EnterpriseInstallAttributes::LOCK_BACKEND_ERROR:
223 ReportResult(EnrollmentStatus::ForStatus( 225 ReportResult(EnrollmentStatus::ForStatus(
224 EnrollmentStatus::STATUS_LOCK_ERROR)); 226 EnrollmentStatus::STATUS_LOCK_ERROR));
(...skipping 28 matching lines...) Expand all
253 << " " << status.client_status() 255 << " " << status.client_status()
254 << " " << status.validation_status() 256 << " " << status.validation_status()
255 << " " << status.store_status(); 257 << " " << status.store_status();
256 } 258 }
257 259
258 if (!callback.is_null()) 260 if (!callback.is_null())
259 callback.Run(status); 261 callback.Run(status);
260 } 262 }
261 263
262 } // namespace policy 264 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698