OLD | NEW |
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 #include "ipc/ipc_test_sink.h" | 5 #include "ipc/ipc_test_sink.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 bool TestSink::Connect() { | 28 bool TestSink::Connect() { |
29 NOTIMPLEMENTED(); | 29 NOTIMPLEMENTED(); |
30 return false; | 30 return false; |
31 } | 31 } |
32 | 32 |
33 void TestSink::Close() { | 33 void TestSink::Close() { |
34 NOTIMPLEMENTED(); | 34 NOTIMPLEMENTED(); |
35 } | 35 } |
36 | 36 |
37 base::ProcessId TestSink::GetPeerPID() const { | |
38 NOTIMPLEMENTED(); | |
39 return base::ProcessId(); | |
40 } | |
41 | |
42 bool TestSink::OnMessageReceived(const Message& msg) { | 37 bool TestSink::OnMessageReceived(const Message& msg) { |
43 for (auto& observer : filter_list_) { | 38 for (auto& observer : filter_list_) { |
44 if (observer.OnMessageReceived(msg)) | 39 if (observer.OnMessageReceived(msg)) |
45 return true; | 40 return true; |
46 } | 41 } |
47 | 42 |
48 // No filter handled the message, so store it. | 43 // No filter handled the message, so store it. |
49 messages_.push_back(Message(msg)); | 44 messages_.push_back(Message(msg)); |
50 return true; | 45 return true; |
51 } | 46 } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 79 |
85 void TestSink::AddFilter(Listener* filter) { | 80 void TestSink::AddFilter(Listener* filter) { |
86 filter_list_.AddObserver(filter); | 81 filter_list_.AddObserver(filter); |
87 } | 82 } |
88 | 83 |
89 void TestSink::RemoveFilter(Listener* filter) { | 84 void TestSink::RemoveFilter(Listener* filter) { |
90 filter_list_.RemoveObserver(filter); | 85 filter_list_.RemoveObserver(filter); |
91 } | 86 } |
92 | 87 |
93 } // namespace IPC | 88 } // namespace IPC |
OLD | NEW |