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 21 matching lines...) Expand all Loading... |
32 | 32 |
33 void TestSink::Close() { | 33 void TestSink::Close() { |
34 NOTIMPLEMENTED(); | 34 NOTIMPLEMENTED(); |
35 } | 35 } |
36 | 36 |
37 base::ProcessId TestSink::GetPeerPID() const { | 37 base::ProcessId TestSink::GetPeerPID() const { |
38 NOTIMPLEMENTED(); | 38 NOTIMPLEMENTED(); |
39 return base::ProcessId(); | 39 return base::ProcessId(); |
40 } | 40 } |
41 | 41 |
42 base::ProcessId TestSink::GetSelfPID() const { | |
43 NOTIMPLEMENTED(); | |
44 return base::ProcessId(); | |
45 } | |
46 | |
47 bool TestSink::OnMessageReceived(const Message& msg) { | 42 bool TestSink::OnMessageReceived(const Message& msg) { |
48 for (auto& observer : filter_list_) { | 43 for (auto& observer : filter_list_) { |
49 if (observer.OnMessageReceived(msg)) | 44 if (observer.OnMessageReceived(msg)) |
50 return true; | 45 return true; |
51 } | 46 } |
52 | 47 |
53 // No filter handled the message, so store it. | 48 // No filter handled the message, so store it. |
54 messages_.push_back(Message(msg)); | 49 messages_.push_back(Message(msg)); |
55 return true; | 50 return true; |
56 } | 51 } |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 } | 83 } |
89 | 84 |
90 void TestSink::AddFilter(Listener* filter) { | 85 void TestSink::AddFilter(Listener* filter) { |
91 filter_list_.AddObserver(filter); | 86 filter_list_.AddObserver(filter); |
92 } | 87 } |
93 | 88 |
94 void TestSink::RemoveFilter(Listener* filter) { | 89 void TestSink::RemoveFilter(Listener* filter) { |
95 filter_list_.RemoveObserver(filter); | 90 filter_list_.RemoveObserver(filter); |
96 } | 91 } |
97 | 92 |
98 #if defined(OS_POSIX) && !defined(OS_NACL) | |
99 | |
100 int TestSink::GetClientFileDescriptor() const { | |
101 NOTREACHED(); | |
102 return -1; | |
103 } | |
104 | |
105 base::ScopedFD TestSink::TakeClientFileDescriptor() { | |
106 NOTREACHED(); | |
107 return base::ScopedFD(); | |
108 } | |
109 | |
110 #endif // defined(OS_POSIX) && !defined(OS_NACL) | |
111 | |
112 } // namespace IPC | 93 } // namespace IPC |
OLD | NEW |