Chromium Code Reviews| Index: third_party/WebKit/public/platform/WebCrypto.h |
| diff --git a/third_party/WebKit/public/platform/WebCrypto.h b/third_party/WebKit/public/platform/WebCrypto.h |
| index cfd49c5ad5a3c8072bc92b61d489d784d954ac48..ba3d98fa80b84d97ef133c85792cba2943508fe8 100644 |
| --- a/third_party/WebKit/public/platform/WebCrypto.h |
| +++ b/third_party/WebKit/public/platform/WebCrypto.h |
| @@ -172,10 +172,8 @@ public: |
| // Inputs |
| // ----------------------- |
| // |
| - // * Data buffers are passed as (basePointer, byteLength) pairs. |
| - // These buffers are only valid during the call itself. Asynchronous |
| - // implementations wishing to access it after the function returns |
| - // should make a copy. |
| + // * Data buffers are transfered as WebVectors. Implementations are free |
| + // to re-use or transfer their storage. |
| // |
| // * All WebCryptoKeys are guaranteeed to be !isNull(). |
| // |
| @@ -200,16 +198,16 @@ public: |
| // * The key usages permit the operation being requested. |
| // * The key's algorithm matches that of the requested operation. |
| // |
| - virtual void encrypt(const WebCryptoAlgorithm&, const WebCryptoKey&, const unsigned char* data, unsigned dataSize, WebCryptoResult result) { result.completeWithError(WebCryptoErrorTypeNotSupported, ""); } |
| - virtual void decrypt(const WebCryptoAlgorithm&, const WebCryptoKey&, const unsigned char* data, unsigned dataSize, WebCryptoResult result) { result.completeWithError(WebCryptoErrorTypeNotSupported, ""); } |
| - virtual void sign(const WebCryptoAlgorithm&, const WebCryptoKey&, const unsigned char* data, unsigned dataSize, WebCryptoResult result) { result.completeWithError(WebCryptoErrorTypeNotSupported, ""); } |
| - virtual void verifySignature(const WebCryptoAlgorithm&, const WebCryptoKey&, const unsigned char* signature, unsigned signatureSize, const unsigned char* data, unsigned dataSize, WebCryptoResult result) { result.completeWithError(WebCryptoErrorTypeNotSupported, ""); } |
| - virtual void digest(const WebCryptoAlgorithm&, const unsigned char* data, unsigned dataSize, WebCryptoResult result) { result.completeWithError(WebCryptoErrorTypeNotSupported, ""); } |
| + virtual void encrypt(const WebCryptoAlgorithm&, const WebCryptoKey&, WebVector<unsigned char> data, WebCryptoResult result) { result.completeWithError(WebCryptoErrorTypeNotSupported, ""); } |
|
jochen (gone - plz use gerrit)
2016/07/19 12:27:40
why not WebVector<unsigned char>&
eroman
2016/07/19 16:17:41
My preference for pass-by-value is:
* Makes it c
|
| + virtual void decrypt(const WebCryptoAlgorithm&, const WebCryptoKey&, WebVector<unsigned char> data, WebCryptoResult result) { result.completeWithError(WebCryptoErrorTypeNotSupported, ""); } |
| + virtual void sign(const WebCryptoAlgorithm&, const WebCryptoKey&, WebVector<unsigned char> data, WebCryptoResult result) { result.completeWithError(WebCryptoErrorTypeNotSupported, ""); } |
| + virtual void verifySignature(const WebCryptoAlgorithm&, const WebCryptoKey&, WebVector<unsigned char> signature, WebVector<unsigned char> data, WebCryptoResult result) { result.completeWithError(WebCryptoErrorTypeNotSupported, ""); } |
| + virtual void digest(const WebCryptoAlgorithm&, WebVector<unsigned char> data, WebCryptoResult result) { result.completeWithError(WebCryptoErrorTypeNotSupported, ""); } |
| virtual void generateKey(const WebCryptoAlgorithm&, bool extractable, WebCryptoKeyUsageMask, WebCryptoResult result) { result.completeWithError(WebCryptoErrorTypeNotSupported, ""); } |
| - virtual void importKey(WebCryptoKeyFormat, const unsigned char* keyData, unsigned keyDataSize, const WebCryptoAlgorithm&, bool extractable, WebCryptoKeyUsageMask, WebCryptoResult result) { result.completeWithError(WebCryptoErrorTypeNotSupported, ""); } |
| + virtual void importKey(WebCryptoKeyFormat, WebVector<unsigned char> keyData, const WebCryptoAlgorithm&, bool extractable, WebCryptoKeyUsageMask, WebCryptoResult result) { result.completeWithError(WebCryptoErrorTypeNotSupported, ""); } |
| virtual void exportKey(WebCryptoKeyFormat, const WebCryptoKey&, WebCryptoResult result) { result.completeWithError(WebCryptoErrorTypeNotSupported, ""); } |
| virtual void wrapKey(WebCryptoKeyFormat, const WebCryptoKey& key, const WebCryptoKey& wrappingKey, const WebCryptoAlgorithm&, WebCryptoResult result) { result.completeWithError(WebCryptoErrorTypeNotSupported, ""); } |
| - virtual void unwrapKey(WebCryptoKeyFormat, const unsigned char* wrappedKey, unsigned wrappedKeySize, const WebCryptoKey&, const WebCryptoAlgorithm& unwrapAlgorithm, const WebCryptoAlgorithm& unwrappedKeyAlgorithm, bool extractable, WebCryptoKeyUsageMask, WebCryptoResult result) { result.completeWithError(WebCryptoErrorTypeNotSupported, ""); } |
| + virtual void unwrapKey(WebCryptoKeyFormat, WebVector<unsigned char> wrappedKey, const WebCryptoKey&, const WebCryptoAlgorithm& unwrapAlgorithm, const WebCryptoAlgorithm& unwrappedKeyAlgorithm, bool extractable, WebCryptoKeyUsageMask, WebCryptoResult result) { result.completeWithError(WebCryptoErrorTypeNotSupported, ""); } |
| virtual void deriveBits(const WebCryptoAlgorithm&, const WebCryptoKey&, unsigned length, WebCryptoResult result) { result.completeWithError(WebCryptoErrorTypeNotSupported, ""); } |
| virtual void deriveKey(const WebCryptoAlgorithm& algorithm, const WebCryptoKey& baseKey, const WebCryptoAlgorithm& importAlgorithm, const WebCryptoAlgorithm& keyLengthAlgorithm, bool extractable, WebCryptoKeyUsageMask, WebCryptoResult result) { result.completeWithError(WebCryptoErrorTypeNotSupported, ""); } |