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

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

Issue 9572038: Convert uses of int ms to TimeDelta in jingle and remoting. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix nits. 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
« no previous file with comments | « remoting/host/policy_hack/nat_policy.cc ('k') | remoting/jingle_glue/jingle_thread_unittest.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/jingle_glue/iq_sender.h" 5 #include "remoting/jingle_glue/iq_sender.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/message_loop_proxy.h" 10 #include "base/message_loop_proxy.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 addressee_(addressee) { 139 addressee_(addressee) {
140 } 140 }
141 141
142 IqRequest::~IqRequest() { 142 IqRequest::~IqRequest() {
143 sender_->RemoveRequest(this); 143 sender_->RemoveRequest(this);
144 } 144 }
145 145
146 void IqRequest::SetTimeout(base::TimeDelta timeout) { 146 void IqRequest::SetTimeout(base::TimeDelta timeout) {
147 base::MessageLoopProxy::current()->PostDelayedTask( 147 base::MessageLoopProxy::current()->PostDelayedTask(
148 FROM_HERE, base::Bind(&IqRequest::OnTimeout, AsWeakPtr()), 148 FROM_HERE, base::Bind(&IqRequest::OnTimeout, AsWeakPtr()),
149 timeout.InMilliseconds()); 149 timeout);
150 } 150 }
151 151
152 void IqRequest::CallCallback(const buzz::XmlElement* stanza) { 152 void IqRequest::CallCallback(const buzz::XmlElement* stanza) {
153 if (!callback_.is_null()) { 153 if (!callback_.is_null()) {
154 IqSender::ReplyCallback callback(callback_); 154 IqSender::ReplyCallback callback(callback_);
155 callback_.Reset(); 155 callback_.Reset();
156 callback.Run(this, stanza); 156 callback.Run(this, stanza);
157 } 157 }
158 } 158 }
159 159
160 void IqRequest::OnTimeout() { 160 void IqRequest::OnTimeout() {
161 CallCallback(NULL); 161 CallCallback(NULL);
162 } 162 }
163 163
164 void IqRequest::OnResponse(const buzz::XmlElement* stanza) { 164 void IqRequest::OnResponse(const buzz::XmlElement* stanza) {
165 CallCallback(stanza); 165 CallCallback(stanza);
166 } 166 }
167 167
168 } // namespace remoting 168 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/policy_hack/nat_policy.cc ('k') | remoting/jingle_glue/jingle_thread_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698