summaryrefslogtreecommitdiff
path: root/netwerk
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2022-12-15 10:59:40 +0000
committerMoonchild <moonchild@palemoon.org>2022-12-15 10:59:40 +0000
commitdf2b82e2cb9c42e10820aa74702fa94029e24d2c (patch)
tree3717394e4e3dc5d9b5d42520ad53a0fee49d997b /netwerk
parentc34cceb678dfd8698e341ff47738aed342144c47 (diff)
downloaduxp-df2b82e2cb9c42e10820aa74702fa94029e24d2c.tar.gz
[network] move some generic websocket code to the baseclass
Diffstat (limited to 'netwerk')
-rw-r--r--netwerk/protocol/websocket/BaseWebSocketChannel.cpp5
-rw-r--r--netwerk/protocol/websocket/BaseWebSocketChannel.h1
-rw-r--r--netwerk/protocol/websocket/WebSocketChannel.cpp2
-rw-r--r--netwerk/protocol/websocket/WebSocketChannel.h2
4 files changed, 7 insertions, 3 deletions
diff --git a/netwerk/protocol/websocket/BaseWebSocketChannel.cpp b/netwerk/protocol/websocket/BaseWebSocketChannel.cpp
index 67a578a828..88c691cdf0 100644
--- a/netwerk/protocol/websocket/BaseWebSocketChannel.cpp
+++ b/netwerk/protocol/websocket/BaseWebSocketChannel.cpp
@@ -62,6 +62,11 @@ BaseWebSocketChannel::BaseWebSocketChannel()
mSerial = (processBits << kWebSocketIDWebSocketBits) | webSocketBits;
}
+BaseWebSocketChannel::~BaseWebSocketChannel() {
+ NS_ReleaseOnMainThread(mLoadGroup.forget());
+ NS_ReleaseOnMainThread(mLoadInfo.forget());
+}
+
//-----------------------------------------------------------------------------
// BaseWebSocketChannel::nsIWebSocketChannel
//-----------------------------------------------------------------------------
diff --git a/netwerk/protocol/websocket/BaseWebSocketChannel.h b/netwerk/protocol/websocket/BaseWebSocketChannel.h
index 7498ae0bf6..154f5c80a7 100644
--- a/netwerk/protocol/websocket/BaseWebSocketChannel.h
+++ b/netwerk/protocol/websocket/BaseWebSocketChannel.h
@@ -79,6 +79,7 @@ class BaseWebSocketChannel : public nsIWebSocketChannel,
};
protected:
+ virtual ~BaseWebSocketChannel();
nsCOMPtr<nsIURI> mOriginalURI;
nsCOMPtr<nsIURI> mURI;
RefPtr<ListenerAndContextContainer> mListenerMT;
diff --git a/netwerk/protocol/websocket/WebSocketChannel.cpp b/netwerk/protocol/websocket/WebSocketChannel.cpp
index 679252500f..058dc46417 100644
--- a/netwerk/protocol/websocket/WebSocketChannel.cpp
+++ b/netwerk/protocol/websocket/WebSocketChannel.cpp
@@ -1243,8 +1243,6 @@ WebSocketChannel::~WebSocketChannel()
mListenerMT = nullptr;
- NS_ReleaseOnMainThread(mLoadGroup.forget());
- NS_ReleaseOnMainThread(mLoadInfo.forget());
NS_ReleaseOnMainThread(mService.forget());
}
diff --git a/netwerk/protocol/websocket/WebSocketChannel.h b/netwerk/protocol/websocket/WebSocketChannel.h
index b496bbc0a0..879027b2ad 100644
--- a/netwerk/protocol/websocket/WebSocketChannel.h
+++ b/netwerk/protocol/websocket/WebSocketChannel.h
@@ -124,7 +124,7 @@ public:
const static uint8_t kPayloadLengthBitsMask = 0x7F;
protected:
- virtual ~WebSocketChannel();
+ ~WebSocketChannel() override;
private:
friend class OutboundEnqueuer;