summaryrefslogtreecommitdiffstats
path: root/base/message_pump_win.cc
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-09 21:20:41 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-09 21:20:41 +0000
commit9cfb89a8002a2fc6b0ea3fd4eccb33b6f4dd464a (patch)
treed30b49f072edfbdb4c812a0b34dc825c936dccbf /base/message_pump_win.cc
parent5d028b7b577d2efb96cd958ba4a7f1e5800fd9bb (diff)
downloadchromium_src-9cfb89a8002a2fc6b0ea3fd4eccb33b6f4dd464a.zip
chromium_src-9cfb89a8002a2fc6b0ea3fd4eccb33b6f4dd464a.tar.gz
chromium_src-9cfb89a8002a2fc6b0ea3fd4eccb33b6f4dd464a.tar.bz2
Reland r49188.
It was reverted due to breaking a valgrind test which has since been disabled. Review URL: http://codereview.chromium.org/2763004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49320 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/message_pump_win.cc')
-rw-r--r--base/message_pump_win.cc20
1 files changed, 19 insertions, 1 deletions
diff --git a/base/message_pump_win.cc b/base/message_pump_win.cc
index 1bb6cfa..6fa3e7d 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