| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_LINUX_H_ | 5 #ifndef NET_BASE_NETWORK_CHANGE_NOTIFIER_LINUX_H_ |
| 6 #define NET_BASE_NETWORK_CHANGE_NOTIFIER_LINUX_H_ | 6 #define NET_BASE_NETWORK_CHANGE_NOTIFIER_LINUX_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 void ListenForNotifications(); | 46 void ListenForNotifications(); |
| 47 | 47 |
| 48 // Attempts to read from the netlink socket into |buf| of length |len|. | 48 // Attempts to read from the netlink socket into |buf| of length |len|. |
| 49 // Returns the bytes read on synchronous success and ERR_IO_PENDING if the | 49 // Returns the bytes read on synchronous success and ERR_IO_PENDING if the |
| 50 // recv() would block. Otherwise, it returns a net error code. | 50 // recv() would block. Otherwise, it returns a net error code. |
| 51 int ReadNotificationMessage(char* buf, size_t len); | 51 int ReadNotificationMessage(char* buf, size_t len); |
| 52 | 52 |
| 53 // Stops watching the netlink file descriptor. | 53 // Stops watching the netlink file descriptor. |
| 54 void StopWatching(); | 54 void StopWatching(); |
| 55 | 55 |
| 56 ObserverList<Observer, true> observers_; | 56 // http://crbug.com/36890. |
| 57 ObserverList<Observer, false> observers_; |
| 57 | 58 |
| 58 int netlink_fd_; // This is the netlink socket descriptor. | 59 int netlink_fd_; // This is the netlink socket descriptor. |
| 59 MessageLoopForIO* loop_; | 60 MessageLoopForIO* loop_; |
| 60 MessageLoopForIO::FileDescriptorWatcher netlink_watcher_; | 61 MessageLoopForIO::FileDescriptorWatcher netlink_watcher_; |
| 61 | 62 |
| 62 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierLinux); | 63 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierLinux); |
| 63 }; | 64 }; |
| 64 | 65 |
| 65 } // namespace net | 66 } // namespace net |
| 66 | 67 |
| 67 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_LINUX_H_ | 68 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_LINUX_H_ |
| OLD | NEW |