Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(426)

Side by Side Diff: content/browser/site_instance_impl.cc

Issue 9360014: Create a content public browser API around the ChildProcessSecurityPolicy class. The implementati... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/site_instance_impl.h" 5 #include "content/browser/site_instance_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "content/browser/browsing_instance.h" 8 #include "content/browser/browsing_instance.h"
9 #include "content/browser/child_process_security_policy.h" 9 #include "content/browser/child_process_security_policy_impl.h"
10 #include "content/browser/renderer_host/render_process_host_impl.h" 10 #include "content/browser/renderer_host/render_process_host_impl.h"
11 #include "content/public/browser/content_browser_client.h" 11 #include "content/public/browser/content_browser_client.h"
12 #include "content/public/browser/notification_service.h" 12 #include "content/public/browser/notification_service.h"
13 #include "content/public/browser/notification_types.h" 13 #include "content/public/browser/notification_types.h"
14 #include "content/public/browser/render_process_host_factory.h" 14 #include "content/public/browser/render_process_host_factory.h"
15 #include "content/public/common/content_switches.h" 15 #include "content/public/common/content_switches.h"
16 #include "content/public/common/url_constants.h" 16 #include "content/public/common/url_constants.h"
17 #include "net/base/registry_controlled_domain.h" 17 #include "net/base/registry_controlled_domain.h"
18 18
19 using content::SiteInstance; 19 using content::SiteInstance;
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 DCHECK(type == content::NOTIFICATION_RENDERER_PROCESS_TERMINATED); 254 DCHECK(type == content::NOTIFICATION_RENDERER_PROCESS_TERMINATED);
255 content::RenderProcessHost* rph = 255 content::RenderProcessHost* rph =
256 content::Source<content::RenderProcessHost>(source).ptr(); 256 content::Source<content::RenderProcessHost>(source).ptr();
257 if (rph == process_) 257 if (rph == process_)
258 process_ = NULL; 258 process_ = NULL;
259 } 259 }
260 260
261 void SiteInstanceImpl::LockToOrigin() { 261 void SiteInstanceImpl::LockToOrigin() {
262 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 262 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
263 if (command_line.HasSwitch(switches::kEnableStrictSiteIsolation)) { 263 if (command_line.HasSwitch(switches::kEnableStrictSiteIsolation)) {
264 ChildProcessSecurityPolicy* policy = 264 ChildProcessSecurityPolicyImpl* policy =
265 ChildProcessSecurityPolicy::GetInstance(); 265 ChildProcessSecurityPolicyImpl::GetInstance();
266 policy->LockToOrigin(process_->GetID(), site_); 266 policy->LockToOrigin(process_->GetID(), site_);
267 } 267 }
268 } 268 }
269 269
OLDNEW
« no previous file with comments | « content/browser/renderer_host/resource_dispatcher_host_unittest.cc ('k') | content/browser/site_instance_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698