Index: base/message_pump_win.cc |
diff --git a/base/message_pump_win.cc b/base/message_pump_win.cc |
index 1bb6cfaa6876a0c38f4e0e051267dfdfb4e043a2..6fa3e7df0cbe032e4d32d4e29631026c784b6860 100644 |
--- a/base/message_pump_win.cc |
+++ b/base/message_pump_win.cc |
@@ -497,9 +497,11 @@ bool MessagePumpForIO::WaitForIOCompletion(DWORD timeout, IOHandler* filter) { |
// Save this item for later |
completed_io_.push_back(item); |
} else { |
- DCHECK(item.context->handler == item.handler); |
+ DCHECK_EQ(item.context->handler, item.handler); |
+ WillProcessIOEvent(); |
item.handler->OnIOCompleted(item.context, item.bytes_transfered, |
item.error); |
+ DidProcessIOEvent(); |
} |
} else { |
// The handler must be gone by now, just cleanup the mess. |
@@ -551,4 +553,20 @@ bool MessagePumpForIO::MatchCompletedIOItem(IOHandler* filter, IOItem* item) { |
return false; |
} |
+void MessagePumpForIO::AddIOObserver(IOObserver *obs) { |
+ io_observers_.AddObserver(obs); |
+} |
+ |
+void MessagePumpForIO::RemoveIOObserver(IOObserver *obs) { |
+ io_observers_.RemoveObserver(obs); |
+} |
+ |
+void MessagePumpForIO::WillProcessIOEvent() { |
+ FOR_EACH_OBSERVER(IOObserver, io_observers_, WillProcessIOEvent()); |
+} |
+ |
+void MessagePumpForIO::DidProcessIOEvent() { |
+ FOR_EACH_OBSERVER(IOObserver, io_observers_, DidProcessIOEvent()); |
+} |
+ |
} // namespace base |