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/renderer_host/render_process_host_impl.h" | 10 #include "content/browser/renderer_host/render_process_host_impl.h" |
11 #include "content/browser/storage_partition_impl.h" | 11 #include "content/browser/storage_partition_impl.h" |
12 #include "content/public/browser/content_browser_client.h" | 12 #include "content/public/browser/content_browser_client.h" |
13 #include "content/public/browser/notification_service.h" | 13 #include "content/public/browser/notification_service.h" |
14 #include "content/public/browser/notification_types.h" | 14 #include "content/public/browser/notification_types.h" |
15 #include "content/public/browser/render_process_host_factory.h" | 15 #include "content/public/browser/render_process_host_factory.h" |
16 #include "content/public/browser/web_ui_controller_factory.h" | 16 #include "content/public/browser/web_ui_controller_factory.h" |
17 #include "content/public/common/content_switches.h" | 17 #include "content/public/common/content_switches.h" |
18 #include "content/public/common/url_constants.h" | 18 #include "content/public/common/url_constants.h" |
19 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 19 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
20 | 20 |
21 using content::BrowserContext; | 21 using content::BrowserContext; |
| 22 using content::ChildProcessSecurityPolicyImpl; |
22 using content::RenderProcessHost; | 23 using content::RenderProcessHost; |
23 using content::RenderProcessHostImpl; | 24 using content::RenderProcessHostImpl; |
24 using content::SiteInstance; | 25 using content::SiteInstance; |
25 using content::StoragePartitionImpl; | 26 using content::StoragePartitionImpl; |
26 using content::WebUIControllerFactory; | 27 using content::WebUIControllerFactory; |
27 | 28 |
28 static bool IsURLSameAsAnySiteInstance(const GURL& url) { | 29 static bool IsURLSameAsAnySiteInstance(const GURL& url) { |
29 if (!url.is_valid()) | 30 if (!url.is_valid()) |
30 return false; | 31 return false; |
31 | 32 |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 } | 324 } |
324 | 325 |
325 void SiteInstanceImpl::LockToOrigin() { | 326 void SiteInstanceImpl::LockToOrigin() { |
326 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 327 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
327 if (command_line.HasSwitch(switches::kEnableStrictSiteIsolation)) { | 328 if (command_line.HasSwitch(switches::kEnableStrictSiteIsolation)) { |
328 ChildProcessSecurityPolicyImpl* policy = | 329 ChildProcessSecurityPolicyImpl* policy = |
329 ChildProcessSecurityPolicyImpl::GetInstance(); | 330 ChildProcessSecurityPolicyImpl::GetInstance(); |
330 policy->LockToOrigin(process_->GetID(), site_); | 331 policy->LockToOrigin(process_->GetID(), site_); |
331 } | 332 } |
332 } | 333 } |
OLD | NEW |