Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Side by Side Diff: content/browser/frame_host/navigation_handle_impl.cc

Issue 1905033002: PlzNavigate: Move navigation-level mixed content checks to the browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@console-security-message
Patch Set: Rebase after 3 spin off CLs landed. Created 3 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/debug/dump_without_crashing.h" 7 #include "base/debug/dump_without_crashing.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "content/browser/appcache/appcache_navigation_handle.h" 9 #include "content/browser/appcache/appcache_navigation_handle.h"
10 #include "content/browser/appcache/appcache_service_impl.h" 10 #include "content/browser/appcache/appcache_service_impl.h"
11 #include "content/browser/browsing_data/clear_site_data_throttle.h" 11 #include "content/browser/browsing_data/clear_site_data_throttle.h"
12 #include "content/browser/child_process_security_policy_impl.h" 12 #include "content/browser/child_process_security_policy_impl.h"
13 #include "content/browser/devtools/render_frame_devtools_agent_host.h" 13 #include "content/browser/devtools/render_frame_devtools_agent_host.h"
14 #include "content/browser/frame_host/debug_urls.h" 14 #include "content/browser/frame_host/debug_urls.h"
15 #include "content/browser/frame_host/frame_tree_node.h" 15 #include "content/browser/frame_host/frame_tree_node.h"
16 #include "content/browser/frame_host/mixed_content_navigation_throttle.h"
16 #include "content/browser/frame_host/navigator.h" 17 #include "content/browser/frame_host/navigator.h"
17 #include "content/browser/frame_host/navigator_delegate.h" 18 #include "content/browser/frame_host/navigator_delegate.h"
18 #include "content/browser/loader/resource_dispatcher_host_impl.h" 19 #include "content/browser/loader/resource_dispatcher_host_impl.h"
19 #include "content/browser/service_worker/service_worker_context_wrapper.h" 20 #include "content/browser/service_worker/service_worker_context_wrapper.h"
20 #include "content/browser/service_worker/service_worker_navigation_handle.h" 21 #include "content/browser/service_worker/service_worker_navigation_handle.h"
21 #include "content/common/frame_messages.h" 22 #include "content/common/frame_messages.h"
22 #include "content/common/resource_request_body_impl.h" 23 #include "content/common/resource_request_body_impl.h"
23 #include "content/common/site_isolation_policy.h" 24 #include "content/common/site_isolation_policy.h"
24 #include "content/public/browser/content_browser_client.h" 25 #include "content/public/browser/content_browser_client.h"
25 #include "content/public/browser/navigation_ui_data.h" 26 #include "content/public/browser/navigation_ui_data.h"
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 762
762 // No code after running the callback, as it might have resulted in our 763 // No code after running the callback, as it might have resulted in our
763 // destruction. 764 // destruction.
764 } 765 }
765 766
766 void NavigationHandleImpl::RegisterNavigationThrottles() { 767 void NavigationHandleImpl::RegisterNavigationThrottles() {
767 // Register the navigation throttles. The ScopedVector returned by 768 // Register the navigation throttles. The ScopedVector returned by
768 // GetNavigationThrottles is not assigned to throttles_ directly because it 769 // GetNavigationThrottles is not assigned to throttles_ directly because it
769 // would overwrite any throttle previously added with 770 // would overwrite any throttle previously added with
770 // RegisterThrottleForTesting. 771 // RegisterThrottleForTesting.
772 if (IsBrowserSideNavigationEnabled()) {
773 throttles_.insert(throttles_.end(),
774 new MixedContentNavigationThrottle(this));
775 }
771 ScopedVector<NavigationThrottle> throttles_to_register = 776 ScopedVector<NavigationThrottle> throttles_to_register =
772 GetDelegate()->CreateThrottlesForNavigation(this); 777 GetDelegate()->CreateThrottlesForNavigation(this);
773 std::unique_ptr<NavigationThrottle> devtools_throttle = 778 std::unique_ptr<NavigationThrottle> devtools_throttle =
774 RenderFrameDevToolsAgentHost::CreateThrottleForNavigation(this); 779 RenderFrameDevToolsAgentHost::CreateThrottleForNavigation(this);
775 if (devtools_throttle) 780 if (devtools_throttle)
776 throttles_to_register.push_back(std::move(devtools_throttle)); 781 throttles_to_register.push_back(std::move(devtools_throttle));
777 782
778 std::unique_ptr<NavigationThrottle> clear_site_data_throttle = 783 std::unique_ptr<NavigationThrottle> clear_site_data_throttle =
779 ClearSiteDataThrottle::CreateThrottleForNavigation(this); 784 ClearSiteDataThrottle::CreateThrottleForNavigation(this);
780 if (clear_site_data_throttle) 785 if (clear_site_data_throttle)
781 throttles_to_register.push_back(std::move(clear_site_data_throttle)); 786 throttles_to_register.push_back(std::move(clear_site_data_throttle));
782 787
783 if (throttles_to_register.size() > 0) { 788 if (throttles_to_register.size() > 0) {
784 throttles_.insert(throttles_.begin(), throttles_to_register.begin(), 789 throttles_.insert(throttles_.begin(), throttles_to_register.begin(),
785 throttles_to_register.end()); 790 throttles_to_register.end());
786 throttles_to_register.weak_clear(); 791 throttles_to_register.weak_clear();
787 } 792 }
788 } 793 }
789 794
790 } // namespace content 795 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698