[webkit-changes] [WebKit/WebKit] de6935: Use std::span more in WebSocket code

Chris Dumez noreply at github.com
Fri Mar 15 20:50:11 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: de69356648cfb170e76b2e42d567049156356a71
      https://github.com/WebKit/WebKit/commit/de69356648cfb170e76b2e42d567049156356a71
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2024-03-15 (Fri, 15 Mar 2024)

  Changed paths:
    M Source/WTF/wtf/StreamBuffer.h
    M Source/WTF/wtf/text/WTFString.cpp
    M Source/WTF/wtf/text/WTFString.h
    M Source/WebCore/Modules/websockets/WebSocket.cpp
    M Source/WebCore/Modules/websockets/WebSocketChannelInspector.cpp
    M Source/WebCore/Modules/websockets/WebSocketChannelInspector.h
    M Source/WebCore/Modules/websockets/WebSocketDeflateFramer.cpp
    M Source/WebCore/Modules/websockets/WebSocketDeflater.cpp
    M Source/WebCore/Modules/websockets/WebSocketDeflater.h
    M Source/WebCore/Modules/websockets/WebSocketFrame.cpp
    M Source/WebCore/Modules/websockets/WebSocketFrame.h
    M Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp
    M Source/WebKit/NetworkProcess/NetworkSocketChannel.cpp
    M Source/WebKit/NetworkProcess/NetworkSocketChannel.h
    M Source/WebKit/NetworkProcess/cocoa/WebSocketTaskCocoa.mm
    M Source/WebKit/NetworkProcess/curl/WebSocketTaskCurl.cpp
    M Source/WebKit/NetworkProcess/curl/WebSocketTaskCurl.h
    M Source/WebKit/NetworkProcess/soup/WebSocketTaskSoup.cpp
    M Source/WebKit/WebProcess/Network/WebSocketChannel.cpp
    M Source/WebKit/WebProcess/Network/WebSocketChannel.h
    M Source/WebKitLegacy/WebCoreSupport/SocketStreamHandle.cpp
    M Source/WebKitLegacy/WebCoreSupport/SocketStreamHandle.h
    M Source/WebKitLegacy/WebCoreSupport/SocketStreamHandleImpl.cpp
    M Source/WebKitLegacy/WebCoreSupport/SocketStreamHandleImpl.h
    M Source/WebKitLegacy/WebCoreSupport/SocketStreamHandleImplCFNet.cpp
    M Source/WebKitLegacy/WebCoreSupport/WebSocketChannel.cpp
    M Source/WebKitLegacy/WebCoreSupport/WebSocketChannel.h

  Log Message:
  -----------
  Use std::span more in WebSocket code
https://bugs.webkit.org/show_bug.cgi?id=271035

Reviewed by Brent Fulgham.

Use std::span more in WebSocket code. This is work towards more widespread
std::span adoption in WebKit, which has security benefits.

* Source/JavaScriptCore/runtime/ArrayBuffer.h:
* Source/WTF/wtf/StreamBuffer.h:
(WTF::StreamBuffer::append):
(WTF::StreamBuffer::firstBlockSpan const):
* Source/WTF/wtf/text/WTFString.h:
(WTF::String::fromUTF8):
* Source/WebCore/Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::didReceiveMessage):
(WebCore::WebSocket::didReceiveBinaryData):
* Source/WebCore/Modules/websockets/WebSocketChannelInspector.cpp:
(WebCore::WebSocketChannelInspector::createFrame):
* Source/WebCore/Modules/websockets/WebSocketChannelInspector.h:
* Source/WebCore/Modules/websockets/WebSocketDeflateFramer.cpp:
(WebCore::WebSocketDeflateFramer::deflate):
(WebCore::WebSocketDeflateFramer::inflate):
* Source/WebCore/Modules/websockets/WebSocketDeflater.cpp:
(WebCore::setStreamParameter):
(WebCore::WebSocketDeflater::addBytes):
(WebCore::WebSocketDeflater::finish):
(WebCore::WebSocketInflater::addBytes):
(WebCore::WebSocketInflater::finish):
* Source/WebCore/Modules/websockets/WebSocketDeflater.h:
(WebCore::WebSocketDeflater::bytes const):
(WebCore::WebSocketInflater::data const):
(WebCore::WebSocketInflater::bytes const):
(WebCore::WebSocketInflater::data): Deleted.
* Source/WebCore/Modules/websockets/WebSocketFrame.cpp:
(WebCore::WebSocketFrame::parseFrame):
(WebCore::appendFramePayload):
(WebCore::WebSocketFrame::makeFrameData):
(WebCore::WebSocketFrame::WebSocketFrame):
* Source/WebCore/Modules/websockets/WebSocketFrame.h:
(WebCore::WebSocketFrame::WebSocketFrame):
* Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::Inspector::buildWebSocketMessage):
* Source/WebKit/WebProcess/Network/WebSocketChannel.cpp:
(WebKit::WebSocketChannel::notifySendFrame):
(WebKit::WebSocketChannel::createMessageQueue):
* Source/WebKit/WebProcess/Network/WebSocketChannel.h:
* Source/WebKitLegacy/WebCoreSupport/SocketStreamHandle.cpp:
(WebCore::SocketStreamHandle::sendData):
* Source/WebKitLegacy/WebCoreSupport/SocketStreamHandle.h:
* Source/WebKitLegacy/WebCoreSupport/SocketStreamHandleImpl.cpp:
(WebCore::SocketStreamHandleImpl::platformSend):
(WebCore::SocketStreamHandleImpl::platformSendHandshake):
(WebCore::SocketStreamHandleImpl::sendPendingData):
* Source/WebKitLegacy/WebCoreSupport/SocketStreamHandleImpl.h:
* Source/WebKitLegacy/WebCoreSupport/SocketStreamHandleImplCFNet.cpp:
(WebCore::SocketStreamHandleImpl::platformSendInternal):
* Source/WebKitLegacy/WebCoreSupport/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::send):
(WebCore::WebSocketChannel::startClosingHandshake):
(WebCore::WebSocketChannel::processFrame):
(WebCore::WebSocketChannel::enqueueRawFrame):
(WebCore::WebSocketChannel::processOutgoingFrameQueue):
(WebCore::WebSocketChannel::sendFrame):
* Source/WebKitLegacy/WebCoreSupport/WebSocketChannel.h:

Canonical link: https://commits.webkit.org/276224@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list