示例#1
0
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);
}
示例#2
0
bool WebSocketImpl::sendArrayBuffer(const WebArrayBuffer& webArrayBuffer)
{
    size_t size = webArrayBuffer.byteLength();
    m_bufferedAmount += size;
    if (m_isClosingOrClosed)
        m_bufferedAmountAfterClose += size;

    // FIXME: Deprecate this call.
    m_client->didUpdateBufferedAmount(m_bufferedAmount);

    if (m_isClosingOrClosed)
        return true;

    m_private->send(*PassRefPtr<ArrayBuffer>(webArrayBuffer), 0, webArrayBuffer.byteLength());
    return true;
}
示例#3
0
bool WebSocketImpl::sendArrayBuffer(const WebArrayBuffer& webArrayBuffer)
{
#if ENABLE(WEB_SOCKETS)
    return m_private->send(*PassRefPtr<ArrayBuffer>(webArrayBuffer), 0, webArrayBuffer.byteLength()) == ThreadableWebSocketChannel::SendSuccess;
#else
    ASSERT_NOT_REACHED();
#endif
}
示例#4
0
bool WebPepperSocketImpl::sendArrayBuffer(
    const WebArrayBuffer& webArrayBuffer) {
  size_t size = webArrayBuffer.byteLength();
  m_bufferedAmount += size;
  if (m_isClosingOrClosed)
    m_bufferedAmountAfterClose += size;

  // FIXME: Deprecate this call.
  m_client->didUpdateBufferedAmount(m_bufferedAmount);

  if (m_isClosingOrClosed)
    return true;

  DOMArrayBuffer* arrayBuffer = webArrayBuffer;
  m_private->send(*arrayBuffer, 0, arrayBuffer->byteLength());
  return true;
}
示例#5
0
bool WebSocketImpl::sendArrayBuffer(const WebArrayBuffer& webArrayBuffer)
{
    return m_private->send(*PassRefPtr<ArrayBuffer>(webArrayBuffer), 0, webArrayBuffer.byteLength()) == WebSocketChannel::SendSuccess;
}
示例#6
0
void WebCryptoResult::completeWithBuffer(const WebArrayBuffer& buffer)
{
    RELEASE_ASSERT(!buffer.isNull());
    m_impl->completeWithBuffer(buffer);
    reset();
}