| Index: Source/modules/crypto/CryptoOperation.cpp
|
| diff --git a/Source/modules/crypto/CryptoOperation.cpp b/Source/modules/crypto/CryptoOperation.cpp
|
| index d12ba622fbfd3a60809c3fdbfb0aee98a251e799..e511665674e795ed8c95dc44ce1c521d4ecb2349 100644
|
| --- a/Source/modules/crypto/CryptoOperation.cpp
|
| +++ b/Source/modules/crypto/CryptoOperation.cpp
|
| @@ -49,18 +49,17 @@ CryptoOperation::~CryptoOperation()
|
| ASSERT(!m_impl);
|
| }
|
|
|
| -PassRefPtr<CryptoOperation> CryptoOperation::create(const WebKit::WebCryptoAlgorithm& algorithm, ExceptionState* es)
|
| +PassRefPtr<CryptoOperation> CryptoOperation::create(const WebKit::WebCryptoAlgorithm& algorithm)
|
| {
|
| - return adoptRef(new CryptoOperation(algorithm, es));
|
| + return adoptRef(new CryptoOperation(algorithm));
|
| }
|
|
|
| -CryptoOperation::CryptoOperation(const WebKit::WebCryptoAlgorithm& algorithm, ExceptionState* es)
|
| +CryptoOperation::CryptoOperation(const WebKit::WebCryptoAlgorithm& algorithm)
|
| : m_algorithm(algorithm)
|
| , m_impl(0)
|
| - , m_exceptionState(es)
|
| + , m_exceptionCode(0)
|
| , m_state(Initializing)
|
| {
|
| - ASSERT(es);
|
| ScriptWrappable::init(this);
|
| }
|
|
|
| @@ -117,19 +116,16 @@ void CryptoOperation::initializationFailed()
|
| {
|
| ASSERT(m_state == Initializing);
|
|
|
| - m_exceptionState->throwDOMException(NotSupportedError);
|
| -
|
| - m_exceptionState = 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_exceptionState = 0;
|
| m_impl = operationImpl;
|
| m_state = Processing;
|
| }
|
| @@ -154,6 +150,17 @@ void CryptoOperation::completeWithArrayBuffer(const WebKit::WebArrayBuffer& buff
|
| promiseResolver()->fulfill(PassRefPtr<ArrayBuffer>(buffer));
|
| }
|
|
|
| +CryptoOperation* CryptoOperation::returnValue(ExceptionState& es)
|
| +{
|
| + ASSERT(m_state != Initializing);
|
| +
|
| + if (m_exceptionCode) {
|
| + es.throwDOMException(m_exceptionCode);
|
| + return 0;
|
| + }
|
| + return this;
|
| +}
|
| +
|
| void CryptoOperation::process(const unsigned char* bytes, size_t size)
|
| {
|
| switch (m_state) {
|
|
|