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 #ifndef CONTENT_CHILD_WEBCRYPTO_STATUS_H_ | 5 #ifndef CONTENT_CHILD_WEBCRYPTO_STATUS_H_ |
6 #define CONTENT_CHILD_WEBCRYPTO_STATUS_H_ | 6 #define CONTENT_CHILD_WEBCRYPTO_STATUS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 #include "third_party/WebKit/public/platform/WebCrypto.h" | 10 #include "third_party/WebKit/public/platform/WebCrypto.h" |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
254 static Status ErrorEcdhCurveMismatch(); | 254 static Status ErrorEcdhCurveMismatch(); |
255 | 255 |
256 // The requested bit length for ECDH key derivation was too large. | 256 // The requested bit length for ECDH key derivation was too large. |
257 static Status ErrorEcdhLengthTooBig(unsigned int max_length_bits); | 257 static Status ErrorEcdhLengthTooBig(unsigned int max_length_bits); |
258 | 258 |
259 // The requested length for HKDF was too large. | 259 // The requested length for HKDF was too large. |
260 static Status ErrorHkdfLengthTooLong(); | 260 static Status ErrorHkdfLengthTooLong(); |
261 | 261 |
262 // No length parameter was provided for HKDF's Derive Bits operation. | 262 // No length parameter was provided for HKDF's Derive Bits operation. |
263 static Status ErrorHkdfDeriveBitsLengthNotSpecified(); | 263 static Status ErrorHkdfDeriveBitsLengthNotSpecified(); |
264 // The requested bit length for PBKDF2 key derivation was invalid. | |
eroman
2015/01/14 20:44:58
nit: Add a newline separating from previous line.
xun.sun
2015/01/15 17:21:17
Done.
| |
265 static Status ErrorPbkdf2InvalidLength(); | |
266 | |
267 // No length parameter was provided for PBKDF2's Derive Bits operation. | |
268 static Status ErrorPbkdf2DeriveBitsLengthNotSpecified(); | |
264 | 269 |
265 private: | 270 private: |
266 enum Type { TYPE_ERROR, TYPE_SUCCESS }; | 271 enum Type { TYPE_ERROR, TYPE_SUCCESS }; |
267 | 272 |
268 // Constructs an error with the specified error type and message. | 273 // Constructs an error with the specified error type and message. |
269 Status(blink::WebCryptoErrorType error_type, | 274 Status(blink::WebCryptoErrorType error_type, |
270 const std::string& error_details_utf8); | 275 const std::string& error_details_utf8); |
271 | 276 |
272 // Constructs a success or error without any details. | 277 // Constructs a success or error without any details. |
273 explicit Status(Type type); | 278 explicit Status(Type type); |
274 | 279 |
275 Type type_; | 280 Type type_; |
276 blink::WebCryptoErrorType error_type_; | 281 blink::WebCryptoErrorType error_type_; |
277 std::string error_details_; | 282 std::string error_details_; |
278 }; | 283 }; |
279 | 284 |
280 } // namespace webcrypto | 285 } // namespace webcrypto |
281 | 286 |
282 } // namespace content | 287 } // namespace content |
283 | 288 |
284 #endif // CONTENT_CHILD_WEBCRYPTO_STATUS_H_ | 289 #endif // CONTENT_CHILD_WEBCRYPTO_STATUS_H_ |
OLD | NEW |