summaryrefslogtreecommitdiffstats
path: root/net/base/network_change_notifier_linux.h
diff options
context:
space:
mode:
authoreroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-12 23:54:34 +0000
committereroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-12 23:54:34 +0000
commit72de04b7687ea518ffb339a74ff449661b5b7346 (patch)
tree0d525bec36700cd80bea36d06438c5f3a9945ab6 /net/base/network_change_notifier_linux.h
parent8cd33545fefdd93d51e8a1f71f18b78f4fc6885f (diff)
downloadchromium_src-72de04b7687ea518ffb339a74ff449661b5b7346.zip
chromium_src-72de04b7687ea518ffb339a74ff449661b5b7346.tar.gz
chromium_src-72de04b7687ea518ffb339a74ff449661b5b7346.tar.bz2
Stop watching the netlink file descriptor before the message pump is destroyed.
A better fix is to make FileDescriptorWatcher handle this internally, will track that as a follow-up issue. BUG=39932 Review URL: http://codereview.chromium.org/1550003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44296 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/network_change_notifier_linux.h')
-rw-r--r--net/base/network_change_notifier_linux.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/net/base/network_change_notifier_linux.h b/net/base/network_change_notifier_linux.h
index 83e63a0..e12a73c 100644
--- a/net/base/network_change_notifier_linux.h
+++ b/net/base/network_change_notifier_linux.h
@@ -13,7 +13,9 @@
namespace net {
class NetworkChangeNotifierLinux
- : public NetworkChangeNotifier, public MessageLoopForIO::Watcher {
+ : public NetworkChangeNotifier,
+ public MessageLoopForIO::Watcher,
+ public MessageLoop::DestructionObserver {
public:
NetworkChangeNotifierLinux();
@@ -32,6 +34,10 @@ class NetworkChangeNotifierLinux
virtual void OnFileCanReadWithoutBlocking(int fd);
virtual void OnFileCanWriteWithoutBlocking(int /* fd */);
+ // MessageLoop::DestructionObserver methods:
+
+ virtual void WillDestroyCurrentMessageLoop();
+
private:
virtual ~NetworkChangeNotifierLinux();
@@ -44,10 +50,13 @@ class NetworkChangeNotifierLinux
// recv() would block. Otherwise, it returns a net error code.
int ReadNotificationMessage(char* buf, size_t len);
+ // Stops watching the netlink file descriptor.
+ void StopWatching();
+
ObserverList<Observer, true> observers_;
int netlink_fd_; // This is the netlink socket descriptor.
- MessageLoopForIO* const loop_;
+ MessageLoopForIO* loop_;
MessageLoopForIO::FileDescriptorWatcher netlink_watcher_;
DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierLinux);