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

Side by Side Diff: remoting/host/register_support_host_request.cc

Issue 9447087: Revert 123635 - Implement timeouts for IQ requests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 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
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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 << "> is malformed in the host registration response: " 154 << "> is malformed in the host registration response: "
155 << response->Str(); 155 << response->Str();
156 return false; 156 return false;
157 } 157 }
158 158
159 *support_id = support_id_element->BodyText(); 159 *support_id = support_id_element->BodyText();
160 *lifetime = base::TimeDelta::FromSeconds(lifetime_int); 160 *lifetime = base::TimeDelta::FromSeconds(lifetime_int);
161 return true; 161 return true;
162 } 162 }
163 163
164 void RegisterSupportHostRequest::ProcessResponse(IqRequest* request, 164 void RegisterSupportHostRequest::ProcessResponse(const XmlElement* response) {
165 const XmlElement* response) {
166 std::string support_id; 165 std::string support_id;
167 base::TimeDelta lifetime; 166 base::TimeDelta lifetime;
168 bool success = ParseResponse(response, &support_id, &lifetime); 167 bool success = ParseResponse(response, &support_id, &lifetime);
169 CallCallback(success, support_id, lifetime); 168 CallCallback(success, support_id, lifetime);
170 } 169 }
171 170
172 void RegisterSupportHostRequest::CallCallback( 171 void RegisterSupportHostRequest::CallCallback(
173 bool success, const std::string& support_id, base::TimeDelta lifetime) { 172 bool success, const std::string& support_id, base::TimeDelta lifetime) {
174 // Cleanup state before calling the callback. 173 // Cleanup state before calling the callback.
175 request_.reset(); 174 request_.reset();
176 iq_sender_.reset(); 175 iq_sender_.reset();
177 signal_strategy_->RemoveListener(this); 176 signal_strategy_->RemoveListener(this);
178 signal_strategy_ = NULL; 177 signal_strategy_ = NULL;
179 178
180 RegisterCallback callback = callback_; 179 RegisterCallback callback = callback_;
181 callback_.Reset(); 180 callback_.Reset();
182 callback.Run(success, support_id, lifetime); 181 callback.Run(success, support_id, lifetime);
183 } 182 }
184 183
185 } // namespace remoting 184 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/register_support_host_request.h ('k') | remoting/host/register_support_host_request_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698