OLD | NEW |
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 "base/win/scoped_handle.h" | 9 #include "base/win/scoped_handle.h" |
10 #include "sandbox/win/src/restricted_token_utils.h" | 10 #include "sandbox/win/src/restricted_token_utils.h" |
11 | 11 |
12 namespace sandbox { | 12 namespace sandbox { |
13 | 13 |
14 // Handles the creation of job objects based on a security profile. | 14 // Handles the creation of job objects based on a security profile. |
15 // Sample usage: | 15 // Sample usage: |
16 // Job job; | 16 // Job job; |
17 // job.Init(JOB_LOCKDOWN, NULL); //no job name | 17 // job.Init(JOB_LOCKDOWN, NULL); //no job name |
18 // job.AssignProcessToJob(process_handle); | 18 // job.AssignProcessToJob(process_handle); |
19 class Job { | 19 class Job { |
20 public: | 20 public: |
21 Job() : job_handle_(NULL) { } | 21 Job(); |
22 | 22 |
23 ~Job(); | 23 ~Job(); |
24 | 24 |
25 // Initializes and creates the job object. The security of the job is based | 25 // Initializes and creates the job object. The security of the job is based |
26 // on the security_level parameter. | 26 // on the security_level parameter. |
27 // job_name can be NULL if the job is unnamed. | 27 // job_name can be NULL if the job is unnamed. |
28 // If the chosen profile has too many ui restrictions, you can disable some | 28 // If the chosen profile has too many ui restrictions, you can disable some |
29 // by specifying them in the ui_exceptions parameters. | 29 // by specifying them in the ui_exceptions parameters. |
30 // If the function succeeds, the return value is ERROR_SUCCESS. If the | 30 // If the function succeeds, the return value is ERROR_SUCCESS. If the |
31 // function fails, the return value is the win32 error code corresponding to | 31 // function fails, the return value is the win32 error code corresponding to |
(...skipping 24 matching lines...) Expand all Loading... |
56 // Handle to the job referenced by the object. | 56 // Handle to the job referenced by the object. |
57 base::win::ScopedHandle job_handle_; | 57 base::win::ScopedHandle job_handle_; |
58 | 58 |
59 DISALLOW_COPY_AND_ASSIGN(Job); | 59 DISALLOW_COPY_AND_ASSIGN(Job); |
60 }; | 60 }; |
61 | 61 |
62 } // namespace sandbox | 62 } // namespace sandbox |
63 | 63 |
64 | 64 |
65 #endif // SANDBOX_SRC_JOB_H_ | 65 #endif // SANDBOX_SRC_JOB_H_ |
OLD | NEW |