Skip to content

Commit fd134a9

Browse files
author
Butkovits Atila
committed
Backed out changeset 084279c12a76 (bug 1675207) for build bustage complaining about rules.mk. CLOSED TREE
1 parent 7f0ad04 commit fd134a9

File tree

5 files changed

+7
-62
lines changed

5 files changed

+7
-62
lines changed

dom/websocket/WebSocket.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -860,23 +860,6 @@ WebSocketImpl::OnServerClose(nsISupports* aContext, uint16_t aCode,
860860
return NS_OK;
861861
}
862862

863-
NS_IMETHODIMP
864-
WebSocketImpl::OnError() {
865-
if (!IsTargetThread()) {
866-
return Dispatch(
867-
NS_NewRunnableFunction("dom::FailConnectionRunnable",
868-
[self = RefPtr{this}]() {
869-
self->FailConnection(
870-
nsIWebSocketChannel::CLOSE_ABNORMAL);
871-
}),
872-
NS_DISPATCH_NORMAL);
873-
}
874-
875-
AssertIsOnTargetThread();
876-
FailConnection(nsIWebSocketChannel::CLOSE_ABNORMAL);
877-
return NS_OK;
878-
}
879-
880863
//-----------------------------------------------------------------------------
881864
// WebSocketImpl::nsIInterfaceRequestor
882865
//-----------------------------------------------------------------------------

netwerk/protocol/websocket/WebSocketChannelChild.cpp

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -294,44 +294,22 @@ class MessageEvent : public WebSocketEvent {
294294
bool mBinary;
295295
};
296296

297-
bool WebSocketChannelChild::RecvOnMessageAvailableInternal(
297+
void WebSocketChannelChild::RecvOnMessageAvailableInternal(
298298
const nsDependentCSubstring& aMsg, bool aMoreData, bool aBinary) {
299299
if (aMoreData) {
300-
return mReceivedMsgBuffer.Append(aMsg, fallible);
301-
}
302-
303-
if (!mReceivedMsgBuffer.Append(aMsg, fallible)) {
304-
return false;
300+
mReceivedMsgBuffer.Append(aMsg);
301+
return;
305302
}
306303

304+
mReceivedMsgBuffer.Append(aMsg);
307305
mEventQ->RunOrEnqueue(new EventTargetDispatcher(
308306
this, new MessageEvent(mReceivedMsgBuffer, aBinary), mTargetThread));
309307
mReceivedMsgBuffer.Truncate();
310-
return true;
311-
}
312-
313-
class OnErrorEvent : public WebSocketEvent {
314-
public:
315-
OnErrorEvent() = default;
316-
317-
void Run(WebSocketChannelChild* aChild) override { aChild->OnError(); }
318-
};
319-
320-
void WebSocketChannelChild::OnError() {
321-
LOG(("WebSocketChannelChild::OnError() %p", this));
322-
if (mListenerMT) {
323-
AutoEventEnqueuer ensureSerialDispatch(mEventQ);
324-
Unused << mListenerMT->mListener->OnError();
325-
}
326308
}
327309

328310
mozilla::ipc::IPCResult WebSocketChannelChild::RecvOnMessageAvailable(
329311
const nsDependentCSubstring& aMsg, const bool& aMoreData) {
330-
if (!RecvOnMessageAvailableInternal(aMsg, aMoreData, false)) {
331-
LOG(("WebSocketChannelChild %p append message failed", this));
332-
mEventQ->RunOrEnqueue(
333-
new EventTargetDispatcher(this, new OnErrorEvent(), mTargetThread));
334-
}
312+
RecvOnMessageAvailableInternal(aMsg, aMoreData, false);
335313
return IPC_OK();
336314
}
337315

@@ -353,11 +331,7 @@ void WebSocketChannelChild::OnMessageAvailable(const nsCString& aMsg) {
353331

354332
mozilla::ipc::IPCResult WebSocketChannelChild::RecvOnBinaryMessageAvailable(
355333
const nsDependentCSubstring& aMsg, const bool& aMoreData) {
356-
if (!RecvOnMessageAvailableInternal(aMsg, aMoreData, true)) {
357-
LOG(("WebSocketChannelChild %p append message failed", this));
358-
mEventQ->RunOrEnqueue(
359-
new EventTargetDispatcher(this, new OnErrorEvent(), mTargetThread));
360-
}
334+
RecvOnMessageAvailableInternal(aMsg, aMoreData, true);
361335
return IPC_OK();
362336
}
363337

netwerk/protocol/websocket/WebSocketChannelChild.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,9 @@ class WebSocketChannelChild final : public BaseWebSocketChannel,
8282
// This function tries to get a labeled event target for |mNeckoTarget|.
8383
void SetupNeckoTarget();
8484

85-
bool RecvOnMessageAvailableInternal(const nsDependentCSubstring& aMsg,
85+
void RecvOnMessageAvailableInternal(const nsDependentCSubstring& aMsg,
8686
bool aMoreData, bool aBinary);
8787

88-
void OnError();
89-
9088
RefPtr<ChannelEventQueue> mEventQ;
9189
nsString mEffectiveURL;
9290
nsCString mReceivedMsgBuffer;
@@ -102,7 +100,6 @@ class WebSocketChannelChild final : public BaseWebSocketChannel,
102100
friend class AcknowledgeEvent;
103101
friend class ServerCloseEvent;
104102
friend class AsyncOpenFailedEvent;
105-
friend class OnErrorEvent;
106103
};
107104

108105
} // namespace net

netwerk/protocol/websocket/WebSocketChannelParent.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,6 @@ WebSocketChannelParent::OnServerClose(nsISupports* aContext, uint16_t code,
307307
return NS_OK;
308308
}
309309

310-
NS_IMETHODIMP
311-
WebSocketChannelParent::OnError() { return NS_OK; }
312-
313310
void WebSocketChannelParent::ActorDestroy(ActorDestroyReason why) {
314311
LOG(("WebSocketChannelParent::ActorDestroy() %p\n", this));
315312

netwerk/protocol/websocket/nsIWebSocketListener.idl

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,6 @@ interface nsIWebSocketListener : nsISupports
8585
in unsigned short aCode,
8686
in AUTF8String aReason);
8787

88-
/**
89-
* Called to inform an error is happened. The connection will be closed
90-
* when this is called.
91-
*/
92-
[must_use] void OnError();
93-
9488
};
9589

9690

0 commit comments

Comments
 (0)