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

Side by Side Diff: base/process/process.h

Issue 860453002: Move OpenProcessHandleWithAccess to Process::OpenWithAccess. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add ServiceProcessControlBrowserTest.Setup again Created 5 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) 2011 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 #ifndef BASE_PROCESS_PROCESS_PROCESS_H_ 5 #ifndef BASE_PROCESS_PROCESS_PROCESS_H_
6 #define BASE_PROCESS_PROCESS_PROCESS_H_ 6 #define BASE_PROCESS_PROCESS_PROCESS_H_
7 7
8 #include "base/base_export.h" 8 #include "base/base_export.h"
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/move.h" 10 #include "base/move.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 Process& operator=(RValue other); 47 Process& operator=(RValue other);
48 48
49 // Returns an object for the current process. 49 // Returns an object for the current process.
50 static Process Current(); 50 static Process Current();
51 51
52 // Returns a Process for the given |pid|. On Windows the handle is opened 52 // Returns a Process for the given |pid|. On Windows the handle is opened
53 // with more access rights and must only be used by trusted code (can read the 53 // with more access rights and must only be used by trusted code (can read the
54 // address space and duplicate handles). 54 // address space and duplicate handles).
55 static Process OpenWithExtraPriviles(ProcessId pid); 55 static Process OpenWithExtraPriviles(ProcessId pid);
56 56
57 #if defined(OS_WIN)
58 // Returns a Process for the given |pid|, using some |desired_access|.
59 // See ::OpenProcess documentation for valid |desired_access|.
60 static Process OpenWithAccess(ProcessId pid, DWORD desired_access);
61 #endif
62
57 // Creates an object from a |handle| owned by someone else. 63 // Creates an object from a |handle| owned by someone else.
58 // Don't use this for new code. It is only intended to ease the migration to 64 // Don't use this for new code. It is only intended to ease the migration to
59 // a strict ownership model. 65 // a strict ownership model.
60 // TODO(rvargas) crbug.com/417532: Remove this code. 66 // TODO(rvargas) crbug.com/417532: Remove this code.
61 static Process DeprecatedGetProcessFromHandle(ProcessHandle handle); 67 static Process DeprecatedGetProcessFromHandle(ProcessHandle handle);
62 68
63 // Returns true if processes can be backgrounded. 69 // Returns true if processes can be backgrounded.
64 static bool CanBackgroundProcesses(); 70 static bool CanBackgroundProcesses();
65 71
66 // Returns true if this objects represents a valid process. 72 // Returns true if this objects represents a valid process.
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 // multiple threads are running, since at the time the fork happened, the 138 // multiple threads are running, since at the time the fork happened, the
133 // threads could have been in any state (potentially holding locks, etc.). 139 // threads could have been in any state (potentially holding locks, etc.).
134 // Callers should most likely call execve() in the child soon after calling 140 // Callers should most likely call execve() in the child soon after calling
135 // this. 141 // this.
136 BASE_EXPORT pid_t ForkWithFlags(unsigned long flags, pid_t* ptid, pid_t* ctid); 142 BASE_EXPORT pid_t ForkWithFlags(unsigned long flags, pid_t* ptid, pid_t* ctid);
137 #endif 143 #endif
138 144
139 } // namespace base 145 } // namespace base
140 146
141 #endif // BASE_PROCESS_PROCESS_PROCESS_H_ 147 #endif // BASE_PROCESS_PROCESS_PROCESS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698