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/status.h" | 5 #include "content/child/webcrypto/status.h" |
6 | 6 |
7 namespace content { | 7 namespace content { |
8 | 8 |
9 namespace webcrypto { | 9 namespace webcrypto { |
10 | 10 |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 "They key is not extractable"); | 232 "They key is not extractable"); |
233 } | 233 } |
234 | 234 |
235 Status Status::ErrorGenerateKeyLength() { | 235 Status Status::ErrorGenerateKeyLength() { |
236 return Status(blink::WebCryptoErrorTypeData, | 236 return Status(blink::WebCryptoErrorTypeData, |
237 "Invalid key length: it is either zero or not a multiple of 8 " | 237 "Invalid key length: it is either zero or not a multiple of 8 " |
238 "bits"); | 238 "bits"); |
239 } | 239 } |
240 | 240 |
241 Status Status::ErrorCreateKeyBadUsages() { | 241 Status Status::ErrorCreateKeyBadUsages() { |
242 return Status(blink::WebCryptoErrorTypeData, | 242 return Status(blink::WebCryptoErrorTypeSyntax, |
243 "Cannot create a key using the specified key usages."); | 243 "Cannot create a key using the specified key usages."); |
244 } | 244 } |
245 | 245 |
246 Status::Status(blink::WebCryptoErrorType error_type, | 246 Status::Status(blink::WebCryptoErrorType error_type, |
247 const std::string& error_details_utf8) | 247 const std::string& error_details_utf8) |
248 : type_(TYPE_ERROR), | 248 : type_(TYPE_ERROR), |
249 error_type_(error_type), | 249 error_type_(error_type), |
250 error_details_(error_details_utf8) { | 250 error_details_(error_details_utf8) { |
251 } | 251 } |
252 | 252 |
253 Status::Status(Type type) : type_(type) { | 253 Status::Status(Type type) : type_(type) { |
254 } | 254 } |
255 | 255 |
256 } // namespace webcrypto | 256 } // namespace webcrypto |
257 | 257 |
258 } // namespace content | 258 } // namespace content |
OLD | NEW |