summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/renderer_host/resource_dispatcher_host.cc4
-rw-r--r--chrome/browser/worker_host/worker_process_host.cc8
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;