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

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

Issue 340353006: [webcrypto] Replace KeyAlgorithm interfaces with an Object. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove const reference and make v8value a value Created 6 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 | « Source/modules/crypto/CryptoKey.idl ('k') | Source/modules/crypto/HmacKeyAlgorithm.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/crypto/CryptoResultImpl.cpp
diff --git a/Source/modules/crypto/CryptoResultImpl.cpp b/Source/modules/crypto/CryptoResultImpl.cpp
index 7c6cf79c3ff853ee79c9dd23d38046045218d3e2..99a667833b6d0562a43c6b4b80a71613b2736809 100644
--- a/Source/modules/crypto/CryptoResultImpl.cpp
+++ b/Source/modules/crypto/CryptoResultImpl.cpp
@@ -31,6 +31,7 @@
#include "config.h"
#include "modules/crypto/CryptoResultImpl.h"
+#include "bindings/core/v8/Dictionary.h"
#include "bindings/core/v8/ScriptPromiseResolver.h"
#include "bindings/core/v8/ScriptState.h"
#include "core/dom/ContextLifecycleObserver.h"
@@ -157,16 +158,15 @@ void CryptoResultImpl::completeWithKeyPair(const blink::WebCryptoKey& publicKey,
ScriptState* scriptState = m_resolver->scriptState();
ScriptState::Scope scope(scriptState);
- // FIXME: Use Dictionary instead, to limit amount of direct v8 access used from WebCore.
- v8::Handle<v8::Object> keyPair = v8::Object::New(scriptState->isolate());
+ Dictionary keyPair(scriptState->isolate());
v8::Handle<v8::Value> publicKeyValue = toV8NoInline(CryptoKey::create(publicKey), scriptState->context()->Global(), scriptState->isolate());
v8::Handle<v8::Value> privateKeyValue = toV8NoInline(CryptoKey::create(privateKey), scriptState->context()->Global(), scriptState->isolate());
- keyPair->Set(v8::String::NewFromUtf8(scriptState->isolate(), "publicKey"), publicKeyValue);
- keyPair->Set(v8::String::NewFromUtf8(scriptState->isolate(), "privateKey"), privateKeyValue);
+ keyPair.set("publicKey", publicKeyValue);
+ keyPair.set("privateKey", privateKeyValue);
- m_resolver->resolve(v8::Handle<v8::Value>(keyPair));
+ m_resolver->resolve(keyPair.v8Value());
}
}
« no previous file with comments | « Source/modules/crypto/CryptoKey.idl ('k') | Source/modules/crypto/HmacKeyAlgorithm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698