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

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

Issue 9215005: Revert 117824 - Convert use of int ms to TimeDelta in files owned by brettw. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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 | Annotate | Revision Log
« no previous file with comments | « chrome/common/profiling.cc ('k') | chrome/common/service_process_util_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) 2011 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 <signal.h> 7 #include <signal.h>
8 #include <unistd.h> 8 #include <unistd.h>
9 9
10 #include "base/base_paths.h" 10 #include "base/base_paths.h"
11 #include "base/command_line.h" 11 #include "base/command_line.h"
(...skipping 12 matching lines...) Expand all
24 MultiProcessLock* TakeNamedLock(const std::string& name, bool waiting) { 24 MultiProcessLock* TakeNamedLock(const std::string& name, bool waiting) {
25 scoped_ptr<MultiProcessLock> lock(MultiProcessLock::Create(name)); 25 scoped_ptr<MultiProcessLock> lock(MultiProcessLock::Create(name));
26 if (lock == NULL) return NULL; 26 if (lock == NULL) return NULL;
27 bool got_lock = false; 27 bool got_lock = false;
28 for (int i = 0; i < 10; ++i) { 28 for (int i = 0; i < 10; ++i) {
29 if (lock->TryLock()) { 29 if (lock->TryLock()) {
30 got_lock = true; 30 got_lock = true;
31 break; 31 break;
32 } 32 }
33 if (!waiting) break; 33 if (!waiting) break;
34 base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(100 * i)); 34 base::PlatformThread::Sleep(100 * i);
35 } 35 }
36 if (!got_lock) { 36 if (!got_lock) {
37 lock.reset(); 37 lock.reset();
38 } 38 }
39 return lock.release(); 39 return lock.release();
40 } 40 }
41 41
42 MultiProcessLock* TakeServiceInitializingLock(bool waiting) { 42 MultiProcessLock* TakeServiceInitializingLock(bool waiting) {
43 std::string lock_name = 43 std::string lock_name =
44 GetServiceProcessScopedName("_service_initializing"); 44 GetServiceProcessScopedName("_service_initializing");
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 GetServiceProcessScopedName(GetBaseDesktopName()), 102 GetServiceProcessScopedName(GetBaseDesktopName()),
103 app_name, 103 app_name,
104 autorun_command_line_->GetCommandLineString(), 104 autorun_command_line_->GetCommandLineString(),
105 false); 105 false);
106 } 106 }
107 107
108 bool ServiceProcessState::RemoveFromAutoRun() { 108 bool ServiceProcessState::RemoveFromAutoRun() {
109 return AutoStart::Remove( 109 return AutoStart::Remove(
110 GetServiceProcessScopedName(GetBaseDesktopName())); 110 GetServiceProcessScopedName(GetBaseDesktopName()));
111 } 111 }
OLDNEW
« no previous file with comments | « chrome/common/profiling.cc ('k') | chrome/common/service_process_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698