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

Side by Side Diff: remoting/jingle_glue/jingle_info_request.cc

Issue 9452038: Implement timeouts for IQ requests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix release build Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « remoting/jingle_glue/jingle_info_request.h ('k') | remoting/protocol/jingle_messages.h » ('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/jingle_glue/jingle_info_request.h" 5 #include "remoting/jingle_glue/jingle_info_request.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 14 matching lines...) Expand all
25 25
26 void JingleInfoRequest::Send(const OnJingleInfoCallback& callback) { 26 void JingleInfoRequest::Send(const OnJingleInfoCallback& callback) {
27 on_jingle_info_cb_ = callback; 27 on_jingle_info_cb_ = callback;
28 scoped_ptr<buzz::XmlElement> iq_body( 28 scoped_ptr<buzz::XmlElement> iq_body(
29 new buzz::XmlElement(buzz::QN_JINGLE_INFO_QUERY, true)); 29 new buzz::XmlElement(buzz::QN_JINGLE_INFO_QUERY, true));
30 request_ = iq_sender_.SendIq( 30 request_ = iq_sender_.SendIq(
31 buzz::STR_GET, buzz::STR_EMPTY, iq_body.Pass(), 31 buzz::STR_GET, buzz::STR_EMPTY, iq_body.Pass(),
32 base::Bind(&JingleInfoRequest::OnResponse, base::Unretained(this))); 32 base::Bind(&JingleInfoRequest::OnResponse, base::Unretained(this)));
33 } 33 }
34 34
35 void JingleInfoRequest::OnResponse(const buzz::XmlElement* stanza) { 35 void JingleInfoRequest::OnResponse(IqRequest* request,
36 const buzz::XmlElement* stanza) {
36 const buzz::XmlElement* query = 37 const buzz::XmlElement* query =
37 stanza->FirstNamed(buzz::QN_JINGLE_INFO_QUERY); 38 stanza->FirstNamed(buzz::QN_JINGLE_INFO_QUERY);
38 if (query == NULL) { 39 if (query == NULL) {
39 LOG(WARNING) << "No Jingle info found in Jingle Info query response." 40 LOG(WARNING) << "No Jingle info found in Jingle Info query response."
40 << stanza->Str(); 41 << stanza->Str();
41 return; 42 return;
42 } 43 }
43 44
44 std::vector<talk_base::SocketAddress> stun_hosts; 45 std::vector<talk_base::SocketAddress> stun_hosts;
45 const buzz::XmlElement* stun = query->FirstNamed(buzz::QN_JINGLE_INFO_STUN); 46 const buzz::XmlElement* stun = query->FirstNamed(buzz::QN_JINGLE_INFO_STUN);
(...skipping 28 matching lines...) Expand all
74 std::string host = server->Attr(buzz::QN_JINGLE_INFO_HOST); 75 std::string host = server->Attr(buzz::QN_JINGLE_INFO_HOST);
75 if (host != buzz::STR_EMPTY) 76 if (host != buzz::STR_EMPTY)
76 relay_hosts.push_back(host); 77 relay_hosts.push_back(host);
77 } 78 }
78 } 79 }
79 80
80 on_jingle_info_cb_.Run(relay_token, relay_hosts, stun_hosts); 81 on_jingle_info_cb_.Run(relay_token, relay_hosts, stun_hosts);
81 } 82 }
82 83
83 } // namespace remoting 84 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/jingle_glue/jingle_info_request.h ('k') | remoting/protocol/jingle_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698