| 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 return Status(blink::WebCryptoErrorTypeInvalidAccess, | 191 return Status(blink::WebCryptoErrorTypeInvalidAccess, |
| 192 "They key is not extractable"); | 192 "They key is not extractable"); |
| 193 } | 193 } |
| 194 | 194 |
| 195 Status Status::ErrorGenerateKeyLength() { | 195 Status Status::ErrorGenerateKeyLength() { |
| 196 return Status(blink::WebCryptoErrorTypeData, | 196 return Status(blink::WebCryptoErrorTypeData, |
| 197 "Invalid key length: it is either zero or not a multiple of 8 " | 197 "Invalid key length: it is either zero or not a multiple of 8 " |
| 198 "bits"); | 198 "bits"); |
| 199 } | 199 } |
| 200 | 200 |
| 201 Status Status::ErrorCreateKeyBadUsages() { |
| 202 return Status(blink::WebCryptoErrorTypeData, |
| 203 "Cannot create a key using the specified key usages."); |
| 204 } |
| 205 |
| 201 Status::Status(blink::WebCryptoErrorType error_type, | 206 Status::Status(blink::WebCryptoErrorType error_type, |
| 202 const std::string& error_details_utf8) | 207 const std::string& error_details_utf8) |
| 203 : type_(TYPE_ERROR), | 208 : type_(TYPE_ERROR), |
| 204 error_type_(error_type), | 209 error_type_(error_type), |
| 205 error_details_(error_details_utf8) { | 210 error_details_(error_details_utf8) { |
| 206 } | 211 } |
| 207 | 212 |
| 208 Status::Status(Type type) : type_(type) { | 213 Status::Status(Type type) : type_(type) { |
| 209 } | 214 } |
| 210 | 215 |
| 211 } // namespace webcrypto | 216 } // namespace webcrypto |
| 212 | 217 |
| 213 } // namespace content | 218 } // namespace content |
| OLD | NEW |