OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/attestation/attestation_policy_observer.h" | 5 #include "chrome/browser/chromeos/attestation/attestation_policy_observer.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 // We expect a registered CloudPolicyClient. | 151 // We expect a registered CloudPolicyClient. |
152 if (!policy_client_->is_registered()) { | 152 if (!policy_client_->is_registered()) { |
153 LOG(ERROR) << "AttestationPolicyObserver: Invalid CloudPolicyClient."; | 153 LOG(ERROR) << "AttestationPolicyObserver: Invalid CloudPolicyClient."; |
154 return; | 154 return; |
155 } | 155 } |
156 | 156 |
157 if (!cryptohome_client_) | 157 if (!cryptohome_client_) |
158 cryptohome_client_ = DBusThreadManager::Get()->GetCryptohomeClient(); | 158 cryptohome_client_ = DBusThreadManager::Get()->GetCryptohomeClient(); |
159 | 159 |
160 if (!attestation_flow_) { | 160 if (!attestation_flow_) { |
161 scoped_ptr<ServerProxy> attestation_ca_client(new AttestationCAClient()); | 161 std::unique_ptr<ServerProxy> attestation_ca_client( |
| 162 new AttestationCAClient()); |
162 default_attestation_flow_.reset(new AttestationFlow( | 163 default_attestation_flow_.reset(new AttestationFlow( |
163 cryptohome::AsyncMethodCaller::GetInstance(), cryptohome_client_, | 164 cryptohome::AsyncMethodCaller::GetInstance(), cryptohome_client_, |
164 std::move(attestation_ca_client))); | 165 std::move(attestation_ca_client))); |
165 attestation_flow_ = default_attestation_flow_.get(); | 166 attestation_flow_ = default_attestation_flow_.get(); |
166 } | 167 } |
167 | 168 |
168 // Start a dbus call to check if an Enterprise Machine Key already exists. | 169 // Start a dbus call to check if an Enterprise Machine Key already exists. |
169 base::Closure on_does_exist = | 170 base::Closure on_does_exist = |
170 base::Bind(&AttestationPolicyObserver::GetExistingCertificate, | 171 base::Bind(&AttestationPolicyObserver::GetExistingCertificate, |
171 weak_factory_.GetWeakPtr()); | 172 weak_factory_.GetWeakPtr()); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 base::Bind(&AttestationPolicyObserver::Start, | 314 base::Bind(&AttestationPolicyObserver::Start, |
314 weak_factory_.GetWeakPtr()), | 315 weak_factory_.GetWeakPtr()), |
315 base::TimeDelta::FromSeconds(retry_delay_)); | 316 base::TimeDelta::FromSeconds(retry_delay_)); |
316 } else { | 317 } else { |
317 LOG(WARNING) << "AttestationPolicyObserver: Retry limit exceeded."; | 318 LOG(WARNING) << "AttestationPolicyObserver: Retry limit exceeded."; |
318 } | 319 } |
319 } | 320 } |
320 | 321 |
321 } // namespace attestation | 322 } // namespace attestation |
322 } // namespace chromeos | 323 } // namespace chromeos |
OLD | NEW |