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

Side by Side Diff: sandbox/win/src/job.h

Issue 319573006: Add sandbox support for process memory limits (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: feedback Created 6 years, 6 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 SANDBOX_SRC_JOB_H_ 5 #ifndef SANDBOX_SRC_JOB_H_
6 #define SANDBOX_SRC_JOB_H_ 6 #define SANDBOX_SRC_JOB_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "sandbox/win/src/restricted_token_utils.h" 9 #include "sandbox/win/src/restricted_token_utils.h"
10 10
(...skipping 13 matching lines...) Expand all
24 // Initializes and creates the job object. The security of the job is based 24 // Initializes and creates the job object. The security of the job is based
25 // on the security_level parameter. 25 // on the security_level parameter.
26 // job_name can be NULL if the job is unnamed. 26 // job_name can be NULL if the job is unnamed.
27 // If the chosen profile has too many ui restrictions, you can disable some 27 // If the chosen profile has too many ui restrictions, you can disable some
28 // by specifying them in the ui_exceptions parameters. 28 // by specifying them in the ui_exceptions parameters.
29 // If the function succeeds, the return value is ERROR_SUCCESS. If the 29 // If the function succeeds, the return value is ERROR_SUCCESS. If the
30 // function fails, the return value is the win32 error code corresponding to 30 // function fails, the return value is the win32 error code corresponding to
31 // the error. 31 // the error.
32 DWORD Init(JobLevel security_level, 32 DWORD Init(JobLevel security_level,
33 const wchar_t* job_name, 33 const wchar_t* job_name,
34 DWORD ui_exceptions); 34 DWORD ui_exceptions,
35 size_t memory_limit);
35 36
36 // Assigns the process referenced by process_handle to the job. 37 // Assigns the process referenced by process_handle to the job.
37 // If the function succeeds, the return value is ERROR_SUCCESS. If the 38 // If the function succeeds, the return value is ERROR_SUCCESS. If the
38 // function fails, the return value is the win32 error code corresponding to 39 // function fails, the return value is the win32 error code corresponding to
39 // the error. 40 // the error.
40 DWORD AssignProcessToJob(HANDLE process_handle); 41 DWORD AssignProcessToJob(HANDLE process_handle);
41 42
42 // Grants access to "handle" to the job. All processes in the job can 43 // Grants access to "handle" to the job. All processes in the job can
43 // subsequently recognize and use the handle. 44 // subsequently recognize and use the handle.
44 // If the function succeeds, the return value is ERROR_SUCCESS. If the 45 // If the function succeeds, the return value is ERROR_SUCCESS. If the
(...skipping 10 matching lines...) Expand all
55 // Handle to the job referenced by the object. 56 // Handle to the job referenced by the object.
56 HANDLE job_handle_; 57 HANDLE job_handle_;
57 58
58 DISALLOW_COPY_AND_ASSIGN(Job); 59 DISALLOW_COPY_AND_ASSIGN(Job);
59 }; 60 };
60 61
61 } // namespace sandbox 62 } // namespace sandbox
62 63
63 64
64 #endif // SANDBOX_SRC_JOB_H_ 65 #endif // SANDBOX_SRC_JOB_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698