tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

WebSocketChannelParent.h (2564B)


      1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim: set sw=2 ts=8 et tw=80 : */
      3 /* This Source Code Form is subject to the terms of the Mozilla Public
      4 * License, v. 2.0. If a copy of the MPL was not distributed with this
      5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #ifndef mozilla_net_WebSocketChannelParent_h
      8 #define mozilla_net_WebSocketChannelParent_h
      9 
     10 #include "mozilla/net/PWebSocketParent.h"
     11 #include "mozilla/net/NeckoParent.h"
     12 #include "nsIInterfaceRequestor.h"
     13 #include "nsIWebSocketListener.h"
     14 #include "nsIWebSocketChannel.h"
     15 #include "nsILoadContext.h"
     16 #include "nsCOMPtr.h"
     17 #include "nsString.h"
     18 
     19 class nsIAuthPromptProvider;
     20 
     21 namespace mozilla {
     22 namespace net {
     23 
     24 class WebSocketChannelParent : public PWebSocketParent,
     25                               public nsIWebSocketListener,
     26                               public nsIInterfaceRequestor {
     27  friend class PWebSocketParent;
     28 
     29  ~WebSocketChannelParent() = default;
     30 
     31 public:
     32  NS_DECL_THREADSAFE_ISUPPORTS
     33  NS_DECL_NSIWEBSOCKETLISTENER
     34  NS_DECL_NSIINTERFACEREQUESTOR
     35 
     36  WebSocketChannelParent(nsIAuthPromptProvider* aAuthProvider,
     37                         nsILoadContext* aLoadContext,
     38                         PBOverrideStatus aOverrideStatus, uint32_t aSerial);
     39 
     40 private:
     41  mozilla::ipc::IPCResult RecvAsyncOpen(
     42      nsIURI* aURI, const nsCString& aOrigin,
     43      const OriginAttributes& aOriginAttributes, const uint64_t& aInnerWindowID,
     44      const nsCString& aProtocol, const bool& aSecure,
     45      const uint32_t& aPingInterval, const bool& aClientSetPingInterval,
     46      const uint32_t& aPingTimeout, const bool& aClientSetPingTimeout,
     47      const LoadInfoArgs& aLoadInfoArgs,
     48      const Maybe<PTransportProviderParent*>& aTransportProvider,
     49      const nsCString& aNegotiatedExtensions);
     50  mozilla::ipc::IPCResult RecvClose(const uint16_t& code,
     51                                    const nsCString& reason);
     52  mozilla::ipc::IPCResult RecvSendMsg(const nsCString& aMsg);
     53  mozilla::ipc::IPCResult RecvSendBinaryMsg(const nsCString& aMsg);
     54  mozilla::ipc::IPCResult RecvSendBinaryStream(const IPCStream& aStream,
     55                                               const uint32_t& aLength);
     56  mozilla::ipc::IPCResult RecvDeleteSelf();
     57 
     58  void ActorDestroy(ActorDestroyReason why) override;
     59 
     60  nsCOMPtr<nsIAuthPromptProvider> mAuthProvider;
     61  nsCOMPtr<nsIWebSocketChannel> mChannel;
     62  nsCOMPtr<nsILoadContext> mLoadContext;
     63 
     64  uint32_t mSerial;
     65 };
     66 
     67 }  // namespace net
     68 }  // namespace mozilla
     69 
     70 #endif  // mozilla_net_WebSocketChannelParent_h