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