| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |