| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/host/register_support_host_request.h" | 5 #include "remoting/host/register_support_host_request.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 QName(kChromotingXmlNamespace, "support-id")); | 146 QName(kChromotingXmlNamespace, "support-id")); |
| 147 support_id->AddText(kSupportId); | 147 support_id->AddText(kSupportId); |
| 148 result->AddElement(support_id); | 148 result->AddElement(support_id); |
| 149 | 149 |
| 150 XmlElement* support_id_lifetime = new XmlElement( | 150 XmlElement* support_id_lifetime = new XmlElement( |
| 151 QName(kChromotingXmlNamespace, "support-id-lifetime")); | 151 QName(kChromotingXmlNamespace, "support-id-lifetime")); |
| 152 support_id_lifetime->AddText(kSupportIdLifetime); | 152 support_id_lifetime->AddText(kSupportIdLifetime); |
| 153 result->AddElement(support_id_lifetime); | 153 result->AddElement(support_id_lifetime); |
| 154 | 154 |
| 155 int consumed = 0; | 155 int consumed = 0; |
| 156 base::ObserverListBase<SignalStrategy::Listener>::Iterator it( | 156 for (auto& listener : signal_strategy_listeners_) { |
| 157 &signal_strategy_listeners_); | 157 if (listener.OnSignalStrategyIncomingStanza(response.get())) |
| 158 SignalStrategy::Listener* listener; | |
| 159 while ((listener = it.GetNext()) != nullptr) { | |
| 160 if (listener->OnSignalStrategyIncomingStanza(response.get())) | |
| 161 consumed++; | 158 consumed++; |
| 162 } | 159 } |
| 163 EXPECT_EQ(1, consumed); | 160 EXPECT_EQ(1, consumed); |
| 164 | 161 |
| 165 base::RunLoop().RunUntilIdle(); | 162 base::RunLoop().RunUntilIdle(); |
| 166 } | 163 } |
| 167 | 164 |
| 168 } // namespace remoting | 165 } // namespace remoting |
| OLD | NEW |