Bug 1526591 - Remove devtools.inspector.shapesHighlighter.enabled pref. r=rcaliman
[gecko.git] / netwerk / base / NetworkConnectivityService.h
blobc51ecb82ba93b05a332855ce6c1fcab313439e61
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef NetworkConnectivityService_h_
6 #define NetworkConnectivityService_h_
8 #include "nsINetworkConnectivityService.h"
10 namespace mozilla {
11 namespace net {
13 class NetworkConnectivityService : public nsINetworkConnectivityService,
14 public nsIObserver,
15 public nsIDNSListener,
16 public nsIStreamListener {
17 public:
18 NS_DECL_ISUPPORTS
19 NS_DECL_NSINETWORKCONNECTIVITYSERVICE
20 NS_DECL_NSIOBSERVER
21 NS_DECL_NSIDNSLISTENER
22 NS_DECL_NSISTREAMLISTENER
23 NS_DECL_NSIREQUESTOBSERVER
25 nsresult Init();
26 static already_AddRefed<NetworkConnectivityService> GetSingleton();
28 private:
29 NetworkConnectivityService() = default;
30 virtual ~NetworkConnectivityService() = default;
32 // Calls all the check methods
33 void PerformChecks();
35 // Will be set to OK if the DNS request returned in IP of this type,
36 // NOT_AVAILABLE if that type of resolution is not available
37 // UNKNOWN if the check wasn't performed
38 ConnectivityState mDNSv4 = nsINetworkConnectivityService::UNKNOWN;
39 ConnectivityState mDNSv6 = nsINetworkConnectivityService::UNKNOWN;
41 ConnectivityState mIPv4 = nsINetworkConnectivityService::UNKNOWN;
42 ConnectivityState mIPv6 = nsINetworkConnectivityService::UNKNOWN;
44 nsCOMPtr<nsICancelable> mDNSv4Request;
45 nsCOMPtr<nsICancelable> mDNSv6Request;
47 nsCOMPtr<nsIChannel> mIPv4Channel;
48 nsCOMPtr<nsIChannel> mIPv6Channel;
51 } // namespace net
52 } // namespace mozilla
54 #endif // NetworkConnectivityService_h_