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

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

Issue 26004002: Decouple ScriptPromise creation from ScriptPromiseResolver. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 7 years, 2 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 7b00de5eca2f5595d3d9ea462cfc3c9521a37a2d..ab2a77e09fb945b04589ffa0c894c9051e2bf42c 100644
--- a/Source/modules/crypto/CryptoResultImpl.cpp
+++ b/Source/modules/crypto/CryptoResultImpl.cpp
@@ -63,35 +63,36 @@ void CryptoResultImpl::completeWithError()
void CryptoResultImpl::completeWithBuffer(const WebKit::WebArrayBuffer& buffer)
{
- m_promiseResolver->fulfill(PassRefPtr<ArrayBuffer>(buffer));
+ m_promiseResolver->resolve(PassRefPtr<ArrayBuffer>(buffer));
finish();
}
void CryptoResultImpl::completeWithBoolean(bool b)
{
- m_promiseResolver->fulfill(ScriptValue::createBoolean(b));
+ m_promiseResolver->resolve(ScriptValue::createBoolean(b));
finish();
}
void CryptoResultImpl::completeWithKey(const WebKit::WebCryptoKey& key)
{
- m_promiseResolver->fulfill(Key::create(key));
+ m_promiseResolver->resolve(Key::create(key));
finish();
}
void CryptoResultImpl::completeWithKeyPair(const WebKit::WebCryptoKey& publicKey, const WebKit::WebCryptoKey& privateKey)
{
- m_promiseResolver->fulfill(KeyPair::create(publicKey, privateKey));
+ m_promiseResolver->resolve(KeyPair::create(publicKey, privateKey));
finish();
}
ScriptPromise CryptoResultImpl::promise()
{
- return m_promiseResolver->promise();
+ return m_promise;
}
CryptoResultImpl::CryptoResultImpl()
- : m_promiseResolver(ScriptPromiseResolver::create())
+ : m_promise(ScriptPromise::create())
+ , m_promiseResolver(ScriptPromiseResolver::create(m_promise))
, m_finished(false) { }
void CryptoResultImpl::finish()

Powered by Google App Engine
This is Rietveld 408576698