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

Side by Side Diff: remoting/host/register_support_host_request_unittest.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
« no previous file with comments | « no previous file | remoting/signaling/delegating_signal_strategy.cc » ('j') | 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) 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
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
OLDNEW
« no previous file with comments | « no previous file | remoting/signaling/delegating_signal_strategy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698