Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(303)

Side by Side Diff: net/base/network_change_notifier_mac.h

Issue 7135005: NetworkChangeNotifierMac: lock access to network_reachable_ as it may be read (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | net/base/network_change_notifier_mac.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_BASE_NETWORK_CHANGE_NOTIFIER_MAC_H_ 5 #ifndef NET_BASE_NETWORK_CHANGE_NOTIFIER_MAC_H_
6 #define NET_BASE_NETWORK_CHANGE_NOTIFIER_MAC_H_ 6 #define NET_BASE_NETWORK_CHANGE_NOTIFIER_MAC_H_
7 #pragma once 7 #pragma once
8 8
9 #include <SystemConfiguration/SCDynamicStore.h> 9 #include <SystemConfiguration/SCDynamicStore.h>
10 #include <SystemConfiguration/SCNetworkReachability.h> 10 #include <SystemConfiguration/SCNetworkReachability.h>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/mac/scoped_cftyperef.h" 13 #include "base/mac/scoped_cftyperef.h"
14 #include "base/synchronization/lock.h"
14 #include "net/base/network_change_notifier.h" 15 #include "net/base/network_change_notifier.h"
15 #include "net/base/network_config_watcher_mac.h" 16 #include "net/base/network_config_watcher_mac.h"
16 17
17 namespace net { 18 namespace net {
18 19
19 class NetworkChangeNotifierMac: public NetworkChangeNotifier { 20 class NetworkChangeNotifierMac: public NetworkChangeNotifier {
20 public: 21 public:
21 NetworkChangeNotifierMac(); 22 NetworkChangeNotifierMac();
22 virtual ~NetworkChangeNotifierMac(); 23 virtual ~NetworkChangeNotifierMac();
23 24
(...skipping 27 matching lines...) Expand all
51 52
52 static void ReachabilityCallback(SCNetworkReachabilityRef target, 53 static void ReachabilityCallback(SCNetworkReachabilityRef target,
53 SCNetworkConnectionFlags flags, 54 SCNetworkConnectionFlags flags,
54 void* notifier); 55 void* notifier);
55 56
56 Forwarder forwarder_; 57 Forwarder forwarder_;
57 const NetworkConfigWatcherMac config_watcher_; 58 const NetworkConfigWatcherMac config_watcher_;
58 base::mac::ScopedCFTypeRef<CFRunLoopRef> run_loop_; 59 base::mac::ScopedCFTypeRef<CFRunLoopRef> run_loop_;
59 base::mac::ScopedCFTypeRef<SCNetworkReachabilityRef> reachability_; 60 base::mac::ScopedCFTypeRef<SCNetworkReachabilityRef> reachability_;
60 bool network_reachable_; 61 bool network_reachable_;
62 mutable base::Lock network_reachable_lock_;
61 63
62 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierMac); 64 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierMac);
63 }; 65 };
64 66
65 } // namespace net 67 } // namespace net
66 68
67 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_MAC_H_ 69 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_MAC_H_
OLDNEW
« no previous file with comments | « no previous file | net/base/network_change_notifier_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698