| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/jingle_glue/iq_sender.h" | 5 #include "remoting/jingle_glue/iq_sender.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
| 9 #include "remoting/jingle_glue/signal_strategy.h" | 9 #include "remoting/jingle_glue/signal_strategy.h" |
| 10 #include "third_party/libjingle/source/talk/xmllite/xmlelement.h" | 10 #include "third_party/libjingle/source/talk/xmllite/xmlelement.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 while (it != requests_.end()) { | 59 while (it != requests_.end()) { |
| 60 IqRequestMap::iterator cur = it; | 60 IqRequestMap::iterator cur = it; |
| 61 ++it; | 61 ++it; |
| 62 if (cur->second == request) { | 62 if (cur->second == request) { |
| 63 requests_.erase(cur); | 63 requests_.erase(cur); |
| 64 break; | 64 break; |
| 65 } | 65 } |
| 66 } | 66 } |
| 67 } | 67 } |
| 68 | 68 |
| 69 bool IqSender::OnIncomingStanza(const buzz::XmlElement* stanza) { | 69 void IqSender::OnSignalStrategyStateChange(SignalStrategy::State state) { |
| 70 } |
| 71 |
| 72 bool IqSender::OnSignalStrategyIncomingStanza(const buzz::XmlElement* stanza) { |
| 70 if (stanza->Name() != buzz::QN_IQ) { | 73 if (stanza->Name() != buzz::QN_IQ) { |
| 71 LOG(WARNING) << "Received unexpected non-IQ packet " << stanza->Str(); | 74 LOG(WARNING) << "Received unexpected non-IQ packet " << stanza->Str(); |
| 72 return false; | 75 return false; |
| 73 } | 76 } |
| 74 | 77 |
| 75 const std::string& type = stanza->Attr(buzz::QN_TYPE); | 78 const std::string& type = stanza->Attr(buzz::QN_TYPE); |
| 76 if (type.empty()) { | 79 if (type.empty()) { |
| 77 LOG(WARNING) << "IQ packet missing type " << stanza->Str(); | 80 LOG(WARNING) << "IQ packet missing type " << stanza->Str(); |
| 78 return false; | 81 return false; |
| 79 } | 82 } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 110 } | 113 } |
| 111 | 114 |
| 112 void IqRequest::OnResponse(const buzz::XmlElement* stanza) { | 115 void IqRequest::OnResponse(const buzz::XmlElement* stanza) { |
| 113 DCHECK(!callback_.is_null()); | 116 DCHECK(!callback_.is_null()); |
| 114 IqSender::ReplyCallback callback(callback_); | 117 IqSender::ReplyCallback callback(callback_); |
| 115 callback_.Reset(); | 118 callback_.Reset(); |
| 116 callback.Run(stanza); | 119 callback.Run(stanza); |
| 117 } | 120 } |
| 118 | 121 |
| 119 } // namespace remoting | 122 } // namespace remoting |
| OLD | NEW |