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

Side by Side Diff: base/message_loop_proxy_impl.cc

Issue 9233018: Convert use of int ms to TimeDelta in files owned by brettw. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase onto master. Created 8 years, 11 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 | base/timer.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 "base/message_loop_proxy_impl.h" 5 #include "base/message_loop_proxy_impl.h"
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/threading/thread_restrictions.h" 8 #include "base/threading/thread_restrictions.h"
9 9
10 namespace base { 10 namespace base {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 74
75 MessageLoopProxyImpl::MessageLoopProxyImpl() 75 MessageLoopProxyImpl::MessageLoopProxyImpl()
76 : target_message_loop_(MessageLoop::current()) { 76 : target_message_loop_(MessageLoop::current()) {
77 } 77 }
78 78
79 bool MessageLoopProxyImpl::PostTaskHelper( 79 bool MessageLoopProxyImpl::PostTaskHelper(
80 const tracked_objects::Location& from_here, const base::Closure& task, 80 const tracked_objects::Location& from_here, const base::Closure& task,
81 int64 delay_ms, bool nestable) { 81 int64 delay_ms, bool nestable) {
82 AutoLock lock(message_loop_lock_); 82 AutoLock lock(message_loop_lock_);
83 if (target_message_loop_) { 83 if (target_message_loop_) {
84 base::TimeDelta delay = base::TimeDelta::FromMilliseconds(delay_ms);
84 if (nestable) { 85 if (nestable) {
85 target_message_loop_->PostDelayedTask(from_here, task, delay_ms); 86 target_message_loop_->PostDelayedTask(from_here, task, delay);
86 } else { 87 } else {
87 target_message_loop_->PostNonNestableDelayedTask(from_here, task, 88 target_message_loop_->PostNonNestableDelayedTask(from_here, task, delay);
88 delay_ms);
89 } 89 }
90 return true; 90 return true;
91 } 91 }
92 return false; 92 return false;
93 } 93 }
94 94
95 scoped_refptr<MessageLoopProxy> 95 scoped_refptr<MessageLoopProxy>
96 MessageLoopProxy::current() { 96 MessageLoopProxy::current() {
97 MessageLoop* cur_loop = MessageLoop::current(); 97 MessageLoop* cur_loop = MessageLoop::current();
98 if (!cur_loop) 98 if (!cur_loop)
99 return NULL; 99 return NULL;
100 return cur_loop->message_loop_proxy(); 100 return cur_loop->message_loop_proxy();
101 } 101 }
102 102
103 } // namespace base 103 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/timer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698