Пример #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();
}