| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 "The JWK \"k\" property did not include the right length " | 115 "The JWK \"k\" property did not include the right length " |
| 116 "of key data for the given algorithm."); | 116 "of key data for the given algorithm."); |
| 117 } | 117 } |
| 118 | 118 |
| 119 Status Status::ErrorImportEmptyKeyData() { | 119 Status Status::ErrorImportEmptyKeyData() { |
| 120 return Status(blink::WebCryptoErrorTypeData, "No key data was provided"); | 120 return Status(blink::WebCryptoErrorTypeData, "No key data was provided"); |
| 121 } | 121 } |
| 122 | 122 |
| 123 Status Status::ErrorImportAesKeyLength() { | 123 Status Status::ErrorImportAesKeyLength() { |
| 124 return Status(blink::WebCryptoErrorTypeData, | 124 return Status(blink::WebCryptoErrorTypeData, |
| 125 #if defined(WEBCRYPTO_HAS_ERROR_TYPE) | |
| 126 "AES key data must be 128, 192 or 256 bits"); | 125 "AES key data must be 128, 192 or 256 bits"); |
| 127 #else | |
| 128 ""); | |
| 129 #endif | |
| 130 } | 126 } |
| 131 | 127 |
| 132 Status Status::ErrorUnexpectedKeyType() { | 128 Status Status::ErrorUnexpectedKeyType() { |
| 133 return Status(blink::WebCryptoErrorTypeInvalidAccess, | 129 return Status(blink::WebCryptoErrorTypeInvalidAccess, |
| 134 "The key is not of the expected type"); | 130 "The key is not of the expected type"); |
| 135 } | 131 } |
| 136 | 132 |
| 137 Status Status::ErrorIncorrectSizeAesCbcIv() { | 133 Status Status::ErrorIncorrectSizeAesCbcIv() { |
| 138 return Status(blink::WebCryptoErrorTypeData, | 134 return Status(blink::WebCryptoErrorTypeData, |
| 139 "The \"iv\" has an unexpected length -- must be 16 bytes"); | 135 "The \"iv\" has an unexpected length -- must be 16 bytes"); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 error_type_(error_type), | 204 error_type_(error_type), |
| 209 error_details_(error_details_utf8) { | 205 error_details_(error_details_utf8) { |
| 210 } | 206 } |
| 211 | 207 |
| 212 Status::Status(Type type) : type_(type) { | 208 Status::Status(Type type) : type_(type) { |
| 213 } | 209 } |
| 214 | 210 |
| 215 } // namespace webcrypto | 211 } // namespace webcrypto |
| 216 | 212 |
| 217 } // namespace content | 213 } // namespace content |
| OLD | NEW |