OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/renderer/webcrypto/webcrypto_impl.h" | 5 #include "content/child/webcrypto/webcrypto_impl.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "content/renderer/webcrypto/crypto_data.h" | 8 #include "content/child/webcrypto/crypto_data.h" |
9 #include "content/renderer/webcrypto/shared_crypto.h" | 9 #include "content/child/webcrypto/shared_crypto.h" |
10 #include "content/renderer/webcrypto/webcrypto_util.h" | 10 #include "content/child/webcrypto/webcrypto_util.h" |
| 11 #include "third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h" |
11 #include "third_party/WebKit/public/platform/WebString.h" | 12 #include "third_party/WebKit/public/platform/WebString.h" |
12 #include "third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h" | |
13 | 13 |
14 namespace content { | 14 namespace content { |
15 | 15 |
16 using webcrypto::Status; | 16 using webcrypto::Status; |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 void CompleteWithError(const Status& status, blink::WebCryptoResult* result) { | 20 void CompleteWithError(const Status& status, blink::WebCryptoResult* result) { |
21 DCHECK(status.IsError()); | 21 DCHECK(status.IsError()); |
22 if (status.HasErrorDetails()) | 22 if (status.HasErrorDetails()) |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 unsigned int data_size, | 201 unsigned int data_size, |
202 blink::WebArrayBuffer& result) { | 202 blink::WebArrayBuffer& result) { |
203 blink::WebCryptoAlgorithm algorithm = | 203 blink::WebCryptoAlgorithm algorithm = |
204 blink::WebCryptoAlgorithm::adoptParamsAndCreate(algorithm_id, NULL); | 204 blink::WebCryptoAlgorithm::adoptParamsAndCreate(algorithm_id, NULL); |
205 return (webcrypto::Digest( | 205 return (webcrypto::Digest( |
206 algorithm, webcrypto::CryptoData(data, data_size), &result)) | 206 algorithm, webcrypto::CryptoData(data, data_size), &result)) |
207 .IsSuccess(); | 207 .IsSuccess(); |
208 } | 208 } |
209 | 209 |
210 } // namespace content | 210 } // namespace content |
OLD | NEW |