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

Unified Diff: LayoutTests/crypto/resources/common.js

Issue 268273002: [webcrypto] Make KeyPair structured clonable. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: change up comment once more Created 6 years, 7 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/clone-rsaKeyPair-expected.txt ('k') | Source/bindings/v8/SerializedScriptValue.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/crypto/resources/common.js
diff --git a/LayoutTests/crypto/resources/common.js b/LayoutTests/crypto/resources/common.js
index 8169e9be66654a7a8200edeb3168499318d6b15b..afcfe11510130903b3d2c45c22c9e9ad4e36399b 100644
--- a/LayoutTests/crypto/resources/common.js
+++ b/LayoutTests/crypto/resources/common.js
@@ -69,12 +69,18 @@ function failAndFinishJSTest(error)
finishJSTest();
}
-// Returns a Promise for the cloned key.
+// FIXME: Delete this and use cloneObject() directly.
function cloneKey(key)
{
+ return cloneObject(key);
+}
+
+// Returns a Promise for the cloned object.
+function cloneObject(obj)
+{
// Sending an object through a MessagePort implicitly clones it.
// Use a single MessageChannel so requests complete in FIFO order.
- var self = cloneKey;
+ var self = cloneObject;
if (!self.channel) {
self.channel = new MessageChannel();
self.callbacks = [];
@@ -87,7 +93,7 @@ function cloneKey(key)
return new Promise(function(resolve, reject) {
self.callbacks.push(resolve);
- self.channel.port2.postMessage(key);
+ self.channel.port2.postMessage(obj);
});
}
« no previous file with comments | « LayoutTests/crypto/clone-rsaKeyPair-expected.txt ('k') | Source/bindings/v8/SerializedScriptValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698