| 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_impl.h" | 9 #include "content/browser/child_process_security_policy_impl.h" |
| 10 #include "content/browser/frame_host/debug_urls.h" | 10 #include "content/browser/frame_host/debug_urls.h" |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 | 330 |
| 331 void SiteInstanceImpl::RenderProcessHostDestroyed(RenderProcessHost* host) { | 331 void SiteInstanceImpl::RenderProcessHostDestroyed(RenderProcessHost* host) { |
| 332 DCHECK_EQ(process_, host); | 332 DCHECK_EQ(process_, host); |
| 333 process_->RemoveObserver(this); | 333 process_->RemoveObserver(this); |
| 334 process_ = NULL; | 334 process_ = NULL; |
| 335 } | 335 } |
| 336 | 336 |
| 337 void SiteInstanceImpl::LockToOrigin() { | 337 void SiteInstanceImpl::LockToOrigin() { |
| 338 // We currently only restrict this process to a particular site if the | 338 // We currently only restrict this process to a particular site if the |
| 339 // --enable-strict-site-isolation or --site-per-process flags are present. | 339 // --enable-strict-site-isolation or --site-per-process flags are present. |
| 340 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 340 const base::CommandLine& command_line = |
| 341 *base::CommandLine::ForCurrentProcess(); |
| 341 if (command_line.HasSwitch(switches::kEnableStrictSiteIsolation) || | 342 if (command_line.HasSwitch(switches::kEnableStrictSiteIsolation) || |
| 342 command_line.HasSwitch(switches::kSitePerProcess)) { | 343 command_line.HasSwitch(switches::kSitePerProcess)) { |
| 343 ChildProcessSecurityPolicyImpl* policy = | 344 ChildProcessSecurityPolicyImpl* policy = |
| 344 ChildProcessSecurityPolicyImpl::GetInstance(); | 345 ChildProcessSecurityPolicyImpl::GetInstance(); |
| 345 policy->LockToOrigin(process_->GetID(), site_); | 346 policy->LockToOrigin(process_->GetID(), site_); |
| 346 } | 347 } |
| 347 } | 348 } |
| 348 | 349 |
| 349 } // namespace content | 350 } // namespace content |
| OLD | NEW |