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

Unified Diff: ipc/ipc_tests.cc

Issue 5978003: Make IPC::Channel::Listener:OnMessageReceived have a return value indicating ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years 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
« no previous file with comments | « ipc/ipc_sync_message_unittest.cc ('k') | ipc/sync_socket_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_tests.cc
===================================================================
--- ipc/ipc_tests.cc (revision 70108)
+++ ipc/ipc_tests.cc (working copy)
@@ -182,7 +182,7 @@
class MyChannelListener : public IPC::Channel::Listener {
public:
- virtual void OnMessageReceived(const IPC::Message& message) {
+ virtual bool OnMessageReceived(const IPC::Message& message) {
IPC::MessageIterator iter(message);
iter.NextInt();
@@ -196,6 +196,7 @@
} else {
Send(sender_, "Foo");
}
+ return true;
}
virtual void OnChannelError() {
@@ -291,7 +292,7 @@
SendNextMessage();
}
- virtual void OnMessageReceived(const IPC::Message& message) {
+ virtual bool OnMessageReceived(const IPC::Message& message) {
IPC::MessageIterator iter(message);
iter.NextInt();
@@ -299,6 +300,7 @@
const std::string big_string = iter.NextString();
EXPECT_EQ(kLongMessageStringNumBytes - 1, big_string.length());
SendNextMessage();
+ return true;
}
virtual void OnChannelError() {
@@ -402,7 +404,7 @@
std::cout << "Client Latency: " << latency_messages_ << std::endl;
}
- virtual void OnMessageReceived(const IPC::Message& message) {
+ virtual bool OnMessageReceived(const IPC::Message& message) {
count_messages_++;
IPC::MessageIterator iter(message);
int time = iter.NextInt();
@@ -421,6 +423,7 @@
msg->WriteInt(msgid);
msg->WriteString(payload);
channel_->Send(msg);
+ return true;
}
private:
IPC::Channel *channel_;
@@ -446,7 +449,7 @@
std::cout << "Server Latency: " << latency_messages_ << std::endl;
}
- virtual void OnMessageReceived(const IPC::Message& message) {
+ virtual bool OnMessageReceived(const IPC::Message& message) {
count_messages_++;
// decode the string so this gets counted in the total time
IPC::MessageIterator iter(message);
@@ -467,7 +470,7 @@
msg->WriteString("quit");
channel_->Send(msg);
SetTimer(NULL, 1, 250, (TIMERPROC) PostQuitMessage);
- return;
+ return true;
}
IPC::Message* msg = new IPC::Message(0,
@@ -477,6 +480,7 @@
msg->WriteInt(count_down_);
msg->WriteString(payload_);
channel_->Send(msg);
+ return true;
}
private:
« no previous file with comments | « ipc/ipc_sync_message_unittest.cc ('k') | ipc/sync_socket_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698