OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/dm_token_storage.h" | 5 #include "chrome/browser/chromeos/policy/dm_token_storage.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/threading/sequenced_worker_pool.h" |
8 #include "chrome/browser/chromeos/settings/token_encryptor.h" | 9 #include "chrome/browser/chromeos/settings/token_encryptor.h" |
9 #include "chrome/common/pref_names.h" | 10 #include "chrome/common/pref_names.h" |
10 #include "chromeos/cryptohome/system_salt_getter.h" | 11 #include "chromeos/cryptohome/system_salt_getter.h" |
11 #include "components/prefs/pref_registry_simple.h" | 12 #include "components/prefs/pref_registry_simple.h" |
12 #include "components/prefs/pref_service.h" | 13 #include "components/prefs/pref_service.h" |
13 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
14 | 15 |
15 namespace { | 16 namespace { |
16 | 17 |
17 std::string EncryptToken(const std::string& system_salt, | 18 std::string EncryptToken(const std::string& system_salt, |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 return; | 176 return; |
176 if (dm_token.empty()) | 177 if (dm_token.empty()) |
177 DLOG(ERROR) << "Failed to retrieve DM token."; | 178 DLOG(ERROR) << "Failed to retrieve DM token."; |
178 std::vector<RetrieveCallback> callbacks; | 179 std::vector<RetrieveCallback> callbacks; |
179 callbacks.swap(retrieve_callbacks_); | 180 callbacks.swap(retrieve_callbacks_); |
180 for (RetrieveCallback& callback : callbacks) | 181 for (RetrieveCallback& callback : callbacks) |
181 std::move(callback).Run(dm_token); | 182 std::move(callback).Run(dm_token); |
182 } | 183 } |
183 | 184 |
184 } // namespace policy | 185 } // namespace policy |
OLD | NEW |