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 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 | 9 |
10 namespace content { | 10 namespace content { |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 197 |
198 Status Status::ErrorUnsupported() { | 198 Status Status::ErrorUnsupported() { |
199 return ErrorUnsupported("The requested operation is unsupported"); | 199 return ErrorUnsupported("The requested operation is unsupported"); |
200 } | 200 } |
201 | 201 |
202 Status Status::ErrorUnsupported(const std::string& message) { | 202 Status Status::ErrorUnsupported(const std::string& message) { |
203 return Status(blink::WebCryptoErrorTypeNotSupported, message); | 203 return Status(blink::WebCryptoErrorTypeNotSupported, message); |
204 } | 204 } |
205 | 205 |
206 Status Status::ErrorUnexpected() { | 206 Status Status::ErrorUnexpected() { |
207 return Status(blink::WebCryptoErrorTypeUnknown, | 207 return Status(blink::WebCryptoErrorTypeOperation, |
208 "Something unexpected happened..."); | 208 "Something unexpected happened..."); |
209 } | 209 } |
210 | 210 |
211 Status Status::ErrorInvalidAesGcmTagLength() { | 211 Status Status::ErrorInvalidAesGcmTagLength() { |
212 return Status( | 212 return Status( |
213 blink::WebCryptoErrorTypeOperation, | 213 blink::WebCryptoErrorTypeOperation, |
214 "The tag length is invalid: Must be 32, 64, 96, 104, 112, 120, or 128 " | 214 "The tag length is invalid: Must be 32, 64, 96, 104, 112, 120, or 128 " |
215 "bits"); | 215 "bits"); |
216 } | 216 } |
217 | 217 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 error_type_(error_type), | 333 error_type_(error_type), |
334 error_details_(error_details_utf8) { | 334 error_details_(error_details_utf8) { |
335 } | 335 } |
336 | 336 |
337 Status::Status(Type type) : type_(type) { | 337 Status::Status(Type type) : type_(type) { |
338 } | 338 } |
339 | 339 |
340 } // namespace webcrypto | 340 } // namespace webcrypto |
341 | 341 |
342 } // namespace content | 342 } // namespace content |
OLD | NEW |