| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |