netwerk/system/mac/nsNetworkLinkService.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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_ */

mercurial