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

Unified Diff: ipc/ipc_test_sink.cc

Issue 6387007: Add support for attaching filters to an IPC TestSink. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add some more comments Created 9 years, 11 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
« ipc/ipc_test_sink.h ('K') | « ipc/ipc_test_sink.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_test_sink.cc
diff --git a/ipc/ipc_test_sink.cc b/ipc/ipc_test_sink.cc
index 95900b6ca5074a164b45491431ffc7e86e5e9b66..bf25d30029072854db9e9a0177d8b54461082a28 100644
--- a/ipc/ipc_test_sink.cc
+++ b/ipc/ipc_test_sink.cc
@@ -22,6 +22,7 @@ bool TestSink::Send(Message* message) {
bool TestSink::OnMessageReceived(const Message& msg) {
messages_.push_back(Message(msg));
+ FOR_EACH_OBSERVER(Observer, observer_list_, OnMessageReceived(msg));
return true;
}
@@ -57,4 +58,12 @@ const Message* TestSink::GetUniqueMessageMatching(uint32 id) const {
return &messages_[found_index];
}
+void TestSink::AddObserver(Observer* obs) {
+ observer_list_.AddObserver(obs);
+}
+
+void TestSink::RemoveObserver(Observer* obs) {
+ observer_list_.RemoveObserver(obs);
noelutz 2011/01/28 02:13:06 Maybe check in the destructor that all observers h
Brian Ryner 2011/01/28 02:19:59 I'm not sure how common this is for observer inter
+}
+
} // namespace IPC
« ipc/ipc_test_sink.h ('K') | « ipc/ipc_test_sink.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698