- Revision
- 199961
- Author
- youenn.fab...@crf.canon.fr
- Date
- 2016-04-24 05:37:43 -0700 (Sun, 24 Apr 2016)
Log 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:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (199960 => 199961)
--- trunk/Source/WebCore/ChangeLog 2016-04-24 02:49:49 UTC (rev 199960)
+++ trunk/Source/WebCore/ChangeLog 2016-04-24 12:37:43 UTC (rev 199961)
@@ -1,3 +1,19 @@
+2016-04-24 Youenn Fablet <youenn.fab...@crf.canon.fr>
+
+ 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:
+
2016-04-23 Andy Estes <aes...@apple.com>
Fix issues found by the clang static analyzer
Modified: trunk/Source/WebCore/Modules/websockets/WebSocket.cpp (199960 => 199961)
--- trunk/Source/WebCore/Modules/websockets/WebSocket.cpp 2016-04-24 02:49:49 UTC (rev 199960)
+++ trunk/Source/WebCore/Modules/websockets/WebSocket.cpp 2016-04-24 12:37:43 UTC (rev 199961)
@@ -322,22 +322,21 @@
}
}
-void WebSocket::send(ArrayBuffer* binaryData, ExceptionCode& ec)
+void WebSocket::send(ArrayBuffer& binaryData, ExceptionCode& ec)
{
- LOG(Network, "WebSocket %p send() Sending ArrayBuffer %p", this, binaryData);
- ASSERT(binaryData);
+ LOG(Network, "WebSocket %p send() Sending ArrayBuffer %p", this, &binaryData);
if (m_state == CONNECTING) {
ec = INVALID_STATE_ERR;
return;
}
if (m_state == CLOSING || m_state == CLOSED) {
- unsigned payloadSize = binaryData->byteLength();
+ unsigned payloadSize = binaryData.byteLength();
m_bufferedAmountAfterClose = saturateAdd(m_bufferedAmountAfterClose, payloadSize);
m_bufferedAmountAfterClose = saturateAdd(m_bufferedAmountAfterClose, getFramingOverhead(payloadSize));
return;
}
ASSERT(m_channel);
- m_channel->send(*binaryData, 0, binaryData->byteLength());
+ m_channel->send(binaryData, 0, binaryData.byteLength());
}
void WebSocket::send(ArrayBufferView* arrayBufferView, ExceptionCode& ec)
@@ -359,21 +358,21 @@
m_channel->send(*arrayBuffer, arrayBufferView->byteOffset(), arrayBufferView->byteLength());
}
-void WebSocket::send(Blob* binaryData, ExceptionCode& ec)
+void WebSocket::send(Blob& binaryData, ExceptionCode& ec)
{
- LOG(Network, "WebSocket %p send() Sending Blob '%s'", this, binaryData->url().stringCenterEllipsizedToLength().utf8().data());
+ LOG(Network, "WebSocket %p send() Sending Blob '%s'", this, binaryData.url().stringCenterEllipsizedToLength().utf8().data());
if (m_state == CONNECTING) {
ec = INVALID_STATE_ERR;
return;
}
if (m_state == CLOSING || m_state == CLOSED) {
- unsigned long payloadSize = static_cast<unsigned long>(binaryData->size());
+ unsigned long payloadSize = static_cast<unsigned long>(binaryData.size());
m_bufferedAmountAfterClose = saturateAdd(m_bufferedAmountAfterClose, payloadSize);
m_bufferedAmountAfterClose = saturateAdd(m_bufferedAmountAfterClose, getFramingOverhead(payloadSize));
return;
}
ASSERT(m_channel);
- m_channel->send(*binaryData);
+ m_channel->send(binaryData);
}
void WebSocket::close(int code, const String& reason, ExceptionCode& ec)
Modified: trunk/Source/WebCore/Modules/websockets/WebSocket.h (199960 => 199961)
--- trunk/Source/WebCore/Modules/websockets/WebSocket.h 2016-04-24 02:49:49 UTC (rev 199960)
+++ trunk/Source/WebCore/Modules/websockets/WebSocket.h 2016-04-24 12:37:43 UTC (rev 199961)
@@ -72,9 +72,9 @@
void connect(const String& url, const Vector<String>& protocols, ExceptionCode&);
void send(const String& message, ExceptionCode&);
- void send(JSC::ArrayBuffer*, ExceptionCode&);
+ void send(JSC::ArrayBuffer&, ExceptionCode&);
void send(JSC::ArrayBufferView*, ExceptionCode&);
- void send(Blob*, ExceptionCode&);
+ void send(Blob&, ExceptionCode&);
void close(int code, const String& reason, ExceptionCode&);
void close(ExceptionCode& ec) { close(WebSocketChannel::CloseEventCodeNotSpecified, String(), ec); }
Modified: trunk/Source/WebCore/Modules/websockets/WebSocket.idl (199960 => 199961)
--- trunk/Source/WebCore/Modules/websockets/WebSocket.idl 2016-04-24 02:49:49 UTC (rev 199960)
+++ trunk/Source/WebCore/Modules/websockets/WebSocket.idl 2016-04-24 12:37:43 UTC (rev 199961)
@@ -30,15 +30,14 @@
*/
[
- Exposed=(Window,Worker),
- EnabledAtRuntime,
- Conditional=WEB_SOCKETS,
ActiveDOMObject,
+ Conditional=WEB_SOCKETS,
Constructor(DOMString url, [Default=Undefined] optional sequence<DOMString>? protocols),
Constructor(DOMString url, DOMString protocol),
ConstructorRaisesException,
ConstructorCallWith=ScriptExecutionContext,
- UsePointersEvenForNonNullableObjectArguments,
+ EnabledAtRuntime,
+ Exposed=(Window,Worker),
] interface WebSocket : EventTarget {
readonly attribute DOMString URL; // Lowercased .url is the one in the spec, but leaving .URL for compatibility reasons.
readonly attribute DOMString url;