diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-20 04:39:37 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-20 04:39:37 +0000 |
commit | 123603228f84d9d63f6e247b73574cbc0bb68819 (patch) | |
tree | a0d1b7998cc83ec24b4f127fc6be5f8a3ba036be /chrome | |
parent | a9cea754e016601a59cb07be2946559a9ad21738 (diff) | |
download | chromium_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')
-rw-r--r-- | chrome/browser/renderer_host/resource_dispatcher_host.cc | 4 | ||||
-rw-r--r-- | chrome/browser/worker_host/worker_process_host.cc | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/chrome/browser/renderer_host/resource_dispatcher_host.cc b/chrome/browser/renderer_host/resource_dispatcher_host.cc index e091819..785d396 100644 --- a/chrome/browser/renderer_host/resource_dispatcher_host.cc +++ b/chrome/browser/renderer_host/resource_dispatcher_host.cc @@ -106,7 +106,7 @@ const int kMaxOutstandingRequestsCostPerProcess = 26214400; bool ShouldServiceRequest(ChildProcessInfo::ProcessType process_type, int process_id, const ViewHostMsg_Resource_Request& request_data) { - if (process_type != ChildProcessInfo::RENDER_PROCESS) + if (process_type == ChildProcessInfo::PLUGIN_PROCESS) return true; ChildProcessSecurityPolicy* policy = ChildProcessSecurityPolicy::GetInstance(); @@ -820,7 +820,7 @@ void ResourceDispatcherHost::OnReceivedRedirect(URLRequest* request, DCHECK(request->status().is_success()); - if (info->process_type == ChildProcessInfo::RENDER_PROCESS && + if (info->process_type != ChildProcessInfo::PLUGIN_PROCESS && !ChildProcessSecurityPolicy::GetInstance()-> CanRequestURL(info->process_id, new_url)) { LOG(INFO) << "Denied unauthorized request for " << 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; |