| Index: Source/core/platform/chromium/support/WebCrypto.cpp
|
| diff --git a/Source/core/platform/chromium/support/WebCrypto.cpp b/Source/core/platform/chromium/support/WebCrypto.cpp
|
| index 9f63634011e01d67f48d1fb2dfc9414073c240b6..0dd1796deb49bf75f4569cd7adaa97431409a5fe 100644
|
| --- a/Source/core/platform/chromium/support/WebCrypto.cpp
|
| +++ b/Source/core/platform/chromium/support/WebCrypto.cpp
|
| @@ -29,92 +29,54 @@
|
| */
|
|
|
| #include "config.h"
|
| +#include "public/platform/WebArrayBuffer.h"
|
| #include "public/platform/WebCrypto.h"
|
| +#include <string.h>
|
|
|
| namespace WebKit {
|
|
|
| -// FIXME: Assert that these methods are called from the right thread.
|
| -
|
| -void WebCryptoOperationResult::initializationFailed()
|
| -{
|
| - m_impl->initializationFailed();
|
| - reset();
|
| -}
|
| -
|
| -void WebCryptoOperationResult::initializationSucceeded(WebCryptoOperation* op)
|
| -{
|
| - m_impl->initializationSucceeded(op);
|
| - reset();
|
| -}
|
| -
|
| -void WebCryptoOperationResult::completeWithError()
|
| +void WebCryptoResult::completeWithError()
|
| {
|
| m_impl->completeWithError();
|
| reset();
|
| }
|
|
|
| -void WebCryptoOperationResult::completeWithArrayBuffer(const WebArrayBuffer& buffer)
|
| +void WebCryptoResult::completeWithBuffer(const WebArrayBuffer& buffer)
|
| {
|
| - m_impl->completeWithArrayBuffer(buffer);
|
| + m_impl->completeWithBuffer(buffer);
|
| reset();
|
| }
|
|
|
| -void WebCryptoOperationResult::completeWithBoolean(bool b)
|
| +void WebCryptoResult::completeWithBuffer(const void* bytes, size_t bytesSize)
|
| {
|
| - m_impl->completeWithBoolean(b);
|
| - reset();
|
| -}
|
| -
|
| -void WebCryptoOperationResult::reset()
|
| -{
|
| - m_impl.reset();
|
| + WebArrayBuffer buffer = WebKit::WebArrayBuffer::create(bytesSize, 1);
|
| + memcpy(buffer.data(), bytes, bytesSize);
|
| + completeWithBuffer(buffer);
|
| }
|
|
|
| -void WebCryptoOperationResult::assign(const WebCryptoOperationResult& o)
|
| +void WebCryptoResult::completeWithBoolean(bool b)
|
| {
|
| - m_impl = o.m_impl;
|
| -}
|
| -
|
| -void WebCryptoOperationResult::assign(WebCryptoOperationResultPrivate* impl)
|
| -{
|
| - m_impl = impl;
|
| -}
|
| -
|
| -void WebCryptoKeyOperationResult::initializationFailed()
|
| -{
|
| - m_impl->initializationFailed();
|
| - reset();
|
| -}
|
| -
|
| -void WebCryptoKeyOperationResult::initializationSucceeded(WebCryptoKeyOperation* op)
|
| -{
|
| - m_impl->initializationSucceeded(op);
|
| - reset();
|
| -}
|
| -
|
| -void WebCryptoKeyOperationResult::completeWithError()
|
| -{
|
| - m_impl->completeWithError();
|
| + m_impl->completeWithBoolean(b);
|
| reset();
|
| }
|
|
|
| -void WebCryptoKeyOperationResult::completeWithKey(const WebCryptoKey& key)
|
| +void WebCryptoResult::completeWithKey(const WebCryptoKey& key)
|
| {
|
| m_impl->completeWithKey(key);
|
| reset();
|
| }
|
|
|
| -void WebCryptoKeyOperationResult::reset()
|
| +void WebCryptoResult::reset()
|
| {
|
| m_impl.reset();
|
| }
|
|
|
| -void WebCryptoKeyOperationResult::assign(const WebCryptoKeyOperationResult& o)
|
| +void WebCryptoResult::assign(const WebCryptoResult& o)
|
| {
|
| m_impl = o.m_impl;
|
| }
|
|
|
| -void WebCryptoKeyOperationResult::assign(WebCryptoKeyOperationResultPrivate* impl)
|
| +void WebCryptoResult::assign(WebCryptoResultPrivate* impl)
|
| {
|
| m_impl = impl;
|
| }
|
|
|