Index: Source/modules/crypto/CryptoResultImpl.cpp |
diff --git a/Source/modules/crypto/CryptoResultImpl.cpp b/Source/modules/crypto/CryptoResultImpl.cpp |
index 5e9649c32f78c958d41ac603772175f492ae1b70..a99c7dacfd44bceefb4fc9aff0c42c220ef7ba72 100644 |
--- a/Source/modules/crypto/CryptoResultImpl.cpp |
+++ b/Source/modules/crypto/CryptoResultImpl.cpp |
@@ -31,7 +31,8 @@ |
#include "config.h" |
#include "modules/crypto/CryptoResultImpl.h" |
-#include "bindings/v8/ScriptPromiseResolver.h" |
+#include "bindings/v8/NewScriptState.h" |
+#include "bindings/v8/ScriptPromiseResolverWithContext.h" |
#include "core/dom/ExecutionContext.h" |
#include "modules/crypto/Key.h" |
#include "modules/crypto/KeyPair.h" |
@@ -57,7 +58,6 @@ void CryptoResultImpl::completeWithError(const blink::WebString& errorDetails) |
ASSERT(!m_finished); |
if (canCompletePromise()) { |
- NewScriptState::Scope scope(m_scriptState.get()); |
if (!errorDetails.isEmpty()) { |
// FIXME: Include the line number which started the crypto operation. |
executionContext()->addConsoleMessage(JSMessageSource, ErrorMessageLevel, errorDetails); |
@@ -76,7 +76,6 @@ void CryptoResultImpl::completeWithBuffer(const blink::WebArrayBuffer& buffer) |
ASSERT(!m_finished); |
if (canCompletePromise()) { |
- NewScriptState::Scope scope(m_scriptState.get()); |
m_promiseResolver->resolve(PassRefPtr<ArrayBuffer>(buffer)); |
} |
@@ -88,7 +87,6 @@ void CryptoResultImpl::completeWithBoolean(bool b) |
ASSERT(!m_finished); |
if (canCompletePromise()) { |
- NewScriptState::Scope scope(m_scriptState.get()); |
eroman
2014/04/16 02:30:01
Are you sure this is correct? Although m_promiseRe
yhirano
2014/04/16 11:56:16
I've moved the conversion part inside ScriptPromis
|
m_promiseResolver->resolve(ScriptValue::createBoolean(b)); |
} |
@@ -100,7 +98,6 @@ void CryptoResultImpl::completeWithKey(const blink::WebCryptoKey& key) |
ASSERT(!m_finished); |
if (canCompletePromise()) { |
- NewScriptState::Scope scope(m_scriptState.get()); |
m_promiseResolver->resolve(Key::create(key)); |
} |
@@ -112,7 +109,6 @@ void CryptoResultImpl::completeWithKeyPair(const blink::WebCryptoKey& publicKey, |
ASSERT(!m_finished); |
if (canCompletePromise()) { |
- NewScriptState::Scope scope(m_scriptState.get()); |
m_promiseResolver->resolve(KeyPair::create(publicKey, privateKey)); |
} |
@@ -121,8 +117,7 @@ void CryptoResultImpl::completeWithKeyPair(const blink::WebCryptoKey& publicKey, |
CryptoResultImpl::CryptoResultImpl(ExecutionContext* context) |
: ContextLifecycleObserver(context) |
- , m_promiseResolver(ScriptPromiseResolver::create(context)) |
- , m_scriptState(NewScriptState::current(toIsolate(context))) |
+ , m_promiseResolver(ScriptPromiseResolverWithContext::create(NewScriptState::current(toIsolate(context)))) |
#if !ASSERT_DISABLED |
, m_owningThread(currentThread()) |
, m_finished(false) |
@@ -141,7 +136,6 @@ void CryptoResultImpl::finish() |
void CryptoResultImpl::clearPromiseResolver() |
{ |
m_promiseResolver.clear(); |
- m_scriptState.clear(); |
} |
void CryptoResultImpl::CheckValidThread() const |