tor-browser

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

WebrtcTCPSocketChild.h (1561B)


      1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim: set sw=2 ts=8 et tw=80 ft=cpp : */
      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 file,
      5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #ifndef mozilla_net_WebrtcTCPSocketChild_h
      8 #define mozilla_net_WebrtcTCPSocketChild_h
      9 
     10 #include "mozilla/dom/ipc/IdType.h"
     11 #include "mozilla/net/PWebrtcTCPSocketChild.h"
     12 #include "transport/nr_socket_proxy_config.h"
     13 
     14 namespace mozilla::net {
     15 
     16 class WebrtcTCPSocketCallback;
     17 
     18 class WebrtcTCPSocketChild : public PWebrtcTCPSocketChild {
     19 public:
     20  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(WebrtcTCPSocketChild)
     21 
     22  mozilla::ipc::IPCResult RecvOnClose(const nsresult& aReason) override;
     23 
     24  mozilla::ipc::IPCResult RecvOnConnected(
     25      const nsACString& aProxyType) override;
     26 
     27  mozilla::ipc::IPCResult RecvOnRead(nsTArray<uint8_t>&& aReadData) override;
     28 
     29  explicit WebrtcTCPSocketChild(WebrtcTCPSocketCallback* aProxyCallbacks);
     30 
     31  void AsyncOpen(const nsACString& aHost, const int& aPort,
     32                 const nsACString& aLocalAddress, const int& aLocalPort,
     33                 bool aUseTls,
     34                 const std::shared_ptr<NrSocketProxyConfig>& aProxyConfig);
     35 
     36  void AddIPDLReference() { AddRef(); }
     37  void ReleaseIPDLReference() { Release(); }
     38 
     39 protected:
     40  virtual ~WebrtcTCPSocketChild();
     41 
     42  RefPtr<WebrtcTCPSocketCallback> mProxyCallbacks;
     43 };
     44 
     45 }  // namespace mozilla::net
     46 
     47 #endif  // mozilla_net_WebrtcTCPSocketChild_h