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

Side by Side Diff: ipc/ipc_test_sink.cc

Issue 2412483008: Remove usage of base::ObserverList<T>::Iter::GetNext() in //ipc. (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | no next file » | 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 #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 27 matching lines...) Expand all
38 NOTIMPLEMENTED(); 38 NOTIMPLEMENTED();
39 return base::ProcessId(); 39 return base::ProcessId();
40 } 40 }
41 41
42 base::ProcessId TestSink::GetSelfPID() const { 42 base::ProcessId TestSink::GetSelfPID() const {
43 NOTIMPLEMENTED(); 43 NOTIMPLEMENTED();
44 return base::ProcessId(); 44 return base::ProcessId();
45 } 45 }
46 46
47 bool TestSink::OnMessageReceived(const Message& msg) { 47 bool TestSink::OnMessageReceived(const Message& msg) {
48 base::ObserverListBase<Listener>::Iterator it(&filter_list_); 48 for (auto& observer : filter_list_) {
49 Listener* observer; 49 if (observer.OnMessageReceived(msg))
50 while ((observer = it.GetNext()) != NULL) {
51 if (observer->OnMessageReceived(msg))
52 return true; 50 return true;
53 } 51 }
54 52
55 // No filter handled the message, so store it. 53 // No filter handled the message, so store it.
56 messages_.push_back(Message(msg)); 54 messages_.push_back(Message(msg));
57 return true; 55 return true;
58 } 56 }
59 57
60 void TestSink::ClearMessages() { 58 void TestSink::ClearMessages() {
61 messages_.clear(); 59 messages_.clear();
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 } 103 }
106 104
107 base::ScopedFD TestSink::TakeClientFileDescriptor() { 105 base::ScopedFD TestSink::TakeClientFileDescriptor() {
108 NOTREACHED(); 106 NOTREACHED();
109 return base::ScopedFD(); 107 return base::ScopedFD();
110 } 108 }
111 109
112 #endif // defined(OS_POSIX) && !defined(OS_NACL) 110 #endif // defined(OS_POSIX) && !defined(OS_NACL)
113 111
114 } // namespace IPC 112 } // namespace IPC
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698