This source file includes following definitions.
- completeWithError
- completeWithError
- completeWithBuffer
- completeWithBuffer
- completeWithBoolean
- completeWithKey
- completeWithKeyPair
- reset
- assign
#include "config.h"
#include "public/platform/WebCrypto.h"
#include "platform/CryptoResult.h"
#include "public/platform/WebArrayBuffer.h"
#include "wtf/PassRefPtr.h"
#include <string.h>
namespace blink {
void WebCryptoResult::completeWithError()
{
m_impl->completeWithError();
reset();
}
void WebCryptoResult::completeWithError(const WebString& errorDetails)
{
m_impl->completeWithError(errorDetails);
reset();
}
void WebCryptoResult::completeWithBuffer(const WebArrayBuffer& buffer)
{
RELEASE_ASSERT(!buffer.isNull());
m_impl->completeWithBuffer(buffer);
reset();
}
void WebCryptoResult::completeWithBuffer(const void* bytes, unsigned bytesSize)
{
WebArrayBuffer buffer = blink::WebArrayBuffer::create(bytesSize, 1);
RELEASE_ASSERT(!buffer.isNull());
memcpy(buffer.data(), bytes, bytesSize);
completeWithBuffer(buffer);
}
void WebCryptoResult::completeWithBoolean(bool b)
{
m_impl->completeWithBoolean(b);
reset();
}
void WebCryptoResult::completeWithKey(const WebCryptoKey& key)
{
ASSERT(!key.isNull());
m_impl->completeWithKey(key);
reset();
}
void WebCryptoResult::completeWithKeyPair(const WebCryptoKey& publicKey, const WebCryptoKey& privateKey)
{
ASSERT(!publicKey.isNull());
ASSERT(!privateKey.isNull());
m_impl->completeWithKeyPair(publicKey, privateKey);
reset();
}
WebCryptoResult::WebCryptoResult(const PassRefPtr<WebCore::CryptoResult>& impl)
: m_impl(impl)
{
ASSERT(m_impl.get());
}
void WebCryptoResult::reset()
{
m_impl.reset();
}
void WebCryptoResult::assign(const WebCryptoResult& o)
{
m_impl = o.m_impl;
}
}