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

Side by Side Diff: jingle/glue/thread_wrapper.cc

Issue 9159068: Convert int ms interfaces to TimeDelta in jingle/glue files. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
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
« no previous file with comments | « no previous file | no next file » | 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 "jingle/glue/thread_wrapper.h" 5 #include "jingle/glue/thread_wrapper.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/threading/thread_local.h" 10 #include "base/threading/thread_local.h"
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 } 209 }
210 210
211 if (delay_ms <= 0) { 211 if (delay_ms <= 0) {
212 message_loop_->PostTask(FROM_HERE, 212 message_loop_->PostTask(FROM_HERE,
213 base::Bind(&JingleThreadWrapper::RunTask, 213 base::Bind(&JingleThreadWrapper::RunTask,
214 base::Unretained(this), task_id)); 214 base::Unretained(this), task_id));
215 } else { 215 } else {
216 message_loop_->PostDelayedTask(FROM_HERE, 216 message_loop_->PostDelayedTask(FROM_HERE,
217 base::Bind(&JingleThreadWrapper::RunTask, 217 base::Bind(&JingleThreadWrapper::RunTask,
218 base::Unretained(this), task_id), 218 base::Unretained(this), task_id),
219 delay_ms); 219 base::TimeDelta::FromMilliseconds(delay_ms));
220 } 220 }
221 } 221 }
222 222
223 void JingleThreadWrapper::RunTask(int task_id) { 223 void JingleThreadWrapper::RunTask(int task_id) {
224 bool have_message = false; 224 bool have_message = false;
225 talk_base::Message message; 225 talk_base::Message message;
226 { 226 {
227 base::AutoLock auto_lock(lock_); 227 base::AutoLock auto_lock(lock_);
228 MessagesQueue::iterator it = messages_.find(task_id); 228 MessagesQueue::iterator it = messages_.find(task_id);
229 if (it != messages_.end()) { 229 if (it != messages_.end()) {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 288
289 void JingleThreadWrapper::Stop() { 289 void JingleThreadWrapper::Stop() {
290 NOTREACHED(); 290 NOTREACHED();
291 } 291 }
292 292
293 void JingleThreadWrapper::Run() { 293 void JingleThreadWrapper::Run() {
294 NOTREACHED(); 294 NOTREACHED();
295 } 295 }
296 296
297 } // namespace jingle_glue 297 } // namespace jingle_glue
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698