| 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/debug/dump_without_crashing.h" | 9 #include "base/debug/dump_without_crashing.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 814 } | 814 } |
| 815 | 815 |
| 816 void NavigationHandleImpl::RegisterNavigationThrottles() { | 816 void NavigationHandleImpl::RegisterNavigationThrottles() { |
| 817 // Register the navigation throttles. The vector returned by | 817 // Register the navigation throttles. The vector returned by |
| 818 // GetNavigationThrottles is not assigned to throttles_ directly because it | 818 // GetNavigationThrottles is not assigned to throttles_ directly because it |
| 819 // would overwrite any throttles previously added with | 819 // would overwrite any throttles previously added with |
| 820 // RegisterThrottleForTesting. | 820 // RegisterThrottleForTesting. |
| 821 std::vector<std::unique_ptr<NavigationThrottle>> throttles_to_register = | 821 std::vector<std::unique_ptr<NavigationThrottle>> throttles_to_register = |
| 822 GetDelegate()->CreateThrottlesForNavigation(this); | 822 GetDelegate()->CreateThrottlesForNavigation(this); |
| 823 | 823 |
| 824 std::unique_ptr<NavigationThrottle> mixed_content_throttle = | |
| 825 MixedContentNavigationThrottle::CreateThrottleForNavigation(this); | |
| 826 if (mixed_content_throttle) | |
| 827 throttles_to_register.push_back(std::move(mixed_content_throttle)); | |
| 828 | |
| 829 std::unique_ptr<NavigationThrottle> devtools_throttle = | 824 std::unique_ptr<NavigationThrottle> devtools_throttle = |
| 830 RenderFrameDevToolsAgentHost::CreateThrottleForNavigation(this); | 825 RenderFrameDevToolsAgentHost::CreateThrottleForNavigation(this); |
| 831 if (devtools_throttle) | 826 if (devtools_throttle) |
| 832 throttles_to_register.push_back(std::move(devtools_throttle)); | 827 throttles_to_register.push_back(std::move(devtools_throttle)); |
| 833 | 828 |
| 834 std::unique_ptr<NavigationThrottle> clear_site_data_throttle = | 829 std::unique_ptr<NavigationThrottle> clear_site_data_throttle = |
| 835 ClearSiteDataThrottle::CreateThrottleForNavigation(this); | 830 ClearSiteDataThrottle::CreateThrottleForNavigation(this); |
| 836 if (clear_site_data_throttle) | 831 if (clear_site_data_throttle) |
| 837 throttles_to_register.push_back(std::move(clear_site_data_throttle)); | 832 throttles_to_register.push_back(std::move(clear_site_data_throttle)); |
| 838 | 833 |
| 839 std::unique_ptr<content::NavigationThrottle> ancestor_throttle = | 834 std::unique_ptr<content::NavigationThrottle> ancestor_throttle = |
| 840 content::AncestorThrottle::MaybeCreateThrottleFor(this); | 835 content::AncestorThrottle::MaybeCreateThrottleFor(this); |
| 841 if (ancestor_throttle) | 836 if (ancestor_throttle) |
| 842 throttles_.push_back(std::move(ancestor_throttle)); | 837 throttles_.push_back(std::move(ancestor_throttle)); |
| 843 | 838 |
| 839 std::unique_ptr<NavigationThrottle> mixed_content_throttle = |
| 840 MixedContentNavigationThrottle::CreateThrottleForNavigation(this); |
| 841 if (mixed_content_throttle) |
| 842 throttles_to_register.push_back(std::move(mixed_content_throttle)); |
| 843 |
| 844 throttles_.insert(throttles_.begin(), | 844 throttles_.insert(throttles_.begin(), |
| 845 std::make_move_iterator(throttles_to_register.begin()), | 845 std::make_move_iterator(throttles_to_register.begin()), |
| 846 std::make_move_iterator(throttles_to_register.end())); | 846 std::make_move_iterator(throttles_to_register.end())); |
| 847 } | 847 } |
| 848 | 848 |
| 849 } // namespace content | 849 } // namespace content |
| OLD | NEW |