summaryrefslogtreecommitdiffstats
path: root/content/browser/worker_host
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-20 00:30:18 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-20 00:30:18 +0000
commit34f4868ad60ff1f8aa0374aee947cec4960d4670 (patch)
tree3ed90336e8c85d9548a2e479c47477192d54dd1b /content/browser/worker_host
parent13ee68abf3ddb40c7a9eaa54ef6afbc21cdc37ff (diff)
downloadchromium_src-34f4868ad60ff1f8aa0374aee947cec4960d4670.zip
chromium_src-34f4868ad60ff1f8aa0374aee947cec4960d4670.tar.gz
chromium_src-34f4868ad60ff1f8aa0374aee947cec4960d4670.tar.bz2
Refactor sandbox_policy.cc so that it doesn't contain the sandbox policies for all processes. Instead have whoever creates a sandboxed process set this data. This allows us to clean a few NaCl related changes in content:
-remove NaCl sandbox rules from content -remove the hack for ifdef'ing out the GPU policy since it didn't link for nacl64.exe -remove the 1GB memory reservation for the NaCl loader process out of content Other cleanup: -renamed sandbox_policy.* to sandbox_win.* to match the other platform-specific sandbox files -moved BrokerGetFileHandleForProcess to internal content files since it's not called from outside -remove AddGpuDllEvictionPolicy since it was redundant (the one dll it removed was already listed in the generic list) There's still more cleanup to be done in the sandbox code (i.e. remove chrome frame switch, nacl process type switch etc). I will do that in future changes. BUG=191682 Review URL: https://codereview.chromium.org/12805004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189175 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/worker_host')
-rw-r--r--content/browser/worker_host/worker_process_host.cc23
1 files changed, 21 insertions, 2 deletions
diff --git a/content/browser/worker_host/worker_process_host.cc b/content/browser/worker_host/worker_process_host.cc
index fcd3376..56a2e59 100644
--- a/content/browser/worker_host/worker_process_host.cc
+++ b/content/browser/worker_host/worker_process_host.cc
@@ -35,7 +35,6 @@
#include "content/browser/worker_host/worker_message_filter.h"
#include "content/browser/worker_host/worker_service_impl.h"
#include "content/common/child_process_host_impl.h"
-#include "content/common/debug_flags.h"
#include "content/common/view_messages.h"
#include "content/common/worker_messages.h"
#include "content/public/browser/browser_thread.h"
@@ -52,9 +51,29 @@
#include "webkit/fileapi/sandbox_mount_point_provider.h"
#include "webkit/glue/resource_type.h"
+#if defined(OS_WIN)
+#include "content/common/sandbox_win.h"
+#include "content/public/common/sandboxed_process_launcher_delegate.h"
+#endif
+
namespace content {
namespace {
+#if defined(OS_WIN)
+// NOTE: changes to this class need to be reviewed by the security team.
+class WorkerSandboxedProcessLauncherDelegate
+ : public content::SandboxedProcessLauncherDelegate {
+ public:
+ WorkerSandboxedProcessLauncherDelegate() {}
+ virtual ~WorkerSandboxedProcessLauncherDelegate() {}
+
+ virtual void PreSpawnTarget(sandbox::TargetPolicy* policy,
+ bool* success) {
+ AddBaseHandleClosePolicy(policy);
+ }
+};
+#endif // OS_WIN
+
// Helper class that we pass to SocketStreamDispatcherHost so that it can find
// the right net::URLRequestContext for a request.
class URLRequestContextSelector
@@ -191,7 +210,7 @@ bool WorkerProcessHost::Init(int render_process_id) {
process_->Launch(
#if defined(OS_WIN)
- base::FilePath(),
+ new WorkerSandboxedProcessLauncherDelegate,
#elif defined(OS_POSIX)
use_zygote,
base::EnvironmentVector(),