tor-browser

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

TCPServerSocketChild.h (1634B)


      1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim: set ts=8 sts=2 et sw=2 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 file,
      5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #ifndef mozilla_dom_TCPServerSocketChild_h
      8 #define mozilla_dom_TCPServerSocketChild_h
      9 
     10 #include "mozilla/net/PTCPServerSocketChild.h"
     11 #include "nsCOMPtr.h"
     12 #include "nsCycleCollectionParticipant.h"
     13 
     14 #define TCPSERVERSOCKETCHILD_CID \
     15  {0x41a77ec8, 0xfd86, 0x409e, {0xae, 0xa9, 0xaf, 0x2c, 0xa4, 0x07, 0xef, 0x8e}}
     16 
     17 class nsITCPServerSocketInternal;
     18 
     19 namespace mozilla::dom {
     20 
     21 class TCPServerSocket;
     22 
     23 class TCPServerSocketChildBase : public nsISupports {
     24 public:
     25  NS_DECL_CYCLE_COLLECTION_CLASS(TCPServerSocketChildBase)
     26  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     27 
     28  void AddIPDLReference();
     29  void ReleaseIPDLReference();
     30 
     31 protected:
     32  TCPServerSocketChildBase();
     33  virtual ~TCPServerSocketChildBase();
     34 
     35  RefPtr<TCPServerSocket> mServerSocket;
     36  bool mIPCOpen;
     37 };
     38 
     39 class TCPServerSocketChild : public mozilla::net::PTCPServerSocketChild,
     40                             public TCPServerSocketChildBase {
     41 public:
     42  NS_IMETHOD_(MozExternalRefCountType) Release() override;
     43 
     44  TCPServerSocketChild(TCPServerSocket* aServerSocket, uint16_t aLocalPort,
     45                       uint16_t aBacklog, bool aUseArrayBuffers);
     46  ~TCPServerSocketChild();
     47 
     48  void Close();
     49 
     50  mozilla::ipc::IPCResult RecvCallbackAccept(PTCPSocketChild* socket);
     51 };
     52 
     53 }  // namespace mozilla::dom
     54 
     55 #endif  // mozilla_dom_TCPServerSocketChild_h