From 98d19fa6244384f7e17998b5420d724481ed3835 Mon Sep 17 00:00:00 2001 From: dave caruso Date: Mon, 16 Oct 2023 21:22:43 -0700 Subject: fix(runtime): make some things more stable (partial jsc debug build) (#5881) * make our debug assertions work * install bun-webkit-debug * more progress * ok * progress... * more debug build stuff * ok * a * asdfghjkl * fix(runtime): fix bad assertion failure in JSBufferList * ok * stuff * upgrade webkit * Update src/bun.js/bindings/JSDOMWrapperCache.h Co-authored-by: Jarred Sumner * fix message for colin's changes * okay * fix cjs prototype * implement mainModule * i think this fixes it all --------- Co-authored-by: Jarred Sumner --- src/bun.js/bindings/webcore/WebSocket.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src/bun.js/bindings/webcore/WebSocket.cpp') diff --git a/src/bun.js/bindings/webcore/WebSocket.cpp b/src/bun.js/bindings/webcore/WebSocket.cpp index c1a4054f5..4f7f933c5 100644 --- a/src/bun.js/bindings/webcore/WebSocket.cpp +++ b/src/bun.js/bindings/webcore/WebSocket.cpp @@ -161,7 +161,6 @@ WebSocket::WebSocket(ScriptExecutionContext& context) { m_state = CONNECTING; m_hasPendingActivity.store(true); - ref(); } WebSocket::~WebSocket() @@ -650,7 +649,7 @@ ExceptionOr WebSocket::close(std::optional optionalCode, c ExceptionOr WebSocket::terminate() { - LOG(Network, "WebSocket %p terminate()", this); + // LOG(Network, "WebSocket %p terminate()", this); if (m_state == CLOSING || m_state == CLOSED) return {}; @@ -692,7 +691,7 @@ ExceptionOr WebSocket::terminate() ExceptionOr WebSocket::ping() { auto message = WTF::String::number(WTF::jsCurrentTime()); - LOG(Network, "WebSocket %p ping() Sending Timestamp '%s'", this, message.data()); + // LOG(Network, "WebSocket %p ping() Sending Timestamp '%s'", this, message.data()); if (m_state == CONNECTING) return Exception { InvalidStateError }; @@ -711,7 +710,7 @@ ExceptionOr WebSocket::ping() ExceptionOr WebSocket::ping(const String& message) { - LOG(Network, "WebSocket %p ping() Sending String '%s'", this, message.utf8().data()); + // LOG(Network, "WebSocket %p ping() Sending String '%s'", this, message.utf8().data()); if (m_state == CONNECTING) return Exception { InvalidStateError }; @@ -731,7 +730,7 @@ ExceptionOr WebSocket::ping(const String& message) ExceptionOr WebSocket::ping(ArrayBuffer& binaryData) { - LOG(Network, "WebSocket %p ping() Sending ArrayBuffer %p", this, &binaryData); + // LOG(Network, "WebSocket %p ping() Sending ArrayBuffer %p", this, &binaryData); if (m_state == CONNECTING) return Exception { InvalidStateError }; @@ -751,7 +750,7 @@ ExceptionOr WebSocket::ping(ArrayBuffer& binaryData) ExceptionOr WebSocket::ping(ArrayBufferView& arrayBufferView) { - LOG(Network, "WebSocket %p ping() Sending ArrayBufferView %p", this, &arrayBufferView); + // LOG(Network, "WebSocket %p ping() Sending ArrayBufferView %p", this, &arrayBufferView); if (m_state == CONNECTING) return Exception { InvalidStateError }; @@ -774,7 +773,7 @@ ExceptionOr WebSocket::ping(ArrayBufferView& arrayBufferView) ExceptionOr WebSocket::pong() { auto message = WTF::String::number(WTF::jsCurrentTime()); - LOG(Network, "WebSocket %p pong() Sending Timestamp '%s'", this, message.data()); + // LOG(Network, "WebSocket %p pong() Sending Timestamp '%s'", this, message.data()); if (m_state == CONNECTING) return Exception { InvalidStateError }; @@ -793,7 +792,7 @@ ExceptionOr WebSocket::pong() ExceptionOr WebSocket::pong(const String& message) { - LOG(Network, "WebSocket %p pong() Sending String '%s'", this, message.utf8().data()); + // LOG(Network, "WebSocket %p pong() Sending String '%s'", this, message.utf8().data()); if (m_state == CONNECTING) return Exception { InvalidStateError }; @@ -813,7 +812,7 @@ ExceptionOr WebSocket::pong(const String& message) ExceptionOr WebSocket::pong(ArrayBuffer& binaryData) { - LOG(Network, "WebSocket %p pong() Sending ArrayBuffer %p", this, &binaryData); + // LOG(Network, "WebSocket %p pong() Sending ArrayBuffer %p", this, &binaryData); if (m_state == CONNECTING) return Exception { InvalidStateError }; @@ -833,7 +832,7 @@ ExceptionOr WebSocket::pong(ArrayBuffer& binaryData) ExceptionOr WebSocket::pong(ArrayBufferView& arrayBufferView) { - LOG(Network, "WebSocket %p pong() Sending ArrayBufferView %p", this, &arrayBufferView); + // LOG(Network, "WebSocket %p pong() Sending ArrayBufferView %p", this, &arrayBufferView); if (m_state == CONNECTING) return Exception { InvalidStateError }; @@ -1431,7 +1430,7 @@ extern "C" void WebSocket__didAbruptClose(WebCore::WebSocket* webSocket, int32_t { webSocket->didFailWithErrorCode(errorCode); } -extern "C" void WebSocket__didClose(WebCore::WebSocket* webSocket, uint16_t errorCode, const BunString *reason) +extern "C" void WebSocket__didClose(WebCore::WebSocket* webSocket, uint16_t errorCode, const BunString* reason) { WTF::String wtf_reason = Bun::toWTFString(*reason); webSocket->didClose(0, errorCode, WTFMove(wtf_reason)); -- cgit v1.2.3