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"
13 #include "nsIObliviousHttp.h"
14 #include "nsIObserver.h"
15 #include "nsIStreamLoader.h"
17 namespace mozilla::net
{
19 class ObliviousHttpConfig
{
21 nsCOMPtr
<nsIURI
> mRelayURI
;
22 nsTArray
<uint8_t> mEncodedConfig
;
25 class ObliviousHttpService final
: public nsIObliviousHttpService
,
27 public nsIStreamLoaderObserver
{
29 NS_DECL_THREADSAFE_ISUPPORTS
30 NS_DECL_NSIOBLIVIOUSHTTPSERVICE
32 NS_DECL_NSISTREAMLOADEROBSERVER
34 ObliviousHttpService();
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