OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chromeos/tpm/tpm_token_info_getter.h" | 5 #include "chromeos/tpm/tpm_token_info_getter.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
| 11 #include "base/task_runner.h" |
11 #include "chromeos/cryptohome/cryptohome_parameters.h" | 12 #include "chromeos/cryptohome/cryptohome_parameters.h" |
12 #include "chromeos/dbus/cryptohome_client.h" | 13 #include "chromeos/dbus/cryptohome_client.h" |
13 | 14 |
14 namespace { | 15 namespace { |
15 | 16 |
16 const int64_t kInitialRequestDelayMs = 100; | 17 const int64_t kInitialRequestDelayMs = 100; |
17 const int64_t kMaxRequestDelayMs = 300000; // 5 minutes | 18 const int64_t kMaxRequestDelayMs = 300000; // 5 minutes |
18 | 19 |
19 // Calculates the delay before running next attempt to initiatialize the TPM | 20 // Calculates the delay before running next attempt to initiatialize the TPM |
20 // token, if |last_delay| was the last or initial delay. | 21 // token, if |last_delay| was the last or initial delay. |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 TPMTokenInfo token_info; | 154 TPMTokenInfo token_info; |
154 token_info.tpm_is_enabled = true; | 155 token_info.tpm_is_enabled = true; |
155 token_info.token_name = token_name; | 156 token_info.token_name = token_name; |
156 token_info.user_pin = user_pin; | 157 token_info.user_pin = user_pin; |
157 token_info.token_slot_id = token_slot_id; | 158 token_info.token_slot_id = token_slot_id; |
158 | 159 |
159 callback_.Run(token_info); | 160 callback_.Run(token_info); |
160 } | 161 } |
161 | 162 |
162 } // namespace chromeos | 163 } // namespace chromeos |
OLD | NEW |