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

Unified Diff: Source/modules/crypto/SubtleCrypto.cpp

Issue 23338006: Cleanup: remove WebCryptoResultPrivate from blink API. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove extra newline Created 7 years, 4 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 | « Source/modules/crypto/CryptoResult.cpp ('k') | Source/modules/modules.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/crypto/SubtleCrypto.cpp
diff --git a/Source/modules/crypto/SubtleCrypto.cpp b/Source/modules/crypto/SubtleCrypto.cpp
index 3d3eef96b876fa620928a50608d3803f7a6fdb14..fbd8519c2f7428455b24e1245a0eed1a07c709d3 100644
--- a/Source/modules/crypto/SubtleCrypto.cpp
+++ b/Source/modules/crypto/SubtleCrypto.cpp
@@ -31,15 +31,12 @@
#include "config.h"
#include "modules/crypto/SubtleCrypto.h"
-#include "V8Key.h" // Must precede ScriptPromiseResolver.h
#include "bindings/v8/ExceptionState.h"
-#include "bindings/v8/custom/V8ArrayBufferCustom.h" // Must precede ScriptPromiseResolver.h
-#include "bindings/v8/ScriptPromiseResolver.h"
#include "core/dom/ExceptionCode.h"
+#include "modules/crypto/CryptoResult.h"
#include "modules/crypto/Key.h"
#include "modules/crypto/NormalizeAlgorithm.h"
#include "public/platform/Platform.h"
-#include "public/platform/WebArrayBuffer.h"
#include "public/platform/WebCrypto.h"
#include "public/platform/WebCryptoAlgorithm.h"
#include "wtf/ArrayBufferView.h"
@@ -51,72 +48,6 @@ namespace WebCore {
namespace {
-class CryptoResult : public WebKit::WebCryptoResultPrivate, public ThreadSafeRefCounted<CryptoResult> {
-public:
- static PassRefPtr<CryptoResult> create()
- {
- return adoptRef(new CryptoResult);
- }
-
- virtual void ref() OVERRIDE
- {
- ThreadSafeRefCounted<CryptoResult>::ref();
- }
-
- virtual void deref() OVERRIDE
- {
- ThreadSafeRefCounted<CryptoResult>::deref();
- }
-
- virtual void completeWithError() OVERRIDE
- {
- m_promiseResolver->reject(ScriptValue::createNull());
- finish();
- }
-
- virtual void completeWithBuffer(const WebKit::WebArrayBuffer& buffer) OVERRIDE
- {
- m_promiseResolver->fulfill(PassRefPtr<ArrayBuffer>(buffer));
- finish();
- }
-
- virtual void completeWithBoolean(bool b) OVERRIDE
- {
- m_promiseResolver->fulfill(ScriptValue::createBoolean(b));
- finish();
- }
-
- virtual void completeWithKey(const WebKit::WebCryptoKey& key) OVERRIDE
- {
- m_promiseResolver->fulfill(Key::create(key));
- finish();
- }
-
- WebKit::WebCryptoResult result()
- {
- return WebKit::WebCryptoResult(this);
- }
-
- ScriptObject promise()
- {
- return m_promiseResolver->promise();
- }
-
-private:
- CryptoResult()
- : m_promiseResolver(ScriptPromiseResolver::create())
- , m_finished(false) { }
-
- void finish()
- {
- ASSERT(!m_finished);
- m_finished = true;
- }
-
- RefPtr<ScriptPromiseResolver> m_promiseResolver;
- bool m_finished;
-};
-
ScriptObject startCryptoOperation(const Dictionary& rawAlgorithm, Key* key, AlgorithmOperation operationType, ArrayBufferView* signature, ArrayBufferView* dataBuffer, ExceptionState& es)
{
WebKit::WebCrypto* platformCrypto = WebKit::Platform::current()->crypto();
« no previous file with comments | « Source/modules/crypto/CryptoResult.cpp ('k') | Source/modules/modules.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698