| Index: Source/modules/crypto/CryptoOperation.cpp
|
| diff --git a/Source/modules/crypto/CryptoOperation.cpp b/Source/modules/crypto/CryptoOperation.cpp
|
| index a6c974887d19090f1e2790a4be83139fa2ff5528..bc6dbbbf1f92f3e792b08a8b17153a29c8b05464 100644
|
| --- a/Source/modules/crypto/CryptoOperation.cpp
|
| +++ b/Source/modules/crypto/CryptoOperation.cpp
|
| @@ -48,18 +48,17 @@ CryptoOperation::~CryptoOperation()
|
| ASSERT(!m_impl);
|
| }
|
|
|
| -PassRefPtr<CryptoOperation> CryptoOperation::create(const WebKit::WebCryptoAlgorithm& algorithm, ExceptionCode* ec)
|
| +PassRefPtr<CryptoOperation> CryptoOperation::create(const WebKit::WebCryptoAlgorithm& algorithm)
|
| {
|
| - return adoptRef(new CryptoOperation(algorithm, ec));
|
| + return adoptRef(new CryptoOperation(algorithm));
|
| }
|
|
|
| -CryptoOperation::CryptoOperation(const WebKit::WebCryptoAlgorithm& algorithm, ExceptionCode* ec)
|
| +CryptoOperation::CryptoOperation(const WebKit::WebCryptoAlgorithm& algorithm)
|
| : m_algorithm(algorithm)
|
| , m_impl(0)
|
| - , m_exceptionCode(ec)
|
| + , m_exceptionCode(0)
|
| , m_state(Initializing)
|
| {
|
| - ASSERT(ec);
|
| ScriptWrappable::init(this);
|
| }
|
|
|
| @@ -116,19 +115,16 @@ void CryptoOperation::initializationFailed()
|
| {
|
| ASSERT(m_state == Initializing);
|
|
|
| - *m_exceptionCode = NotSupportedError;
|
| -
|
| - m_exceptionCode = 0;
|
| + m_exceptionCode = NotSupportedError;
|
| m_state = Done;
|
| }
|
|
|
| -void CryptoOperation::initializationSucceded(WebKit::WebCryptoOperation* operationImpl)
|
| +void CryptoOperation::initializationSucceeded(WebKit::WebCryptoOperation* operationImpl)
|
| {
|
| ASSERT(m_state == Initializing);
|
| ASSERT(operationImpl);
|
| ASSERT(!m_impl);
|
|
|
| - m_exceptionCode = 0;
|
| m_impl = operationImpl;
|
| m_state = Processing;
|
| }
|
| @@ -153,6 +149,17 @@ void CryptoOperation::completeWithArrayBuffer(const WebKit::WebArrayBuffer& buff
|
| promiseResolver()->fulfill(PassRefPtr<ArrayBuffer>(buffer));
|
| }
|
|
|
| +CryptoOperation* CryptoOperation::returnValue(ExceptionCode& ec)
|
| +{
|
| + ASSERT(m_state != Initializing);
|
| +
|
| + if (m_exceptionCode) {
|
| + ec = m_exceptionCode;
|
| + return 0;
|
| + }
|
| + return this;
|
| +}
|
| +
|
| void CryptoOperation::process(const unsigned char* bytes, size_t size)
|
| {
|
| switch (m_state) {
|
|
|