Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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 NSNETWORKLINKSERVICEMAC_H_
6 #define NSNETWORKLINKSERVICEMAC_H_
8 #include "nsINetworkLinkService.h"
9 #include "nsIObserver.h"
11 #include <SystemConfiguration/SCNetworkReachability.h>
13 class nsNetworkLinkService : public nsINetworkLinkService,
14 public nsIObserver
15 {
16 public:
17 NS_DECL_ISUPPORTS
18 NS_DECL_NSINETWORKLINKSERVICE
19 NS_DECL_NSIOBSERVER
21 nsNetworkLinkService();
22 virtual ~nsNetworkLinkService();
24 nsresult Init();
25 nsresult Shutdown();
27 private:
28 bool mLinkUp;
29 bool mStatusKnown;
31 SCNetworkReachabilityRef mReachability;
32 CFRunLoopRef mCFRunLoop;
34 void UpdateReachability();
35 void SendEvent();
36 static void ReachabilityChanged(SCNetworkReachabilityRef target,
37 SCNetworkConnectionFlags flags,
38 void *info);
39 };
41 #endif /* NSNETWORKLINKSERVICEMAC_H_ */