| 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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 GetEffectiveURL(browser_context, url); | 334 GetEffectiveURL(browser_context, url); |
| 335 } | 335 } |
| 336 | 336 |
| 337 void SiteInstanceImpl::RenderProcessHostDestroyed(RenderProcessHost* host) { | 337 void SiteInstanceImpl::RenderProcessHostDestroyed(RenderProcessHost* host) { |
| 338 DCHECK_EQ(process_, host); | 338 DCHECK_EQ(process_, host); |
| 339 process_->RemoveObserver(this); | 339 process_->RemoveObserver(this); |
| 340 process_ = NULL; | 340 process_ = NULL; |
| 341 } | 341 } |
| 342 | 342 |
| 343 void SiteInstanceImpl::LockToOrigin() { | 343 void SiteInstanceImpl::LockToOrigin() { |
| 344 // We currently only restrict this process to a particular site if the | 344 // We currently only restrict this process to a particular site if --site-per- |
| 345 // --enable-strict-site-isolation or --site-per-process flags are present. | 345 // process flag is present. |
| 346 const base::CommandLine& command_line = | 346 const base::CommandLine& command_line = |
| 347 *base::CommandLine::ForCurrentProcess(); | 347 *base::CommandLine::ForCurrentProcess(); |
| 348 if (command_line.HasSwitch(switches::kEnableStrictSiteIsolation) || | 348 if (command_line.HasSwitch(switches::kSitePerProcess)) { |
| 349 command_line.HasSwitch(switches::kSitePerProcess)) { | |
| 350 ChildProcessSecurityPolicyImpl* policy = | 349 ChildProcessSecurityPolicyImpl* policy = |
| 351 ChildProcessSecurityPolicyImpl::GetInstance(); | 350 ChildProcessSecurityPolicyImpl::GetInstance(); |
| 352 policy->LockToOrigin(process_->GetID(), site_); | 351 policy->LockToOrigin(process_->GetID(), site_); |
| 353 } | 352 } |
| 354 } | 353 } |
| 355 | 354 |
| 356 } // namespace content | 355 } // namespace content |
| OLD | NEW |