コード例 #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
ファイル: WebSocketImpl.cpp プロジェクト: 335969568/Blink-1
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();
}