Changeset 199961 in webkit
- Timestamp:
- Apr 24, 2016 5:37:43 AM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r199960 r199961 1 2016-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 1 17 2016-04-23 Andy Estes <aestes@apple.com> 2 18 -
trunk/Source/WebCore/Modules/websockets/WebSocket.cpp
r199642 r199961 323 323 } 324 324 325 void WebSocket::send(ArrayBuffer* binaryData, ExceptionCode& ec) 326 { 327 LOG(Network, "WebSocket %p send() Sending ArrayBuffer %p", this, binaryData); 328 ASSERT(binaryData); 325 void WebSocket::send(ArrayBuffer& binaryData, ExceptionCode& ec) 326 { 327 LOG(Network, "WebSocket %p send() Sending ArrayBuffer %p", this, &binaryData); 329 328 if (m_state == CONNECTING) { 330 329 ec = INVALID_STATE_ERR; … … 332 331 } 333 332 if (m_state == CLOSING || m_state == CLOSED) { 334 unsigned payloadSize = binaryData ->byteLength();333 unsigned payloadSize = binaryData.byteLength(); 335 334 m_bufferedAmountAfterClose = saturateAdd(m_bufferedAmountAfterClose, payloadSize); 336 335 m_bufferedAmountAfterClose = saturateAdd(m_bufferedAmountAfterClose, getFramingOverhead(payloadSize)); … … 338 337 } 339 338 ASSERT(m_channel); 340 m_channel->send( *binaryData, 0, binaryData->byteLength());339 m_channel->send(binaryData, 0, binaryData.byteLength()); 341 340 } 342 341 … … 360 359 } 361 360 362 void WebSocket::send(Blob *binaryData, ExceptionCode& ec)363 { 364 LOG(Network, "WebSocket %p send() Sending Blob '%s'", this, binaryData ->url().stringCenterEllipsizedToLength().utf8().data());361 void WebSocket::send(Blob& binaryData, ExceptionCode& ec) 362 { 363 LOG(Network, "WebSocket %p send() Sending Blob '%s'", this, binaryData.url().stringCenterEllipsizedToLength().utf8().data()); 365 364 if (m_state == CONNECTING) { 366 365 ec = INVALID_STATE_ERR; … … 368 367 } 369 368 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()); 371 370 m_bufferedAmountAfterClose = saturateAdd(m_bufferedAmountAfterClose, payloadSize); 372 371 m_bufferedAmountAfterClose = saturateAdd(m_bufferedAmountAfterClose, getFramingOverhead(payloadSize)); … … 374 373 } 375 374 ASSERT(m_channel); 376 m_channel->send( *binaryData);375 m_channel->send(binaryData); 377 376 } 378 377 -
trunk/Source/WebCore/Modules/websockets/WebSocket.h
r198869 r199961 73 73 74 74 void send(const String& message, ExceptionCode&); 75 void send(JSC::ArrayBuffer *, ExceptionCode&);75 void send(JSC::ArrayBuffer&, ExceptionCode&); 76 76 void send(JSC::ArrayBufferView*, ExceptionCode&); 77 void send(Blob *, ExceptionCode&);77 void send(Blob&, ExceptionCode&); 78 78 79 79 void close(int code, const String& reason, ExceptionCode&); -
trunk/Source/WebCore/Modules/websockets/WebSocket.idl
r199587 r199961 31 31 32 32 [ 33 Exposed=(Window,Worker), 34 EnabledAtRuntime, 33 ActiveDOMObject, 35 34 Conditional=WEB_SOCKETS, 36 ActiveDOMObject,37 35 Constructor(DOMString url, [Default=Undefined] optional sequence<DOMString>? protocols), 38 36 Constructor(DOMString url, DOMString protocol), 39 37 ConstructorRaisesException, 40 38 ConstructorCallWith=ScriptExecutionContext, 41 UsePointersEvenForNonNullableObjectArguments, 39 EnabledAtRuntime, 40 Exposed=(Window,Worker), 42 41 ] interface WebSocket : EventTarget { 43 42 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.