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

Side by Side Diff: ipc/ipc_channel_proxy_unittest.cc

Issue 245443005: Move IPC::MessageFilter and router to a separate file (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix gn build Created 6 years, 8 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_channel_proxy.cc ('k') | ipc/ipc_forwarding_message_filter.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/pickle.h" 8 #include "base/pickle.h"
9 #include "base/threading/thread.h" 9 #include "base/threading/thread.h"
10 #include "ipc/ipc_message.h" 10 #include "ipc/ipc_message.h"
11 #include "ipc/ipc_message_macros.h" 11 #include "ipc/ipc_message_macros.h"
12 #include "ipc/ipc_test_base.h" 12 #include "ipc/ipc_test_base.h"
13 #include "ipc/message_filter.h"
13 14
14 namespace { 15 namespace {
15 16
16 #if defined(IPC_MESSAGE_START) 17 #if defined(IPC_MESSAGE_START)
17 #undef IPC_MESSAGE_START 18 #undef IPC_MESSAGE_START
18 #endif 19 #endif
19 20
20 enum Command { 21 enum Command {
21 SEND, 22 SEND,
22 QUIT 23 QUIT
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 } 75 }
75 76
76 channel_->Send(new IPC::Message(message)); 77 channel_->Send(new IPC::Message(message));
77 return true; 78 return true;
78 } 79 }
79 80
80 private: 81 private:
81 IPC::Channel* channel_; 82 IPC::Channel* channel_;
82 }; 83 };
83 84
84 class MessageCountFilter : public IPC::ChannelProxy::MessageFilter { 85 class MessageCountFilter : public IPC::MessageFilter {
85 public: 86 public:
86 enum FilterEvent { 87 enum FilterEvent {
87 NONE, 88 NONE,
88 FILTER_ADDED, 89 FILTER_ADDED,
89 CHANNEL_CONNECTED, 90 CHANNEL_CONNECTED,
90 CHANNEL_ERROR, 91 CHANNEL_ERROR,
91 CHANNEL_CLOSING, 92 CHANNEL_CLOSING,
92 FILTER_REMOVED 93 FILTER_REMOVED
93 }; 94 };
94 MessageCountFilter() 95 MessageCountFilter()
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 IPC::Channel::MODE_CLIENT, 306 IPC::Channel::MODE_CLIENT,
306 &listener); 307 &listener);
307 CHECK(channel.Connect()); 308 CHECK(channel.Connect());
308 listener.Init(&channel); 309 listener.Init(&channel);
309 310
310 base::MessageLoop::current()->Run(); 311 base::MessageLoop::current()->Run();
311 return 0; 312 return 0;
312 } 313 }
313 314
314 } // namespace 315 } // namespace
OLDNEW
« no previous file with comments | « ipc/ipc_channel_proxy.cc ('k') | ipc/ipc_forwarding_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698