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

Side by Side Diff: chrome/common/ipc_test_sink.cc

Issue 6094002: Revert 70141 - Make a few more places use bool for OnMessageReceived.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 12 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 | Annotate | Revision Log
« no previous file with comments | « chrome/common/ipc_test_sink.h ('k') | chrome/test/automation/tab_proxy.h » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include "chrome/common/ipc_test_sink.h" 5 #include "chrome/common/ipc_test_sink.h"
6 #include "ipc/ipc_message.h" 6 #include "ipc/ipc_message.h"
7 7
8 namespace IPC { 8 namespace IPC {
9 9
10 TestSink::TestSink() { 10 TestSink::TestSink() {
11 } 11 }
12 12
13 TestSink::~TestSink() { 13 TestSink::~TestSink() {
14 } 14 }
15 15
16 bool TestSink::Send(IPC::Message* message) { 16 bool TestSink::Send(IPC::Message* message) {
17 OnMessageReceived(*message); 17 OnMessageReceived(*message);
18 delete message; 18 delete message;
19 return true; 19 return true;
20 } 20 }
21 21
22 bool TestSink::OnMessageReceived(const Message& msg) { 22 void TestSink::OnMessageReceived(const Message& msg) {
23 messages_.push_back(Message(msg)); 23 messages_.push_back(Message(msg));
24 return true;
25 } 24 }
26 25
27 void TestSink::ClearMessages() { 26 void TestSink::ClearMessages() {
28 messages_.clear(); 27 messages_.clear();
29 } 28 }
30 29
31 const Message* TestSink::GetMessageAt(size_t index) const { 30 const Message* TestSink::GetMessageAt(size_t index) const {
32 if (index >= messages_.size()) 31 if (index >= messages_.size())
33 return NULL; 32 return NULL;
34 return &messages_[index]; 33 return &messages_[index];
(...skipping 15 matching lines...) Expand all
50 found_count++; 49 found_count++;
51 found_index = i; 50 found_index = i;
52 } 51 }
53 } 52 }
54 if (found_count != 1) 53 if (found_count != 1)
55 return NULL; // Didn't find a unique one. 54 return NULL; // Didn't find a unique one.
56 return &messages_[found_index]; 55 return &messages_[found_index];
57 } 56 }
58 57
59 } // namespace IPC 58 } // namespace IPC
OLDNEW
« no previous file with comments | « chrome/common/ipc_test_sink.h ('k') | chrome/test/automation/tab_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698