Bug 1660307 - Use thread-safe weak pointers in WebSocketImpl r=dragana
Differential Revision: https://phabricator.services.mozilla.com/D104518
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include "mozilla/Atomics.h"
|
||||
#include "mozilla/BasePrincipal.h"
|
||||
#include "mozilla/DOMEventTargetHelper.h"
|
||||
#include "mozilla/ThreadSafeWeakPtr.h"
|
||||
#include "mozilla/net/WebSocketChannel.h"
|
||||
#include "mozilla/dom/File.h"
|
||||
#include "mozilla/dom/MessageEvent.h"
|
||||
@@ -67,7 +68,6 @@
|
||||
#include "nsIWebSocketChannel.h"
|
||||
#include "nsIWebSocketListener.h"
|
||||
#include "nsProxyRelease.h"
|
||||
#include "nsWeakReference.h"
|
||||
#include "nsIWebSocketImpl.h"
|
||||
|
||||
#define OPEN_EVENT_STRING u"open"_ns
|
||||
@@ -83,11 +83,14 @@ namespace dom {
|
||||
class WebSocketImpl final : public nsIInterfaceRequestor,
|
||||
public nsIWebSocketListener,
|
||||
public nsIObserver,
|
||||
public nsSupportsWeakReference,
|
||||
public SupportsThreadSafeWeakPtr<WebSocketImpl>,
|
||||
public nsIRequest,
|
||||
public nsIEventTarget,
|
||||
public nsIWebSocketImpl {
|
||||
public:
|
||||
MOZ_DECLARE_THREADSAFEWEAKREFERENCE_TYPENAME(WebSocketImpl)
|
||||
MOZ_DECLARE_REFCOUNTED_TYPENAME(WebSocketImpl)
|
||||
|
||||
NS_DECL_NSIINTERFACEREQUESTOR
|
||||
NS_DECL_NSIWEBSOCKETLISTENER
|
||||
NS_DECL_NSIOBSERVER
|
||||
@@ -242,8 +245,7 @@ class WebSocketImpl final : public nsIInterfaceRequestor,
|
||||
};
|
||||
|
||||
NS_IMPL_ISUPPORTS(WebSocketImpl, nsIInterfaceRequestor, nsIWebSocketListener,
|
||||
nsIObserver, nsISupportsWeakReference, nsIRequest,
|
||||
nsIEventTarget, nsIWebSocketImpl)
|
||||
nsIObserver, nsIRequest, nsIEventTarget, nsIWebSocketImpl)
|
||||
|
||||
class CallDispatchConnectionCloseEvents final : public DiscardableRunnable {
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user