Changeset 199961 in webkit


Ignore:
Timestamp:
Apr 24, 2016 5:37:43 AM (8 years ago)
Author:
youenn.fablet@crf.canon.fr
Message:

Drop [UsePointersEvenForNonNullableObjectArguments] from WebSocket
https://bugs.webkit.org/show_bug.cgi?id=156897

Reviewed by Chris Dumez.

No change of behavior.

Updating WebSocket::send methods to take references, except for ArrayBufferView, which is not yet supported by the binding generator.

  • Modules/websockets/WebSocket.cpp:

(WebCore::WebSocket::send):

  • Modules/websockets/WebSocket.h:
  • Modules/websockets/WebSocket.idl:
Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r199960 r199961  
     12016-04-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
     2
     3        Drop [UsePointersEvenForNonNullableObjectArguments] from WebSocket
     4        https://bugs.webkit.org/show_bug.cgi?id=156897
     5
     6        Reviewed by Chris Dumez.
     7
     8        No change of behavior.
     9
     10        Updating WebSocket::send methods to take references, except for ArrayBufferView, which is not yet supported by the binding generator.
     11
     12        * Modules/websockets/WebSocket.cpp:
     13        (WebCore::WebSocket::send):
     14        * Modules/websockets/WebSocket.h:
     15        * Modules/websockets/WebSocket.idl:
     16
    1172016-04-23  Andy Estes  <aestes@apple.com>
    218
  • trunk/Source/WebCore/Modules/websockets/WebSocket.cpp

    r199642 r199961  
    323323}
    324324
    325 void WebSocket::send(ArrayBuffer* binaryData, ExceptionCode& ec)
    326 {
    327     LOG(Network, "WebSocket %p send() Sending ArrayBuffer %p", this, binaryData);
    328     ASSERT(binaryData);
     325void WebSocket::send(ArrayBuffer& binaryData, ExceptionCode& ec)
     326{
     327    LOG(Network, "WebSocket %p send() Sending ArrayBuffer %p", this, &binaryData);
    329328    if (m_state == CONNECTING) {
    330329        ec = INVALID_STATE_ERR;
     
    332331    }
    333332    if (m_state == CLOSING || m_state == CLOSED) {
    334         unsigned payloadSize = binaryData->byteLength();
     333        unsigned payloadSize = binaryData.byteLength();
    335334        m_bufferedAmountAfterClose = saturateAdd(m_bufferedAmountAfterClose, payloadSize);
    336335        m_bufferedAmountAfterClose = saturateAdd(m_bufferedAmountAfterClose, getFramingOverhead(payloadSize));
     
    338337    }
    339338    ASSERT(m_channel);
    340     m_channel->send(*binaryData, 0, binaryData->byteLength());
     339    m_channel->send(binaryData, 0, binaryData.byteLength());
    341340}
    342341
     
    360359}
    361360
    362 void WebSocket::send(Blob* binaryData, ExceptionCode& ec)
    363 {
    364     LOG(Network, "WebSocket %p send() Sending Blob '%s'", this, binaryData->url().stringCenterEllipsizedToLength().utf8().data());
     361void WebSocket::send(Blob& binaryData, ExceptionCode& ec)
     362{
     363    LOG(Network, "WebSocket %p send() Sending Blob '%s'", this, binaryData.url().stringCenterEllipsizedToLength().utf8().data());
    365364    if (m_state == CONNECTING) {
    366365        ec = INVALID_STATE_ERR;
     
    368367    }
    369368    if (m_state == CLOSING || m_state == CLOSED) {
    370         unsigned long payloadSize = static_cast<unsigned long>(binaryData->size());
     369        unsigned long payloadSize = static_cast<unsigned long>(binaryData.size());
    371370        m_bufferedAmountAfterClose = saturateAdd(m_bufferedAmountAfterClose, payloadSize);
    372371        m_bufferedAmountAfterClose = saturateAdd(m_bufferedAmountAfterClose, getFramingOverhead(payloadSize));
     
    374373    }
    375374    ASSERT(m_channel);
    376     m_channel->send(*binaryData);
     375    m_channel->send(binaryData);
    377376}
    378377
  • trunk/Source/WebCore/Modules/websockets/WebSocket.h

    r198869 r199961  
    7373
    7474    void send(const String& message, ExceptionCode&);
    75     void send(JSC::ArrayBuffer*, ExceptionCode&);
     75    void send(JSC::ArrayBuffer&, ExceptionCode&);
    7676    void send(JSC::ArrayBufferView*, ExceptionCode&);
    77     void send(Blob*, ExceptionCode&);
     77    void send(Blob&, ExceptionCode&);
    7878
    7979    void close(int code, const String& reason, ExceptionCode&);
  • trunk/Source/WebCore/Modules/websockets/WebSocket.idl

    r199587 r199961  
    3131
    3232[
    33     Exposed=(Window,Worker),
    34     EnabledAtRuntime,
     33    ActiveDOMObject,
    3534    Conditional=WEB_SOCKETS,
    36     ActiveDOMObject,
    3735    Constructor(DOMString url, [Default=Undefined] optional sequence<DOMString>? protocols),
    3836    Constructor(DOMString url, DOMString protocol),
    3937    ConstructorRaisesException,
    4038    ConstructorCallWith=ScriptExecutionContext,
    41     UsePointersEvenForNonNullableObjectArguments,
     39    EnabledAtRuntime,
     40    Exposed=(Window,Worker),
    4241] interface WebSocket : EventTarget {
    4342    readonly attribute DOMString URL; // Lowercased .url is the one in the spec, but leaving .URL for compatibility reasons.
Note: See TracChangeset for help on using the changeset viewer.