| 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 "chrome/browser/extensions/api/networking_private/crypto_verify_impl.h" | 5 #include "chrome/browser/extensions/api/networking_private/crypto_verify_impl.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/sequenced_task_runner.h" | 10 #include "base/sequenced_task_runner.h" |
| 11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
| 12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
| 13 #include "base/thread_task_runner_handle.h" | 13 #include "base/thread_task_runner_handle.h" |
| 14 #include "base/threading/sequenced_worker_pool.h" | 14 #include "base/threading/sequenced_worker_pool.h" |
| 15 #include "chrome/browser/extensions/api/networking_private/networking_private_ap
i.h" | |
| 16 #include "chrome/browser/extensions/api/networking_private/networking_private_cr
edentials_getter.h" | 15 #include "chrome/browser/extensions/api/networking_private/networking_private_cr
edentials_getter.h" |
| 17 #include "chrome/browser/extensions/api/networking_private/networking_private_se
rvice_client.h" | |
| 18 #include "chrome/common/extensions/api/networking_private.h" | |
| 19 #include "chrome/common/extensions/api/networking_private/networking_private_cry
pto.h" | 16 #include "chrome/common/extensions/api/networking_private/networking_private_cry
pto.h" |
| 20 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
| 18 #include "extensions/browser/api/networking_private/networking_private_api.h" |
| 19 #include "extensions/browser/api/networking_private/networking_private_service_c
lient.h" |
| 20 #include "extensions/common/api/networking_private.h" |
| 21 | 21 |
| 22 namespace extensions { | 22 namespace extensions { |
| 23 | 23 |
| 24 namespace { | 24 namespace { |
| 25 | 25 |
| 26 const char kCryptoVerifySequenceTokenName[] = "CryptoVerify"; | 26 const char kCryptoVerifySequenceTokenName[] = "CryptoVerify"; |
| 27 | 27 |
| 28 // Called from a blocking pool task runner. Returns true and sets |verified| if | 28 // Called from a blocking pool task runner. Returns true and sets |verified| if |
| 29 // able to decode the credentials, otherwise sets |verified| to false and | 29 // able to decode the credentials, otherwise sets |verified| to false and |
| 30 // returns false. | 30 // returns false. |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 228 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 229 Credentials credentials(verification_properties); | 229 Credentials credentials(verification_properties); |
| 230 base::PostTaskAndReplyWithResult( | 230 base::PostTaskAndReplyWithResult( |
| 231 blocking_pool_task_runner_.get(), FROM_HERE, | 231 blocking_pool_task_runner_.get(), FROM_HERE, |
| 232 base::Bind(&DoVerifyAndEncryptData, credentials, data), | 232 base::Bind(&DoVerifyAndEncryptData, credentials, data), |
| 233 base::Bind(&VerifyAndEncryptDataCompleted, success_callback, | 233 base::Bind(&VerifyAndEncryptDataCompleted, success_callback, |
| 234 failure_callback)); | 234 failure_callback)); |
| 235 } | 235 } |
| 236 | 236 |
| 237 } // namespace extensions | 237 } // namespace extensions |
| OLD | NEW |