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; | |
23 using content::RenderProcessHost; | 22 using content::RenderProcessHost; |
24 using content::RenderProcessHostImpl; | 23 using content::RenderProcessHostImpl; |
25 using content::SiteInstance; | 24 using content::SiteInstance; |
26 using content::StoragePartitionImpl; | 25 using content::StoragePartitionImpl; |
27 using content::WebUIControllerFactory; | 26 using content::WebUIControllerFactory; |
28 | 27 |
29 static bool IsURLSameAsAnySiteInstance(const GURL& url) { | 28 static bool IsURLSameAsAnySiteInstance(const GURL& url) { |
30 if (!url.is_valid()) | 29 if (!url.is_valid()) |
31 return false; | 30 return false; |
32 | 31 |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 } | 323 } |
325 | 324 |
326 void SiteInstanceImpl::LockToOrigin() { | 325 void SiteInstanceImpl::LockToOrigin() { |
327 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 326 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
328 if (command_line.HasSwitch(switches::kEnableStrictSiteIsolation)) { | 327 if (command_line.HasSwitch(switches::kEnableStrictSiteIsolation)) { |
329 ChildProcessSecurityPolicyImpl* policy = | 328 ChildProcessSecurityPolicyImpl* policy = |
330 ChildProcessSecurityPolicyImpl::GetInstance(); | 329 ChildProcessSecurityPolicyImpl::GetInstance(); |
331 policy->LockToOrigin(process_->GetID(), site_); | 330 policy->LockToOrigin(process_->GetID(), site_); |
332 } | 331 } |
333 } | 332 } |
OLD | NEW |