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

Side by Side Diff: remoting/signaling/fake_signal_strategy.cc

Issue 2415753002: Remove usage of base::ObserverList<T>::Iter::GetNext() in //remoting. (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
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 "remoting/signaling/fake_signal_strategy.h" 5 #include "remoting/signaling/fake_signal_strategy.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 received_messages_.push_back(stanza.release()); 139 received_messages_.push_back(stanza.release());
140 140
141 const std::string& to_field = stanza_ptr->Attr(buzz::QN_TO); 141 const std::string& to_field = stanza_ptr->Attr(buzz::QN_TO);
142 if (to_field != jid_) { 142 if (to_field != jid_) {
143 LOG(WARNING) << "Dropping stanza that is addressed to " << to_field 143 LOG(WARNING) << "Dropping stanza that is addressed to " << to_field
144 << ". Local jid: " << jid_ 144 << ". Local jid: " << jid_
145 << ". Message content: " << stanza_ptr->Str(); 145 << ". Message content: " << stanza_ptr->Str();
146 return; 146 return;
147 } 147 }
148 148
149 base::ObserverListBase<Listener>::Iterator it(&listeners_); 149 for (auto& listener : listeners_) {
150 Listener* listener; 150 if (listener.OnSignalStrategyIncomingStanza(stanza_ptr))
151 while ((listener = it.GetNext()) != nullptr) {
152 if (listener->OnSignalStrategyIncomingStanza(stanza_ptr))
153 break; 151 break;
154 } 152 }
155 } 153 }
156 154
157 void FakeSignalStrategy::SetPeerCallback(const PeerCallback& peer_callback) { 155 void FakeSignalStrategy::SetPeerCallback(const PeerCallback& peer_callback) {
158 peer_callback_ = peer_callback; 156 peer_callback_ = peer_callback;
159 } 157 }
160 158
161 } // namespace remoting 159 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/signaling/delegating_signal_strategy.cc ('k') | remoting/signaling/xmpp_signal_strategy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698