netwerk/system/mac/nsNetworkLinkService.h

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     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