| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/login/cryptohome_op.h" | 5 #include "chrome/browser/chromeos/login/cryptohome_op.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "chrome/browser/chromeos/boot_times_loader.h" | 10 #include "chrome/browser/chromeos/boot_times_loader.h" |
| 11 #include "chrome/browser/chromeos/cros/cros_library.h" | 11 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 12 #include "chrome/browser/chromeos/cros/cryptohome_library.h" | 12 #include "chrome/browser/chromeos/cros/cryptohome_library.h" |
| 13 #include "chrome/browser/chromeos/login/auth_attempt_state.h" | 13 #include "chrome/browser/chromeos/login/auth_attempt_state.h" |
| 14 #include "chrome/browser/chromeos/login/auth_attempt_state_resolver.h" | 14 #include "chrome/browser/chromeos/login/auth_attempt_state_resolver.h" |
| 15 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
| 16 | 16 |
| 17 using content::BrowserThread; | 17 using content::BrowserThread; |
| 18 | 18 |
| 19 namespace chromeos { | 19 namespace chromeos { |
| 20 | 20 |
| 21 CryptohomeOp::CryptohomeOp(AuthAttemptState* current_attempt, | 21 CryptohomeOp::CryptohomeOp(AuthAttemptState* current_attempt, |
| 22 AuthAttemptStateResolver* callback) | 22 AuthAttemptStateResolver* callback) |
| 23 : attempt_(current_attempt), | 23 : attempt_(current_attempt), |
| 24 resolver_(callback) { | 24 resolver_(callback) { |
| 25 CHECK(chromeos::CrosLibrary::Get()->EnsureLoaded()); | |
| 26 } | 25 } |
| 27 | 26 |
| 28 CryptohomeOp::~CryptohomeOp() {} | 27 CryptohomeOp::~CryptohomeOp() {} |
| 29 | 28 |
| 30 void CryptohomeOp::OnComplete(bool success, int return_code) { | 29 void CryptohomeOp::OnComplete(bool success, int return_code) { |
| 31 chromeos::BootTimesLoader::Get()->AddLoginTimeMarker( | 30 chromeos::BootTimesLoader::Get()->AddLoginTimeMarker( |
| 32 "CryptohomeMount-End", false); | 31 "CryptohomeMount-End", false); |
| 33 BrowserThread::PostTask( | 32 BrowserThread::PostTask( |
| 34 BrowserThread::IO, FROM_HERE, | 33 BrowserThread::IO, FROM_HERE, |
| 35 base::Bind(&CryptohomeOp::TriggerResolve, this, success, return_code)); | 34 base::Bind(&CryptohomeOp::TriggerResolve, this, success, return_code)); |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 | 188 |
| 190 // static | 189 // static |
| 191 CryptohomeOp* CryptohomeOp::CreateCheckKeyAttempt( | 190 CryptohomeOp* CryptohomeOp::CreateCheckKeyAttempt( |
| 192 AuthAttemptState* current_attempt, | 191 AuthAttemptState* current_attempt, |
| 193 AuthAttemptStateResolver* callback) { | 192 AuthAttemptStateResolver* callback) { |
| 194 | 193 |
| 195 return new CheckKeyAttempt(current_attempt, callback); | 194 return new CheckKeyAttempt(current_attempt, callback); |
| 196 } | 195 } |
| 197 | 196 |
| 198 } // namespace chromeos | 197 } // namespace chromeos |
| OLD | NEW |