| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef WebCryptoAlgorithm_h | 31 #ifndef WebCryptoAlgorithm_h |
| 32 #define WebCryptoAlgorithm_h | 32 #define WebCryptoAlgorithm_h |
| 33 | 33 |
| 34 #include "WebCommon.h" | 34 #include "WebCommon.h" |
| 35 #include "WebPrivatePtr.h" | 35 #include "WebPrivatePtr.h" |
| 36 | 36 |
| 37 #if INSIDE_BLINK | 37 #if INSIDE_BLINK |
| 38 #include <memory> | 38 #include "wtf/PassOwnPtr.h" |
| 39 #endif | 39 #endif |
| 40 | 40 |
| 41 namespace blink { | 41 namespace blink { |
| 42 | 42 |
| 43 enum WebCryptoOperation { | 43 enum WebCryptoOperation { |
| 44 WebCryptoOperationEncrypt, | 44 WebCryptoOperationEncrypt, |
| 45 WebCryptoOperationDecrypt, | 45 WebCryptoOperationDecrypt, |
| 46 WebCryptoOperationSign, | 46 WebCryptoOperationSign, |
| 47 WebCryptoOperationVerify, | 47 WebCryptoOperationVerify, |
| 48 WebCryptoOperationDigest, | 48 WebCryptoOperationDigest, |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 // * Immutable | 146 // * Immutable |
| 147 // * Threadsafe | 147 // * Threadsafe |
| 148 // * Copiable (cheaply) | 148 // * Copiable (cheaply) |
| 149 // | 149 // |
| 150 // If WebCryptoAlgorithm "isNull()" then it is invalid to call any of the other | 150 // If WebCryptoAlgorithm "isNull()" then it is invalid to call any of the other |
| 151 // methods on it (other than destruction, assignment, or isNull()). | 151 // methods on it (other than destruction, assignment, or isNull()). |
| 152 class WebCryptoAlgorithm { | 152 class WebCryptoAlgorithm { |
| 153 public: | 153 public: |
| 154 #if INSIDE_BLINK | 154 #if INSIDE_BLINK |
| 155 WebCryptoAlgorithm() { } | 155 WebCryptoAlgorithm() { } |
| 156 BLINK_PLATFORM_EXPORT WebCryptoAlgorithm(WebCryptoAlgorithmId, std::unique_p
tr<WebCryptoAlgorithmParams>); | 156 BLINK_PLATFORM_EXPORT WebCryptoAlgorithm(WebCryptoAlgorithmId, PassOwnPtr<We
bCryptoAlgorithmParams>); |
| 157 #endif | 157 #endif |
| 158 | 158 |
| 159 BLINK_PLATFORM_EXPORT static WebCryptoAlgorithm createNull(); | 159 BLINK_PLATFORM_EXPORT static WebCryptoAlgorithm createNull(); |
| 160 BLINK_PLATFORM_EXPORT static WebCryptoAlgorithm adoptParamsAndCreate(WebCryp
toAlgorithmId, WebCryptoAlgorithmParams*); | 160 BLINK_PLATFORM_EXPORT static WebCryptoAlgorithm adoptParamsAndCreate(WebCryp
toAlgorithmId, WebCryptoAlgorithmParams*); |
| 161 | 161 |
| 162 // Returns a WebCryptoAlgorithmInfo for the algorithm with the given ID. If | 162 // Returns a WebCryptoAlgorithmInfo for the algorithm with the given ID. If |
| 163 // the ID is invalid, return 0. The caller can assume the pointer will be | 163 // the ID is invalid, return 0. The caller can assume the pointer will be |
| 164 // valid for the program's entire runtime. | 164 // valid for the program's entire runtime. |
| 165 BLINK_PLATFORM_EXPORT static const WebCryptoAlgorithmInfo* lookupAlgorithmIn
fo(WebCryptoAlgorithmId); | 165 BLINK_PLATFORM_EXPORT static const WebCryptoAlgorithmInfo* lookupAlgorithmIn
fo(WebCryptoAlgorithmId); |
| 166 | 166 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 private: | 207 private: |
| 208 BLINK_PLATFORM_EXPORT void assign(const WebCryptoAlgorithm& other); | 208 BLINK_PLATFORM_EXPORT void assign(const WebCryptoAlgorithm& other); |
| 209 BLINK_PLATFORM_EXPORT void reset(); | 209 BLINK_PLATFORM_EXPORT void reset(); |
| 210 | 210 |
| 211 WebPrivatePtr<WebCryptoAlgorithmPrivate> m_private; | 211 WebPrivatePtr<WebCryptoAlgorithmPrivate> m_private; |
| 212 }; | 212 }; |
| 213 | 213 |
| 214 } // namespace blink | 214 } // namespace blink |
| 215 | 215 |
| 216 #endif | 216 #endif |
| OLD | NEW |