| 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/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 2887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2898 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 2898 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 2899 bool force_swap_due_to_flag = | 2899 bool force_swap_due_to_flag = |
| 2900 command_line.HasSwitch(switches::kEnableStrictSiteIsolation) || | 2900 command_line.HasSwitch(switches::kEnableStrictSiteIsolation) || |
| 2901 command_line.HasSwitch(switches::kSitePerProcess); | 2901 command_line.HasSwitch(switches::kSitePerProcess); |
| 2902 if (force_swap_due_to_flag && | 2902 if (force_swap_due_to_flag && |
| 2903 !frame->parent() && (is_content_initiated || is_redirect)) { | 2903 !frame->parent() && (is_content_initiated || is_redirect)) { |
| 2904 WebString origin_str = frame->document().securityOrigin().toString(); | 2904 WebString origin_str = frame->document().securityOrigin().toString(); |
| 2905 GURL frame_url(origin_str.utf8().data()); | 2905 GURL frame_url(origin_str.utf8().data()); |
| 2906 // TODO(cevans): revisit whether this site check is still necessary once | 2906 // TODO(cevans): revisit whether this site check is still necessary once |
| 2907 // crbug.com/101395 is fixed. | 2907 // crbug.com/101395 is fixed. |
| 2908 if (!net::RegistryControlledDomainService::SameDomainOrHost(frame_url, | 2908 bool same_domain_or_host = |
| 2909 url) || | 2909 net::RegistryControlledDomainService::SameDomainOrHost( |
| 2910 frame_url.scheme() != url.scheme()) { | 2910 frame_url, url, net::RCDS::EXCLUDE_PRIVATE_REGISTRIES); |
| 2911 if (!same_domain_or_host || frame_url.scheme() != url.scheme()) { |
| 2911 OpenURL(frame, url, referrer, default_policy); | 2912 OpenURL(frame, url, referrer, default_policy); |
| 2912 return WebKit::WebNavigationPolicyIgnore; | 2913 return WebKit::WebNavigationPolicyIgnore; |
| 2913 } | 2914 } |
| 2914 } | 2915 } |
| 2915 | 2916 |
| 2916 // If the browser is interested, then give it a chance to look at the request. | 2917 // If the browser is interested, then give it a chance to look at the request. |
| 2917 if (is_content_initiated) { | 2918 if (is_content_initiated) { |
| 2918 bool browser_handles_request = | 2919 bool browser_handles_request = |
| 2919 renderer_preferences_.browser_handles_non_local_top_level_requests && | 2920 renderer_preferences_.browser_handles_non_local_top_level_requests && |
| 2920 IsNonLocalTopLevelNavigation(url, frame, type); | 2921 IsNonLocalTopLevelNavigation(url, frame, type); |
| (...skipping 3582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6503 WebURL url = icon_urls[i].iconURL(); | 6504 WebURL url = icon_urls[i].iconURL(); |
| 6504 if (!url.isEmpty()) | 6505 if (!url.isEmpty()) |
| 6505 urls.push_back(FaviconURL(url, | 6506 urls.push_back(FaviconURL(url, |
| 6506 ToFaviconType(icon_urls[i].iconType()))); | 6507 ToFaviconType(icon_urls[i].iconType()))); |
| 6507 } | 6508 } |
| 6508 SendUpdateFaviconURL(urls); | 6509 SendUpdateFaviconURL(urls); |
| 6509 } | 6510 } |
| 6510 | 6511 |
| 6511 | 6512 |
| 6512 } // namespace content | 6513 } // namespace content |
| OLD | NEW |