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

Unified Diff: Source/bindings/v8/custom/V8CryptoCustom.cpp

Issue 222553007: [webcrypto] Expose crypto.subtle to web workers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: check if changes... Created 6 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
« no previous file with comments | « Source/bindings/bindings.gypi ('k') | Source/bindings/v8/custom/V8WorkerCryptoCustom.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/custom/V8CryptoCustom.cpp
diff --git a/Source/bindings/v8/custom/V8CryptoCustom.cpp b/Source/bindings/v8/custom/V8CryptoCustom.cpp
index f43b55285c735e7f69c20aeac703ae7ea2c9bbbc..ac7e1be62e0bf1f4ce825981a69fc303573496a4 100644
--- a/Source/bindings/v8/custom/V8CryptoCustom.cpp
+++ b/Source/bindings/v8/custom/V8CryptoCustom.cpp
@@ -35,9 +35,6 @@
namespace WebCore {
-// This custom binding is shared by V8WorkerCrypto. As such:
-// * Do not call V8Crypto::toNative()
-// * Must be threadsafe
void V8Crypto::getRandomValuesMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
ExceptionState exceptionState(ExceptionState::ExecutionContext, "getRandomValues", "Crypto", info.Holder(), info.GetIsolate());
@@ -54,7 +51,8 @@ void V8Crypto::getRandomValuesMethodCustom(const v8::FunctionCallbackInfo<v8::Va
ArrayBufferView* arrayBufferView = V8ArrayBufferView::toNative(v8::Handle<v8::Object>::Cast(buffer));
ASSERT(arrayBufferView);
- Crypto::getRandomValues(arrayBufferView, exceptionState);
+ Crypto* crypto = V8Crypto::toNative(info.Holder());
+ crypto->getRandomValues(arrayBufferView, exceptionState);
}
if (exceptionState.throwIfNeeded())
« no previous file with comments | « Source/bindings/bindings.gypi ('k') | Source/bindings/v8/custom/V8WorkerCryptoCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698