| 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 "ipc/ipc_listener.h" | 7 #include "ipc/ipc_listener.h" |
| 8 #include "ipc/ipc_message.h" | 8 #include "ipc/ipc_message.h" |
| 9 | 9 |
| 10 namespace IPC { | 10 namespace IPC { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 NOTIMPLEMENTED(); | 34 NOTIMPLEMENTED(); |
| 35 return base::ProcessId(); | 35 return base::ProcessId(); |
| 36 } | 36 } |
| 37 | 37 |
| 38 base::ProcessId TestSink::GetSelfPID() const { | 38 base::ProcessId TestSink::GetSelfPID() const { |
| 39 NOTIMPLEMENTED(); | 39 NOTIMPLEMENTED(); |
| 40 return base::ProcessId(); | 40 return base::ProcessId(); |
| 41 } | 41 } |
| 42 | 42 |
| 43 bool TestSink::OnMessageReceived(const Message& msg) { | 43 bool TestSink::OnMessageReceived(const Message& msg) { |
| 44 ObserverListBase<Listener>::Iterator it(filter_list_); | 44 ObserverListBase<Listener>::Iterator it(&filter_list_); |
| 45 Listener* observer; | 45 Listener* observer; |
| 46 while ((observer = it.GetNext()) != NULL) { | 46 while ((observer = it.GetNext()) != NULL) { |
| 47 if (observer->OnMessageReceived(msg)) | 47 if (observer->OnMessageReceived(msg)) |
| 48 return true; | 48 return true; |
| 49 } | 49 } |
| 50 | 50 |
| 51 // No filter handled the message, so store it. | 51 // No filter handled the message, so store it. |
| 52 messages_.push_back(Message(msg)); | 52 messages_.push_back(Message(msg)); |
| 53 return true; | 53 return true; |
| 54 } | 54 } |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 } | 101 } |
| 102 | 102 |
| 103 base::ScopedFD TestSink::TakeClientFileDescriptor() { | 103 base::ScopedFD TestSink::TakeClientFileDescriptor() { |
| 104 NOTREACHED(); | 104 NOTREACHED(); |
| 105 return base::ScopedFD(); | 105 return base::ScopedFD(); |
| 106 } | 106 } |
| 107 | 107 |
| 108 #endif // defined(OS_POSIX) && !defined(OS_NACL) | 108 #endif // defined(OS_POSIX) && !defined(OS_NACL) |
| 109 | 109 |
| 110 } // namespace IPC | 110 } // namespace IPC |
| OLD | NEW |