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

Side by Side Diff: content/public/common/sandbox_init.h

Issue 10082018: Move BrokerDuplicateHandle() to be declared in content/public (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Copyright Created 8 years, 8 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 | « content/plugin/webplugin_proxy.cc ('k') | content/renderer/webplugin_delegate_proxy.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) 2011 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 #ifndef CONTENT_PUBLIC_COMMON_SANDBOX_INIT_H_ 5 #ifndef CONTENT_PUBLIC_COMMON_SANDBOX_INIT_H_
6 #define CONTENT_PUBLIC_COMMON_SANDBOX_INIT_H_ 6 #define CONTENT_PUBLIC_COMMON_SANDBOX_INIT_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/process.h"
9 #include "build/build_config.h" 10 #include "build/build_config.h"
10 #include "content/common/content_export.h" 11 #include "content/common/content_export.h"
11 12
12 #if defined(OS_WIN) 13 #if defined(OS_WIN)
13 namespace sandbox { 14 namespace sandbox {
14 struct SandboxInterfaceInfo; 15 struct SandboxInterfaceInfo;
15 } 16 }
16 #elif defined(OS_MACOSX) 17 #elif defined(OS_MACOSX)
17 class FilePath; 18 class FilePath;
18 #endif 19 #endif
19 20
20 namespace content { 21 namespace content {
21 22
22 #if defined(OS_WIN) 23 #if defined(OS_WIN)
24
23 // Initialize the sandbox for renderer, gpu, utility, worker, nacl, and plug-in 25 // Initialize the sandbox for renderer, gpu, utility, worker, nacl, and plug-in
24 // processes, depending on the command line flags. Although The browser process 26 // processes, depending on the command line flags. Although The browser process
25 // is not sandboxed, this also needs to be called because it will initialize 27 // is not sandboxed, this also needs to be called because it will initialize
26 // the broker code. 28 // the broker code.
27 // Returns true if the sandbox was initialized succesfully, false if an error 29 // Returns true if the sandbox was initialized succesfully, false if an error
28 // occurred. If process_type isn't one that needs sandboxing true is always 30 // occurred. If process_type isn't one that needs sandboxing true is always
29 // returned. 31 // returned.
30 CONTENT_EXPORT bool InitializeSandbox( 32 CONTENT_EXPORT bool InitializeSandbox(
31 sandbox::SandboxInterfaceInfo* sandbox_info); 33 sandbox::SandboxInterfaceInfo* sandbox_info);
34
35 CONTENT_EXPORT bool BrokerDuplicateHandle(HANDLE source_handle,
jam 2012/04/15 21:40:55 nit: please add a comment here
Mark Seaborn 2012/04/16 15:32:44 OK, comment added.
36 DWORD target_process_id,
37 HANDLE* target_handle,
38 DWORD desired_access,
39 DWORD options);
40
32 #elif defined(OS_MACOSX) 41 #elif defined(OS_MACOSX)
42
33 // Initialize the sandbox of the given |sandbox_type|, optionally specifying a 43 // Initialize the sandbox of the given |sandbox_type|, optionally specifying a
34 // directory to allow access to. Note specifying a directory needs to be 44 // directory to allow access to. Note specifying a directory needs to be
35 // supported by the sandbox profile associated with the given |sandbox_type|. 45 // supported by the sandbox profile associated with the given |sandbox_type|.
36 // Valid values for |sandbox_type| are defined either by the enum SandboxType, 46 // Valid values for |sandbox_type| are defined either by the enum SandboxType,
37 // or by ContentClient::GetSandboxProfileForSandboxType(). 47 // or by ContentClient::GetSandboxProfileForSandboxType().
38 // 48 //
39 // If the |sandbox_type| isn't one of the ones defined by content then the 49 // If the |sandbox_type| isn't one of the ones defined by content then the
40 // embedder is queried using ContentClient::GetSandboxPolicyForSandboxType(). 50 // embedder is queried using ContentClient::GetSandboxPolicyForSandboxType().
41 // The embedder can use values for |sandbox_type| starting from 51 // The embedder can use values for |sandbox_type| starting from
42 // content::sandbox::SANDBOX_PROCESS_TYPE_AFTER_LAST_TYPE. 52 // content::sandbox::SANDBOX_PROCESS_TYPE_AFTER_LAST_TYPE.
43 // 53 //
44 // Returns true if the sandbox was initialized succesfully, false if an error 54 // Returns true if the sandbox was initialized succesfully, false if an error
45 // occurred. If process_type isn't one that needs sandboxing, no action is 55 // occurred. If process_type isn't one that needs sandboxing, no action is
46 // taken and true is always returned. 56 // taken and true is always returned.
47 CONTENT_EXPORT bool InitializeSandbox(int sandbox_type, 57 CONTENT_EXPORT bool InitializeSandbox(int sandbox_type,
48 const FilePath& allowed_path); 58 const FilePath& allowed_path);
59
49 #elif defined(OS_LINUX) 60 #elif defined(OS_LINUX)
61
50 CONTENT_EXPORT void InitializeSandbox(); 62 CONTENT_EXPORT void InitializeSandbox();
63
51 #endif 64 #endif
52 65
53 } // namespace content 66 } // namespace content
54 67
55 #endif // CONTENT_PUBLIC_COMMON_SANDBOX_INIT_H_ 68 #endif // CONTENT_PUBLIC_COMMON_SANDBOX_INIT_H_
OLDNEW
« no previous file with comments | « content/plugin/webplugin_proxy.cc ('k') | content/renderer/webplugin_delegate_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698