| 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/xmpp_signal_strategy.h" | 5 #include "remoting/signaling/xmpp_signal_strategy.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 if (!xmpp_client_) { | 186 if (!xmpp_client_) { |
| 187 // If the connection has been terminated then it doesn't matter | 187 // If the connection has been terminated then it doesn't matter |
| 188 // what Id we return. | 188 // what Id we return. |
| 189 return std::string(); | 189 return std::string(); |
| 190 } | 190 } |
| 191 return xmpp_client_->NextId(); | 191 return xmpp_client_->NextId(); |
| 192 } | 192 } |
| 193 | 193 |
| 194 bool XmppSignalStrategy::HandleStanza(const buzz::XmlElement* stanza) { | 194 bool XmppSignalStrategy::HandleStanza(const buzz::XmlElement* stanza) { |
| 195 DCHECK(CalledOnValidThread()); | 195 DCHECK(CalledOnValidThread()); |
| 196 ObserverListBase<Listener>::Iterator it(listeners_); | 196 ObserverListBase<Listener>::Iterator it(&listeners_); |
| 197 Listener* listener; | 197 Listener* listener; |
| 198 while ((listener = it.GetNext()) != nullptr) { | 198 while ((listener = it.GetNext()) != nullptr) { |
| 199 if (listener->OnSignalStrategyIncomingStanza(stanza)) | 199 if (listener->OnSignalStrategyIncomingStanza(stanza)) |
| 200 return true; | 200 return true; |
| 201 } | 201 } |
| 202 return false; | 202 return false; |
| 203 } | 203 } |
| 204 | 204 |
| 205 void XmppSignalStrategy::SetAuthInfo(const std::string& username, | 205 void XmppSignalStrategy::SetAuthInfo(const std::string& username, |
| 206 const std::string& auth_token) { | 206 const std::string& auth_token) { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 | 265 |
| 266 // static | 266 // static |
| 267 buzz::PreXmppAuth* XmppSignalStrategy::CreatePreXmppAuth( | 267 buzz::PreXmppAuth* XmppSignalStrategy::CreatePreXmppAuth( |
| 268 const buzz::XmppClientSettings& settings) { | 268 const buzz::XmppClientSettings& settings) { |
| 269 buzz::Jid jid(settings.user(), settings.host(), buzz::STR_EMPTY); | 269 buzz::Jid jid(settings.user(), settings.host(), buzz::STR_EMPTY); |
| 270 return new notifier::GaiaTokenPreXmppAuth( | 270 return new notifier::GaiaTokenPreXmppAuth( |
| 271 jid.Str(), settings.auth_token(), settings.token_service(), "X-OAUTH2"); | 271 jid.Str(), settings.auth_token(), settings.token_service(), "X-OAUTH2"); |
| 272 } | 272 } |
| 273 | 273 |
| 274 } // namespace remoting | 274 } // namespace remoting |
| OLD | NEW |