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

Side by Side Diff: content/browser/browser_thread_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
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 "content/browser/browser_thread_impl.h" 5 #include "content/browser/browser_thread_impl.h"
6 6
7 #include "base/atomicops.h" 7 #include "base/atomicops.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 GetCurrentThreadIdentifier(&current_thread) && 154 GetCurrentThreadIdentifier(&current_thread) &&
155 current_thread <= identifier; 155 current_thread <= identifier;
156 156
157 BrowserThreadGlobals& globals = g_globals.Get(); 157 BrowserThreadGlobals& globals = g_globals.Get();
158 if (!guaranteed_to_outlive_target_thread) 158 if (!guaranteed_to_outlive_target_thread)
159 globals.lock.Acquire(); 159 globals.lock.Acquire();
160 160
161 MessageLoop* message_loop = globals.threads[identifier] ? 161 MessageLoop* message_loop = globals.threads[identifier] ?
162 globals.threads[identifier]->message_loop() : NULL; 162 globals.threads[identifier]->message_loop() : NULL;
163 if (message_loop) { 163 if (message_loop) {
164 base::TimeDelta delay = base::TimeDelta::FromMilliseconds(delay_ms);
164 if (nestable) { 165 if (nestable) {
165 message_loop->PostDelayedTask(from_here, task, delay_ms); 166 message_loop->PostDelayedTask(from_here, task, delay);
166 } else { 167 } else {
167 message_loop->PostNonNestableDelayedTask(from_here, task, delay_ms); 168 message_loop->PostNonNestableDelayedTask(from_here, task, delay);
168 } 169 }
169 } 170 }
170 171
171 if (!guaranteed_to_outlive_target_thread) 172 if (!guaranteed_to_outlive_target_thread)
172 globals.lock.Release(); 173 globals.lock.Release();
173 174
174 return !!message_loop; 175 return !!message_loop;
175 } 176 }
176 177
177 // An implementation of MessageLoopProxy to be used in conjunction 178 // An implementation of MessageLoopProxy to be used in conjunction
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 AtomicWord* storage = reinterpret_cast<AtomicWord*>( 362 AtomicWord* storage = reinterpret_cast<AtomicWord*>(
362 &globals.thread_delegates[identifier]); 363 &globals.thread_delegates[identifier]);
363 AtomicWord old_pointer = base::subtle::NoBarrier_AtomicExchange( 364 AtomicWord old_pointer = base::subtle::NoBarrier_AtomicExchange(
364 storage, reinterpret_cast<AtomicWord>(delegate)); 365 storage, reinterpret_cast<AtomicWord>(delegate));
365 366
366 // This catches registration when previously registered. 367 // This catches registration when previously registered.
367 DCHECK(!delegate || !old_pointer); 368 DCHECK(!delegate || !old_pointer);
368 } 369 }
369 370
370 } // namespace content 371 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/browser_child_process_host_impl.cc ('k') | content/browser/gamepad/gamepad_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698