| Index: base/message_loop/message_pump_io_ios.h
|
| diff --git a/base/message_loop/message_pump_io_ios.h b/base/message_loop/message_pump_io_ios.h
|
| index 6596862b88b43e1d874ddc880bdc99a3720f3b27..52de9fd6891d7e23b57f21f2cd1c5c7e20791470 100644
|
| --- a/base/message_loop/message_pump_io_ios.h
|
| +++ b/base/message_loop/message_pump_io_ios.h
|
| @@ -9,6 +9,7 @@
|
| #include "base/mac/scoped_cffiledescriptorref.h"
|
| #include "base/mac/scoped_cftyperef.h"
|
| #include "base/memory/ref_counted.h"
|
| +#include "base/memory/weak_ptr.h"
|
| #include "base/message_loop/message_pump_mac.h"
|
| #include "base/observer_list.h"
|
|
|
| @@ -70,8 +71,8 @@ class BASE_EXPORT MessagePumpIOSForIO : public MessagePumpNSRunLoop {
|
| CFRunLoopSourceRef fd_source,
|
| bool is_persistent);
|
|
|
| - void set_pump(MessagePumpIOSForIO* pump) { pump_ = pump; }
|
| - MessagePumpIOSForIO* pump() const { return pump_; }
|
| + void set_pump(base::WeakPtr<MessagePumpIOSForIO> pump) { pump_ = pump; }
|
| + const base::WeakPtr<MessagePumpIOSForIO>& pump() const { return pump_; }
|
|
|
| void set_watcher(Watcher* watcher) { watcher_ = watcher; }
|
|
|
| @@ -82,7 +83,7 @@ class BASE_EXPORT MessagePumpIOSForIO : public MessagePumpNSRunLoop {
|
| base::mac::ScopedCFFileDescriptorRef fdref_;
|
| CFOptionFlags callback_types_;
|
| base::ScopedCFTypeRef<CFRunLoopSourceRef> fd_source_;
|
| - scoped_refptr<MessagePumpIOSForIO> pump_;
|
| + base::WeakPtr<MessagePumpIOSForIO> pump_;
|
| Watcher* watcher_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(FileDescriptorWatcher);
|
| @@ -95,6 +96,7 @@ class BASE_EXPORT MessagePumpIOSForIO : public MessagePumpNSRunLoop {
|
| };
|
|
|
| MessagePumpIOSForIO();
|
| + virtual ~MessagePumpIOSForIO();
|
|
|
| // Have the current thread's message loop watch for a a situation in which
|
| // reading/writing to the FD can be performed without blocking.
|
| @@ -118,9 +120,6 @@ class BASE_EXPORT MessagePumpIOSForIO : public MessagePumpNSRunLoop {
|
| void AddIOObserver(IOObserver* obs);
|
| void RemoveIOObserver(IOObserver* obs);
|
|
|
| - protected:
|
| - virtual ~MessagePumpIOSForIO();
|
| -
|
| private:
|
| friend class MessagePumpIOSForIOTest;
|
|
|
| @@ -134,6 +133,8 @@ class BASE_EXPORT MessagePumpIOSForIO : public MessagePumpNSRunLoop {
|
| ObserverList<IOObserver> io_observers_;
|
| ThreadChecker watch_file_descriptor_caller_checker_;
|
|
|
| + base::WeakPtrFactory<MessagePumpIOSForIO> weak_factory_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(MessagePumpIOSForIO);
|
| };
|
|
|
|
|