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

Side by Side Diff: ipc/ipc_test_sink.h

Issue 1389163008: Don't use base::MessageLoop::{Quit,QuitClosure} in extensions/, ipc/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « ipc/ipc_test_channel_listener.cc ('k') | ipc/mojo/ipc_channel_mojo_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef IPC_IPC_TEST_SINK_H_ 5 #ifndef IPC_IPC_TEST_SINK_H_
6 #define IPC_IPC_TEST_SINK_H_ 6 #define IPC_IPC_TEST_SINK_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 // EXPECT_TRUE(ViewHostMsg_Foo::ReadReplyParam(msg, &reply_data)); 52 // EXPECT_TRUE(ViewHostMsg_Foo::ReadReplyParam(msg, &reply_data));
53 // 53 //
54 // You can also register to be notified when messages are posted to the sink. 54 // You can also register to be notified when messages are posted to the sink.
55 // This can be useful if you need to wait for a particular message that will 55 // This can be useful if you need to wait for a particular message that will
56 // be posted asynchronously. Example usage: 56 // be posted asynchronously. Example usage:
57 // 57 //
58 // class MyListener : public IPC::Listener { 58 // class MyListener : public IPC::Listener {
59 // public: 59 // public:
60 // virtual bool OnMessageReceived(const IPC::Message& msg) { 60 // virtual bool OnMessageReceived(const IPC::Message& msg) {
61 // <do something with the message> 61 // <do something with the message>
62 // MessageLoop::current()->Quit(); 62 // MessageLoop::current()->QuitWhenIdle();
63 // return false; // to store the message in the sink, or true to drop it 63 // return false; // to store the message in the sink, or true to drop it
64 // } 64 // }
65 // }; 65 // };
66 // 66 //
67 // MyListener listener; 67 // MyListener listener;
68 // test_sink.AddFilter(&listener); 68 // test_sink.AddFilter(&listener);
69 // StartSomeAsynchronousProcess(&test_sink); 69 // StartSomeAsynchronousProcess(&test_sink);
70 // MessageLoop::current()->Run(); 70 // MessageLoop::current()->Run();
71 // <inspect the results> 71 // <inspect the results>
72 // ... 72 // ...
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 // The actual list of received messages. 132 // The actual list of received messages.
133 std::vector<Message> messages_; 133 std::vector<Message> messages_;
134 base::ObserverList<Listener> filter_list_; 134 base::ObserverList<Listener> filter_list_;
135 135
136 DISALLOW_COPY_AND_ASSIGN(TestSink); 136 DISALLOW_COPY_AND_ASSIGN(TestSink);
137 }; 137 };
138 138
139 } // namespace IPC 139 } // namespace IPC
140 140
141 #endif // IPC_IPC_TEST_SINK_H_ 141 #endif // IPC_IPC_TEST_SINK_H_
OLDNEW
« no previous file with comments | « ipc/ipc_test_channel_listener.cc ('k') | ipc/mojo/ipc_channel_mojo_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698