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 "content/child/webcrypto/webcrypto_impl.h" | 5 #include "components/webcrypto/webcrypto_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/single_thread_task_runner.h" | 12 #include "base/single_thread_task_runner.h" |
13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
14 #include "base/task_runner.h" | 14 #include "base/task_runner.h" |
15 #include "base/thread_task_runner_handle.h" | 15 #include "base/thread_task_runner_handle.h" |
16 #include "base/threading/sequenced_worker_pool.h" | 16 #include "base/threading/sequenced_worker_pool.h" |
17 #include "base/threading/worker_pool.h" | 17 #include "base/threading/worker_pool.h" |
18 #include "content/child/webcrypto/algorithm_dispatch.h" | 18 #include "components/webcrypto/algorithm_dispatch.h" |
19 #include "content/child/webcrypto/crypto_data.h" | 19 #include "components/webcrypto/crypto_data.h" |
20 #include "content/child/webcrypto/generate_key_result.h" | 20 #include "components/webcrypto/generate_key_result.h" |
21 #include "content/child/webcrypto/status.h" | 21 #include "components/webcrypto/status.h" |
22 #include "content/child/webcrypto/webcrypto_util.h" | 22 #include "components/webcrypto/webcrypto_util.h" |
23 #include "third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h" | 23 #include "third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h" |
24 #include "third_party/WebKit/public/platform/WebString.h" | 24 #include "third_party/WebKit/public/platform/WebString.h" |
25 | 25 |
26 namespace content { | 26 namespace webcrypto { |
27 | 27 |
28 using webcrypto::Status; | 28 using webcrypto::Status; |
29 | 29 |
30 namespace { | 30 namespace { |
31 | 31 |
32 // --------------------- | 32 // --------------------- |
33 // Threading | 33 // Threading |
34 // --------------------- | 34 // --------------------- |
35 // | 35 // |
36 // WebCrypto operations can be slow. For instance generating an RSA key can | 36 // WebCrypto operations can be slow. For instance generating an RSA key can |
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
781 algorithm, type, extractable, usages, | 781 algorithm, type, extractable, usages, |
782 webcrypto::CryptoData(key_data, key_data_size), &key); | 782 webcrypto::CryptoData(key_data, key_data_size), &key); |
783 } | 783 } |
784 | 784 |
785 bool WebCryptoImpl::serializeKeyForClone( | 785 bool WebCryptoImpl::serializeKeyForClone( |
786 const blink::WebCryptoKey& key, | 786 const blink::WebCryptoKey& key, |
787 blink::WebVector<unsigned char>& key_data) { | 787 blink::WebVector<unsigned char>& key_data) { |
788 return webcrypto::SerializeKeyForClone(key, &key_data); | 788 return webcrypto::SerializeKeyForClone(key, &key_data); |
789 } | 789 } |
790 | 790 |
791 } // namespace content | 791 } // namespace webcrypto |
OLD | NEW |