Chromium Code Reviews| 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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 266 // If either URL is invalid, they aren't part of the same site. | 266 // If either URL is invalid, they aren't part of the same site. |
| 267 if (!src_url.is_valid() || !dest_url.is_valid()) | 267 if (!src_url.is_valid() || !dest_url.is_valid()) |
| 268 return false; | 268 return false; |
| 269 | 269 |
| 270 // If the destination url is just a blank page, we treat them as part of the | 270 // If the destination url is just a blank page, we treat them as part of the |
| 271 // same site. | 271 // same site. |
| 272 GURL blank_page(url::kAboutBlankURL); | 272 GURL blank_page(url::kAboutBlankURL); |
| 273 if (dest_url == blank_page) | 273 if (dest_url == blank_page) |
| 274 return true; | 274 return true; |
| 275 | 275 |
| 276 if (dest_url.scheme() == url::kDataScheme) | |
|
Charlie Reis
2014/12/06 00:18:50
I'd like to avoid this if we can. Generally, typi
lfg
2014/12/08 20:45:33
Should we also remove about:blank urls from IsSame
| |
| 277 return true; | |
| 278 | |
| 276 // If the schemes differ, they aren't part of the same site. | 279 // If the schemes differ, they aren't part of the same site. |
| 277 if (src_url.scheme() != dest_url.scheme()) | 280 if (src_url.scheme() != dest_url.scheme()) |
| 278 return false; | 281 return false; |
| 279 | 282 |
| 280 return net::registry_controlled_domains::SameDomainOrHost( | 283 return net::registry_controlled_domains::SameDomainOrHost( |
| 281 src_url, | 284 src_url, |
| 282 dest_url, | 285 dest_url, |
| 283 net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES); | 286 net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES); |
| 284 } | 287 } |
| 285 | 288 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 345 *base::CommandLine::ForCurrentProcess(); | 348 *base::CommandLine::ForCurrentProcess(); |
| 346 if (command_line.HasSwitch(switches::kEnableStrictSiteIsolation) || | 349 if (command_line.HasSwitch(switches::kEnableStrictSiteIsolation) || |
| 347 command_line.HasSwitch(switches::kSitePerProcess)) { | 350 command_line.HasSwitch(switches::kSitePerProcess)) { |
| 348 ChildProcessSecurityPolicyImpl* policy = | 351 ChildProcessSecurityPolicyImpl* policy = |
| 349 ChildProcessSecurityPolicyImpl::GetInstance(); | 352 ChildProcessSecurityPolicyImpl::GetInstance(); |
| 350 policy->LockToOrigin(process_->GetID(), site_); | 353 policy->LockToOrigin(process_->GetID(), site_); |
| 351 } | 354 } |
| 352 } | 355 } |
| 353 | 356 |
| 354 } // namespace content | 357 } // namespace content |
| OLD | NEW |