tor-browser

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

TRRServiceParent.h (1920B)


      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_TRRServiceParent_h
      8 #define mozilla_net_TRRServiceParent_h
      9 
     10 #include "mozilla/net/PTRRServiceParent.h"
     11 #include "mozilla/net/TRRServiceBase.h"
     12 #include "nsIObserver.h"
     13 #include "nsWeakReference.h"
     14 
     15 namespace mozilla {
     16 namespace net {
     17 
     18 class TRRServiceParent : public TRRServiceBase,
     19                         public nsIObserver,
     20                         public nsSupportsWeakReference,
     21                         public PTRRServiceParent {
     22 public:
     23  NS_DECL_ISUPPORTS_INHERITED
     24  NS_DECL_NSIOBSERVER
     25  NS_DECL_NSIPROXYCONFIGCHANGEDCALLBACK
     26 
     27  TRRServiceParent() = default;
     28  void Init();
     29 
     30  // For testing purposes only
     31  void ReloadParentalControlsEnabled();
     32 
     33  static void PrefsChanged(const char* aName, void* aSelf);
     34  void SetDetectedTrrURI(const nsACString& aURI);
     35  bool MaybeSetPrivateURI(const nsACString& aURI) override;
     36  void GetURI(nsACString& result) override;
     37  mozilla::ipc::IPCResult RecvNotifyNetworkConnectivityServiceObservers(
     38      const nsCString& aTopic);
     39  mozilla::ipc::IPCResult RecvInitTRRConnectionInfo(bool aForceReinit);
     40  mozilla::ipc::IPCResult RecvSetConfirmationState(uint32_t aNewState);
     41  uint32_t GetConfirmationState() { return mConfirmationState; }
     42  virtual void ReadEtcHostsFile() override;
     43 
     44 private:
     45  virtual ~TRRServiceParent();
     46  virtual void ActorDestroy(ActorDestroyReason why) override;
     47  void prefsChanged(const char* aName);
     48  void SetDefaultTRRConnectionInfo(nsHttpConnectionInfo* aConnInfo) override;
     49  uint32_t mConfirmationState = 0;
     50 };
     51 
     52 }  // namespace net
     53 }  // namespace mozilla
     54 
     55 #endif  // mozilla_net_TRRServiceParent_h