From 123603228f84d9d63f6e247b73574cbc0bb68819 Mon Sep 17 00:00:00 2001 From: "jam@chromium.org" Date: Wed, 20 May 2009 04:39:37 +0000 Subject: Reuse ChildProcessSecurityHost for worker processes. Review URL: http://codereview.chromium.org/115550 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16466 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/worker_host/worker_process_host.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'chrome/browser/worker_host') diff --git a/chrome/browser/worker_host/worker_process_host.cc b/chrome/browser/worker_host/worker_process_host.cc index abf71d1..702e563 100644 --- a/chrome/browser/worker_host/worker_process_host.cc +++ b/chrome/browser/worker_host/worker_process_host.cc @@ -12,6 +12,7 @@ #include "base/process_util.h" #include "base/string_util.h" #include "chrome/browser/browser_process.h" +#include "chrome/browser/child_process_security_policy.h" #include "chrome/browser/renderer_host/render_view_host.h" #include "chrome/browser/worker_host/worker_service.h" #include "chrome/common/chrome_switches.h" @@ -59,6 +60,8 @@ WorkerProcessHost::~WorkerProcessHost() { ui_loop->PostTask(FROM_HERE, new WorkerCrashTask( i->renderer_process_id, i->render_view_route_id)); } + + ChildProcessSecurityPolicy::GetInstance()->Remove(GetProcessId()); } bool WorkerProcessHost::Init() { @@ -89,6 +92,8 @@ bool WorkerProcessHost::Init() { return false; SetHandle(process); + ChildProcessSecurityPolicy::GetInstance()->Add(GetProcessId()); + return true; } @@ -99,6 +104,9 @@ void WorkerProcessHost::CreateWorker(const GURL& url, IPC::Message::Sender* sender, int sender_pid, int sender_route_id) { + ChildProcessSecurityPolicy::GetInstance()->GrantRequestURL( + GetProcessId(), url); + WorkerInstance instance; instance.url = url; instance.renderer_process_id = renderer_process_id; -- cgit v1.1