Bug 1814798 - pt 2. Add a PHCManager component to control PHC r=glandium,emilio
[gecko.git] / netwerk / protocol / http / ObliviousHttpService.h
blob2d5b390072a278b9366a1e4fe00a53aa9465039d
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set sw=2 ts=8 et tw=80 : */
4 /* This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 #ifndef mozilla_net_ObliviousHttpService_h
9 #define mozilla_net_ObliviousHttpService_h
11 #include "mozilla/DataMutex.h"
12 #include "nsCOMPtr.h"
13 #include "nsIObliviousHttp.h"
14 #include "nsIObserver.h"
15 #include "nsIStreamLoader.h"
17 namespace mozilla::net {
19 class ObliviousHttpConfig {
20 public:
21 nsCOMPtr<nsIURI> mRelayURI;
22 nsTArray<uint8_t> mEncodedConfig;
25 class ObliviousHttpService final : public nsIObliviousHttpService,
26 public nsIObserver,
27 public nsIStreamLoaderObserver {
28 public:
29 NS_DECL_THREADSAFE_ISUPPORTS
30 NS_DECL_NSIOBLIVIOUSHTTPSERVICE
31 NS_DECL_NSIOBSERVER
32 NS_DECL_NSISTREAMLOADEROBSERVER
34 ObliviousHttpService();
36 private:
37 ~ObliviousHttpService() = default;
38 void ReadPrefs(const nsACString& whichPref);
39 void FetchConfig(bool aConfigURIChanged);
41 DataMutex<ObliviousHttpConfig> mTRRConfig;
44 } // namespace mozilla::net
46 #endif // mozilla_net_ObliviousHttpService_h