summaryrefslogtreecommitdiffstats
path: root/chrome/browser/worker_host
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-20 04:39:37 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-20 04:39:37 +0000
commit123603228f84d9d63f6e247b73574cbc0bb68819 (patch)
treea0d1b7998cc83ec24b4f127fc6be5f8a3ba036be /chrome/browser/worker_host
parenta9cea754e016601a59cb07be2946559a9ad21738 (diff)
downloadchromium_src-123603228f84d9d63f6e247b73574cbc0bb68819.zip
chromium_src-123603228f84d9d63f6e247b73574cbc0bb68819.tar.gz
chromium_src-123603228f84d9d63f6e247b73574cbc0bb68819.tar.bz2
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
Diffstat (limited to 'chrome/browser/worker_host')
-rw-r--r--chrome/browser/worker_host/worker_process_host.cc8
1 files changed, 8 insertions, 0 deletions
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;