| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/frame_host/navigation_handle_impl.h" | 5 #include "content/browser/frame_host/navigation_handle_impl.h" |
| 6 | 6 |
| 7 #include <iterator> | 7 #include <iterator> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "content/browser/appcache/appcache_navigation_handle.h" | 10 #include "content/browser/appcache/appcache_navigation_handle.h" |
| 11 #include "content/browser/appcache/appcache_service_impl.h" | 11 #include "content/browser/appcache/appcache_service_impl.h" |
| 12 #include "content/browser/browsing_data/clear_site_data_throttle.h" | |
| 13 #include "content/browser/child_process_security_policy_impl.h" | 12 #include "content/browser/child_process_security_policy_impl.h" |
| 14 #include "content/browser/devtools/render_frame_devtools_agent_host.h" | 13 #include "content/browser/devtools/render_frame_devtools_agent_host.h" |
| 15 #include "content/browser/frame_host/ancestor_throttle.h" | 14 #include "content/browser/frame_host/ancestor_throttle.h" |
| 16 #include "content/browser/frame_host/data_url_navigation_throttle.h" | 15 #include "content/browser/frame_host/data_url_navigation_throttle.h" |
| 17 #include "content/browser/frame_host/debug_urls.h" | 16 #include "content/browser/frame_host/debug_urls.h" |
| 18 #include "content/browser/frame_host/form_submission_throttle.h" | 17 #include "content/browser/frame_host/form_submission_throttle.h" |
| 19 #include "content/browser/frame_host/frame_tree_node.h" | 18 #include "content/browser/frame_host/frame_tree_node.h" |
| 20 #include "content/browser/frame_host/mixed_content_navigation_throttle.h" | 19 #include "content/browser/frame_host/mixed_content_navigation_throttle.h" |
| 21 #include "content/browser/frame_host/navigation_controller_impl.h" | 20 #include "content/browser/frame_host/navigation_controller_impl.h" |
| 22 #include "content/browser/frame_host/navigation_entry_impl.h" | 21 #include "content/browser/frame_host/navigation_entry_impl.h" |
| (...skipping 982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1005 std::unique_ptr<NavigationThrottle> mixed_content_throttle = | 1004 std::unique_ptr<NavigationThrottle> mixed_content_throttle = |
| 1006 MixedContentNavigationThrottle::CreateThrottleForNavigation(this); | 1005 MixedContentNavigationThrottle::CreateThrottleForNavigation(this); |
| 1007 if (mixed_content_throttle) | 1006 if (mixed_content_throttle) |
| 1008 throttles_to_register.push_back(std::move(mixed_content_throttle)); | 1007 throttles_to_register.push_back(std::move(mixed_content_throttle)); |
| 1009 | 1008 |
| 1010 std::unique_ptr<NavigationThrottle> devtools_throttle = | 1009 std::unique_ptr<NavigationThrottle> devtools_throttle = |
| 1011 RenderFrameDevToolsAgentHost::CreateThrottleForNavigation(this); | 1010 RenderFrameDevToolsAgentHost::CreateThrottleForNavigation(this); |
| 1012 if (devtools_throttle) | 1011 if (devtools_throttle) |
| 1013 throttles_to_register.push_back(std::move(devtools_throttle)); | 1012 throttles_to_register.push_back(std::move(devtools_throttle)); |
| 1014 | 1013 |
| 1015 std::unique_ptr<NavigationThrottle> clear_site_data_throttle = | |
| 1016 ClearSiteDataThrottle::CreateThrottleForNavigation(this); | |
| 1017 if (clear_site_data_throttle) | |
| 1018 throttles_to_register.push_back(std::move(clear_site_data_throttle)); | |
| 1019 | |
| 1020 throttles_.insert(throttles_.begin(), | 1014 throttles_.insert(throttles_.begin(), |
| 1021 std::make_move_iterator(throttles_to_register.begin()), | 1015 std::make_move_iterator(throttles_to_register.begin()), |
| 1022 std::make_move_iterator(throttles_to_register.end())); | 1016 std::make_move_iterator(throttles_to_register.end())); |
| 1023 } | 1017 } |
| 1024 | 1018 |
| 1025 bool NavigationHandleImpl::IsSelfReferentialURL() { | 1019 bool NavigationHandleImpl::IsSelfReferentialURL() { |
| 1026 // about: URLs should be exempted since they are reserved for other purposes | 1020 // about: URLs should be exempted since they are reserved for other purposes |
| 1027 // and cannot be the source of infinite recursion. See | 1021 // and cannot be the source of infinite recursion. See |
| 1028 // https://crbug.com/341858 . | 1022 // https://crbug.com/341858 . |
| 1029 if (url_.SchemeIs("about")) | 1023 if (url_.SchemeIs("about")) |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1047 if (node->current_url().EqualsIgnoringRef(url_)) { | 1041 if (node->current_url().EqualsIgnoringRef(url_)) { |
| 1048 if (found_self_reference) | 1042 if (found_self_reference) |
| 1049 return true; | 1043 return true; |
| 1050 found_self_reference = true; | 1044 found_self_reference = true; |
| 1051 } | 1045 } |
| 1052 } | 1046 } |
| 1053 return false; | 1047 return false; |
| 1054 } | 1048 } |
| 1055 | 1049 |
| 1056 } // namespace content | 1050 } // namespace content |
| OLD | NEW |