Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1391)

Unified Diff: Source/modules/crypto/CryptoOperation.h

Issue 19776013: WebCrypto: Refactor the WebCryptoOperation interface to support errors. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase onto master Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/crypto/digest-expected.txt ('k') | Source/modules/crypto/CryptoOperation.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/crypto/CryptoOperation.h
diff --git a/Source/modules/crypto/CryptoOperation.h b/Source/modules/crypto/CryptoOperation.h
index b26974dd9d66ca0e49bb83757d9af6833406e7f9..f59a60b8eee3f8d68174985d55b8ac386699b2f8 100644
--- a/Source/modules/crypto/CryptoOperation.h
+++ b/Source/modules/crypto/CryptoOperation.h
@@ -46,10 +46,10 @@ class ScriptPromiseResolver;
typedef int ExceptionCode;
-class CryptoOperation : public ScriptWrappable, public RefCounted<CryptoOperation> {
+class CryptoOperation : public ScriptWrappable, public WebKit::WebCryptoOperationResult, public RefCounted<CryptoOperation> {
public:
~CryptoOperation();
- static PassRefPtr<CryptoOperation> create(const WebKit::WebCryptoAlgorithm&, WebKit::WebCryptoOperation*);
+ static PassRefPtr<CryptoOperation> create(const WebKit::WebCryptoAlgorithm&, ExceptionCode*);
CryptoOperation* process(ArrayBuffer* data);
CryptoOperation* process(ArrayBufferView* data);
@@ -59,11 +59,17 @@ public:
Algorithm* algorithm();
-private:
- class Result;
- friend class Result;
+ // Implementation of WebKit::WebCryptoOperationResult.
+ virtual void initializationFailed() OVERRIDE;
+ virtual void initializationSucceded(WebKit::WebCryptoOperation*) OVERRIDE;
+ virtual void completeWithError() OVERRIDE;
+ virtual void completeWithArrayBuffer(const WebKit::WebArrayBuffer&) OVERRIDE;
+private:
enum State {
+ // Constructing the WebCryptoOperation.
+ Initializing,
+
// Accepting calls to process().
Processing,
@@ -77,7 +83,7 @@ private:
Done,
};
- CryptoOperation(const WebKit::WebCryptoAlgorithm&, WebKit::WebCryptoOperation*);
+ CryptoOperation(const WebKit::WebCryptoAlgorithm&, ExceptionCode*);
void process(const unsigned char*, size_t);
@@ -94,7 +100,7 @@ private:
RefPtr<ScriptPromiseResolver> m_promiseResolver;
- OwnPtr<Result> m_result;
+ ExceptionCode* m_exceptionCode;
};
} // namespace WebCore
« no previous file with comments | « LayoutTests/crypto/digest-expected.txt ('k') | Source/modules/crypto/CryptoOperation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698