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

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

Issue 663043004: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « no previous file | net/base/directory_lister_unittest.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_ADDRESS_TRACKER_LINUX_H_ 5 #ifndef NET_BASE_ADDRESS_TRACKER_LINUX_H_
6 #define NET_BASE_ADDRESS_TRACKER_LINUX_H_ 6 #define NET_BASE_ADDRESS_TRACKER_LINUX_H_
7 7
8 #include <sys/socket.h> // Needed to include netlink. 8 #include <sys/socket.h> // Needed to include netlink.
9 // Mask superfluous definition of |struct net|. This is fixed in Linux 2.6.38. 9 // Mask superfluous definition of |struct net|. This is fixed in Linux 2.6.38.
10 #define net net_kernel 10 #define net net_kernel
(...skipping 29 matching lines...) Expand all
40 // GetAddressMap(). 40 // GetAddressMap().
41 AddressTrackerLinux(); 41 AddressTrackerLinux();
42 42
43 // Tracking version constructor: it will run |address_callback| when 43 // Tracking version constructor: it will run |address_callback| when
44 // the AddressMap changes, |link_callback| when the list of online 44 // the AddressMap changes, |link_callback| when the list of online
45 // links changes, and |tunnel_callback| when the list of online 45 // links changes, and |tunnel_callback| when the list of online
46 // tunnels changes. 46 // tunnels changes.
47 AddressTrackerLinux(const base::Closure& address_callback, 47 AddressTrackerLinux(const base::Closure& address_callback,
48 const base::Closure& link_callback, 48 const base::Closure& link_callback,
49 const base::Closure& tunnel_callback); 49 const base::Closure& tunnel_callback);
50 virtual ~AddressTrackerLinux(); 50 ~AddressTrackerLinux() override;
51 51
52 // In tracking mode, it starts watching the system configuration for 52 // In tracking mode, it starts watching the system configuration for
53 // changes. The current thread must have a MessageLoopForIO. In 53 // changes. The current thread must have a MessageLoopForIO. In
54 // non-tracking mode, once Init() returns, a snapshot of the system 54 // non-tracking mode, once Init() returns, a snapshot of the system
55 // configuration is available through GetOnlineLinks() and 55 // configuration is available through GetOnlineLinks() and
56 // GetAddressMap(). 56 // GetAddressMap().
57 void Init(); 57 void Init();
58 58
59 AddressMap GetAddressMap() const; 59 AddressMap GetAddressMap() const;
60 60
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 void HandleMessage(char* buffer, 101 void HandleMessage(char* buffer,
102 size_t length, 102 size_t length,
103 bool* address_changed, 103 bool* address_changed,
104 bool* link_changed, 104 bool* link_changed,
105 bool* tunnel_changed); 105 bool* tunnel_changed);
106 106
107 // Call when some part of initialization failed; forces online and unblocks. 107 // Call when some part of initialization failed; forces online and unblocks.
108 void AbortAndForceOnline(); 108 void AbortAndForceOnline();
109 109
110 // MessageLoopForIO::Watcher: 110 // MessageLoopForIO::Watcher:
111 virtual void OnFileCanReadWithoutBlocking(int fd) override; 111 void OnFileCanReadWithoutBlocking(int fd) override;
112 virtual void OnFileCanWriteWithoutBlocking(int /* fd */) override; 112 void OnFileCanWriteWithoutBlocking(int /* fd */) override;
113 113
114 // Close |netlink_fd_| 114 // Close |netlink_fd_|
115 void CloseSocket(); 115 void CloseSocket();
116 116
117 // Does |msg| refer to a tunnel interface? 117 // Does |msg| refer to a tunnel interface?
118 bool IsTunnelInterface(const struct ifinfomsg* msg) const; 118 bool IsTunnelInterface(const struct ifinfomsg* msg) const;
119 119
120 // Gets the name of an interface given the interface index |interface_index|. 120 // Gets the name of an interface given the interface index |interface_index|.
121 // May return empty string if it fails but should not return NULL. This is 121 // May return empty string if it fails but should not return NULL. This is
122 // overridden by tests. 122 // overridden by tests.
(...skipping 20 matching lines...) Expand all
143 bool tracking_; 143 bool tracking_;
144 144
145 // Used to verify single-threaded access in non-tracking mode. 145 // Used to verify single-threaded access in non-tracking mode.
146 base::ThreadChecker thread_checker_; 146 base::ThreadChecker thread_checker_;
147 }; 147 };
148 148
149 } // namespace internal 149 } // namespace internal
150 } // namespace net 150 } // namespace net
151 151
152 #endif // NET_BASE_ADDRESS_TRACKER_LINUX_H_ 152 #endif // NET_BASE_ADDRESS_TRACKER_LINUX_H_
OLDNEW
« no previous file with comments | « no previous file | net/base/directory_lister_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698