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

Side by Side Diff: ipc/ipc_test_sink.h

Issue 7064033: Virtual destructors should have virtual keyword. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 7 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 | « ipc/ipc_sync_channel.h ('k') | jingle/notifier/base/xmpp_connection.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) 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 #pragma once 7 #pragma once
8 8
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 // StartSomeAsynchronousProcess(&test_sink); 67 // StartSomeAsynchronousProcess(&test_sink);
68 // MessageLoop::current()->Run(); 68 // MessageLoop::current()->Run();
69 // <inspect the results> 69 // <inspect the results>
70 // ... 70 // ...
71 // 71 //
72 // To hook up the sink, all you need to do is call OnMessageReceived when a 72 // To hook up the sink, all you need to do is call OnMessageReceived when a
73 // message is received. 73 // message is received.
74 class TestSink : public Channel { 74 class TestSink : public Channel {
75 public: 75 public:
76 TestSink(); 76 TestSink();
77 ~TestSink(); 77 virtual ~TestSink();
78 78
79 // Interface in IPC::Channel. This copies the message to the sink and then 79 // Interface in IPC::Channel. This copies the message to the sink and then
80 // deletes it. 80 // deletes it.
81 virtual bool Send(IPC::Message* message); 81 virtual bool Send(IPC::Message* message);
82 82
83 // Used by the source of the messages to send the message to the sink. This 83 // Used by the source of the messages to send the message to the sink. This
84 // will make a copy of the message and store it in the list. 84 // will make a copy of the message and store it in the list.
85 bool OnMessageReceived(const Message& msg); 85 bool OnMessageReceived(const Message& msg);
86 86
87 // Returns the number of messages in the queue. 87 // Returns the number of messages in the queue.
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 // The actual list of received messages. 121 // The actual list of received messages.
122 std::vector<Message> messages_; 122 std::vector<Message> messages_;
123 ObserverList<Channel::Listener> filter_list_; 123 ObserverList<Channel::Listener> filter_list_;
124 124
125 DISALLOW_COPY_AND_ASSIGN(TestSink); 125 DISALLOW_COPY_AND_ASSIGN(TestSink);
126 }; 126 };
127 127
128 } // namespace IPC 128 } // namespace IPC
129 129
130 #endif // IPC_IPC_TEST_SINK_H_ 130 #endif // IPC_IPC_TEST_SINK_H_
OLDNEW
« no previous file with comments | « ipc/ipc_sync_channel.h ('k') | jingle/notifier/base/xmpp_connection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698