Index: public/platform/WebCrypto.h |
diff --git a/public/platform/WebCrypto.h b/public/platform/WebCrypto.h |
index 7b56f4ef7bfd391eb1f6af186fb6449b04f3d94d..8834d7e4ba8e1f3699f58bce8438197d567dd7dd 100644 |
--- a/public/platform/WebCrypto.h |
+++ b/public/platform/WebCrypto.h |
@@ -34,6 +34,7 @@ |
#include "WebCommon.h" |
#include "WebCryptoAlgorithm.h" |
#include "WebCryptoKey.h" |
+#include "WebPrivateOwnPtr.h" |
#include "WebPrivatePtr.h" |
// FIXME: Remove this once chromium side is updated. |
@@ -97,6 +98,18 @@ private: |
WebPrivatePtr<WebCore::CryptoResult> m_impl; |
}; |
+class WebCryptoDigestor { |
+public: |
+ WebCryptoDigestor(blink::WebCryptoAlgorithmId algorithmId) { } |
eroman
2014/03/19 19:06:21
Remove this constructor
jww
2014/03/20 23:02:50
This is actually the constructor that the implemen
eroman
2014/03/20 23:14:02
This is just an interface class, there doesn't nee
|
+ virtual ~WebCryptoDigestor() { } |
+ |
+ virtual bool consume(const unsigned char* data, unsigned dataSize) { return false; } |
eroman
2014/03/19 19:06:21
I think it is worth describing what the return val
jww
2014/03/20 23:02:50
Done.
|
+ virtual bool finish(WebArrayBuffer& result) { return false; } |
eroman
2014/03/19 19:06:21
I actually think that rather than filling a WebArr
jww
2014/03/20 23:02:50
In my new version, I've implemented it pretty much
|
+ |
+private: |
+ WebCryptoDigestor() { } |
+}; |
+ |
class WebCrypto { |
public: |
// WebCrypto is the interface for starting one-shot cryptographic |
@@ -182,12 +195,15 @@ public: |
// It is possible that unwrappedKeyAlgorithm.isNull() |
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(); } |
- // This is the one exception to the "Completing the request" guarantees |
+ // These are the exceptions to the "Completing the request" guarantees |
// outlined above. digestSynchronous must provide the result into result |
// synchronously. It must return |true| on successful calculation of the |
// digest and |false| otherwise. This is useful for Blink internal crypto |
- // and is not part of the WebCrypto standard. |
+ // and is not part of the WebCrypto standard. digestorSynchronous returns a |
+ // WebCryptoDigestor object that consumes chunks synchronously and returns |
+ // a result synchronously. |
virtual bool digestSynchronous(const WebCryptoAlgorithmId algorithmId, const unsigned char* data, unsigned dataSize, WebArrayBuffer& result) { return false; } |
eroman
2014/03/19 19:06:21
Is this version already in use, or can it be delet
jww
2014/03/20 23:02:50
This is in use. Of course, it's not that hard to r
|
+ virtual WebCryptoDigestor* digestorSynchronous(const WebCryptoAlgorithmId algorithmId) { return 0; } |
eroman
2014/03/19 19:06:21
I would say drop the const.
jww
2014/03/20 23:02:50
Done.
|
protected: |
virtual ~WebCrypto() { } |