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

Unified Diff: net/base/network_change_notifier_linux.h

Issue 1550003: Stop watching the netlink file descriptor before the message pump is destroye... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: syn and resolve Created 10 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/base/network_change_notifier_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/network_change_notifier_linux.h
===================================================================
--- net/base/network_change_notifier_linux.h (revision 44286)
+++ net/base/network_change_notifier_linux.h (working copy)
@@ -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 @@
virtual void OnFileCanReadWithoutBlocking(int fd);
virtual void OnFileCanWriteWithoutBlocking(int /* fd */);
+ // MessageLoop::DestructionObserver methods:
+
+ virtual void WillDestroyCurrentMessageLoop();
+
private:
virtual ~NetworkChangeNotifierLinux();
@@ -44,10 +50,13 @@
// 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);
« no previous file with comments | « no previous file | net/base/network_change_notifier_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698