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/structured_clone.h" | 5 #include "content/child/webcrypto/structured_clone.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "content/child/webcrypto/algorithm_dispatch.h" | 8 #include "content/child/webcrypto/algorithm_dispatch.h" |
9 #include "content/child/webcrypto/platform_crypto.h" | 9 #include "content/child/webcrypto/platform_crypto.h" |
10 #include "content/child/webcrypto/status.h" | 10 #include "content/child/webcrypto/status.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 return false; | 94 return false; |
95 } | 95 } |
96 | 96 |
97 return true; | 97 return true; |
98 } | 98 } |
99 | 99 |
100 } // namespace | 100 } // namespace |
101 | 101 |
102 // Note that this function is called from the target Blink thread. | 102 // Note that this function is called from the target Blink thread. |
103 bool SerializeKeyForClone(const blink::WebCryptoKey& key, | 103 bool SerializeKeyForClone(const blink::WebCryptoKey& key, |
104 blink::WebVector<uint8>* key_data) { | 104 blink::WebVector<uint8_t>* key_data) { |
105 return PlatformSerializeKeyForClone(key, key_data); | 105 return PlatformSerializeKeyForClone(key, key_data); |
106 } | 106 } |
107 | 107 |
108 // Note that this function is called from the target Blink thread. | 108 // Note that this function is called from the target Blink thread. |
109 bool DeserializeKeyForClone(const blink::WebCryptoKeyAlgorithm& algorithm, | 109 bool DeserializeKeyForClone(const blink::WebCryptoKeyAlgorithm& algorithm, |
110 blink::WebCryptoKeyType type, | 110 blink::WebCryptoKeyType type, |
111 bool extractable, | 111 bool extractable, |
112 blink::WebCryptoKeyUsageMask usage_mask, | 112 blink::WebCryptoKeyUsageMask usage_mask, |
113 const CryptoData& key_data, | 113 const CryptoData& key_data, |
114 blink::WebCryptoKey* key) { | 114 blink::WebCryptoKey* key) { |
(...skipping 12 matching lines...) Expand all Loading... |
127 usage_mask, | 127 usage_mask, |
128 key); | 128 key); |
129 if (status.IsError()) | 129 if (status.IsError()) |
130 return false; | 130 return false; |
131 return ValidateDeserializedKey(*key, algorithm, type); | 131 return ValidateDeserializedKey(*key, algorithm, type); |
132 } | 132 } |
133 | 133 |
134 } // namespace webcrypto | 134 } // namespace webcrypto |
135 | 135 |
136 } // namespace content | 136 } // namespace content |
OLD | NEW |