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

Unified 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: Comment 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/plugin/webplugin_proxy.cc ('k') | content/renderer/webplugin_delegate_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/common/sandbox_init.h
diff --git a/content/public/common/sandbox_init.h b/content/public/common/sandbox_init.h
index 26b7d38e607f104c0c29005de5c5b673a464386d..89523239f222ecad4511df6d7582980e1d9ed3f8 100644
--- a/content/public/common/sandbox_init.h
+++ b/content/public/common/sandbox_init.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -6,6 +6,7 @@
#define CONTENT_PUBLIC_COMMON_SANDBOX_INIT_H_
#pragma once
+#include "base/process.h"
#include "build/build_config.h"
#include "content/common/content_export.h"
@@ -20,6 +21,7 @@ class FilePath;
namespace content {
#if defined(OS_WIN)
+
// Initialize the sandbox for renderer, gpu, utility, worker, nacl, and plug-in
// processes, depending on the command line flags. Although The browser process
// is not sandboxed, this also needs to be called because it will initialize
@@ -29,7 +31,19 @@ namespace content {
// returned.
CONTENT_EXPORT bool InitializeSandbox(
sandbox::SandboxInterfaceInfo* sandbox_info);
+
+// This is a restricted version of Windows' DuplicateHandle() function
+// that works inside the sandbox and can send handles but not retrieve
+// them. Unlike DuplicateHandle(), it takes a process ID rather than
+// a process handle. It returns true on success, false otherwise.
+CONTENT_EXPORT bool BrokerDuplicateHandle(HANDLE source_handle,
+ DWORD target_process_id,
+ HANDLE* target_handle,
+ DWORD desired_access,
+ DWORD options);
+
#elif defined(OS_MACOSX)
+
// Initialize the sandbox of the given |sandbox_type|, optionally specifying a
// directory to allow access to. Note specifying a directory needs to be
// supported by the sandbox profile associated with the given |sandbox_type|.
@@ -46,8 +60,11 @@ CONTENT_EXPORT bool InitializeSandbox(
// taken and true is always returned.
CONTENT_EXPORT bool InitializeSandbox(int sandbox_type,
const FilePath& allowed_path);
+
#elif defined(OS_LINUX)
+
CONTENT_EXPORT void InitializeSandbox();
+
#endif
} // namespace content
« 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