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

Side by Side Diff: chrome/common/service_process_util_posix.cc

Issue 9303006: Convert use of int ms to TimeDelta in scattered chromium 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
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 "chrome/common/service_process_util_posix.h" 5 #include "chrome/common/service_process_util_posix.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/eintr_wrapper.h" 9 #include "base/eintr_wrapper.h"
10 #include "base/message_loop_proxy.h" 10 #include "base/message_loop_proxy.h"
(...skipping 10 matching lines...) Expand all
21 MultiProcessLock* TakeNamedLock(const std::string& name, bool waiting) { 21 MultiProcessLock* TakeNamedLock(const std::string& name, bool waiting) {
22 scoped_ptr<MultiProcessLock> lock(MultiProcessLock::Create(name)); 22 scoped_ptr<MultiProcessLock> lock(MultiProcessLock::Create(name));
23 if (lock == NULL) return NULL; 23 if (lock == NULL) return NULL;
24 bool got_lock = false; 24 bool got_lock = false;
25 for (int i = 0; i < 10; ++i) { 25 for (int i = 0; i < 10; ++i) {
26 if (lock->TryLock()) { 26 if (lock->TryLock()) {
27 got_lock = true; 27 got_lock = true;
28 break; 28 break;
29 } 29 }
30 if (!waiting) break; 30 if (!waiting) break;
31 base::PlatformThread::Sleep(100 * i); 31 base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(100 * i));
32 } 32 }
33 if (!got_lock) { 33 if (!got_lock) {
34 lock.reset(); 34 lock.reset();
35 } 35 }
36 return lock.release(); 36 return lock.release();
37 } 37 }
38 38
39 ServiceProcessTerminateMonitor::ServiceProcessTerminateMonitor( 39 ServiceProcessTerminateMonitor::ServiceProcessTerminateMonitor(
40 const base::Closure& terminate_task) 40 const base::Closure& terminate_task)
41 : terminate_task_(terminate_task) { 41 : terminate_task_(terminate_task) {
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 signal_ready.Wait(); 186 signal_ready.Wait();
187 return success; 187 return success;
188 } 188 }
189 189
190 void ServiceProcessState::TearDownState() { 190 void ServiceProcessState::TearDownState() {
191 if (state_) { 191 if (state_) {
192 state_->Release(); 192 state_->Release();
193 state_ = NULL; 193 state_ = NULL;
194 } 194 }
195 } 195 }
OLDNEW
« no previous file with comments | « chrome/browser/plugin_download_helper_unittest.cc ('k') | ppapi/proxy/ppb_message_loop_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698