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

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

Issue 1029093003: [WIP] IDL: Add limited serializer support and use for RTCIceCandidate (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: use V8ObjectBuilder in modules/crypto Created 5 years, 9 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
Index: Source/modules/crypto/CryptoResultImpl.cpp
diff --git a/Source/modules/crypto/CryptoResultImpl.cpp b/Source/modules/crypto/CryptoResultImpl.cpp
index 5d6c808c38d35140d1f0ac376ed3ab4fff10207d..53d2fca0ddd2b6de17fd3d9c745dcf6e8794260f 100644
--- a/Source/modules/crypto/CryptoResultImpl.cpp
+++ b/Source/modules/crypto/CryptoResultImpl.cpp
@@ -184,13 +184,10 @@ void CryptoResultImpl::completeWithKeyPair(const WebCryptoKey& publicKey, const
ScriptState* scriptState = m_resolver->scriptState();
ScriptState::Scope scope(scriptState);
- Dictionary keyPair = Dictionary::createEmpty(scriptState->isolate());
+ V8ObjectBuilder keyPair(scriptState->isolate());
- v8::Handle<v8::Value> publicKeyValue = toV8(CryptoKey::create(publicKey), scriptState->context()->Global(), scriptState->isolate());
- v8::Handle<v8::Value> privateKeyValue = toV8(CryptoKey::create(privateKey), scriptState->context()->Global(), scriptState->isolate());
-
- keyPair.set("publicKey", publicKeyValue);
- keyPair.set("privateKey", privateKeyValue);
+ keyPair.add("publicKey", ScriptValue::from(scriptState, CryptoKey::create(publicKey)));
+ keyPair.add("privateKey", ScriptValue::from(scriptState, CryptoKey::create(privateKey)));
m_resolver->resolve(keyPair.v8Value());
}

Powered by Google App Engine
This is Rietveld 408576698