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

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: Now using shared scheme collections from url_util.h. Created 3 years, 11 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 <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"
11 #include "content/browser/appcache/appcache_navigation_handle.h" 11 #include "content/browser/appcache/appcache_navigation_handle.h"
12 #include "content/browser/appcache/appcache_service_impl.h" 12 #include "content/browser/appcache/appcache_service_impl.h"
13 #include "content/browser/browsing_data/clear_site_data_throttle.h" 13 #include "content/browser/browsing_data/clear_site_data_throttle.h"
14 #include "content/browser/child_process_security_policy_impl.h" 14 #include "content/browser/child_process_security_policy_impl.h"
15 #include "content/browser/devtools/render_frame_devtools_agent_host.h" 15 #include "content/browser/devtools/render_frame_devtools_agent_host.h"
16 #include "content/browser/frame_host/ancestor_throttle.h" 16 #include "content/browser/frame_host/ancestor_throttle.h"
17 #include "content/browser/frame_host/debug_urls.h" 17 #include "content/browser/frame_host/debug_urls.h"
18 #include "content/browser/frame_host/frame_tree_node.h" 18 #include "content/browser/frame_host/frame_tree_node.h"
19 #include "content/browser/frame_host/mixed_content_navigation_throttle.h"
19 #include "content/browser/frame_host/navigator.h" 20 #include "content/browser/frame_host/navigator.h"
20 #include "content/browser/frame_host/navigator_delegate.h" 21 #include "content/browser/frame_host/navigator_delegate.h"
21 #include "content/browser/loader/resource_dispatcher_host_impl.h" 22 #include "content/browser/loader/resource_dispatcher_host_impl.h"
22 #include "content/browser/service_worker/service_worker_context_wrapper.h" 23 #include "content/browser/service_worker/service_worker_context_wrapper.h"
23 #include "content/browser/service_worker/service_worker_navigation_handle.h" 24 #include "content/browser/service_worker/service_worker_navigation_handle.h"
24 #include "content/common/frame_messages.h" 25 #include "content/common/frame_messages.h"
25 #include "content/common/resource_request_body_impl.h" 26 #include "content/common/resource_request_body_impl.h"
26 #include "content/common/site_isolation_policy.h" 27 #include "content/common/site_isolation_policy.h"
27 #include "content/public/browser/content_browser_client.h" 28 #include "content/public/browser/content_browser_client.h"
28 #include "content/public/browser/navigation_ui_data.h" 29 #include "content/public/browser/navigation_ui_data.h"
29 #include "content/public/browser/site_instance.h" 30 #include "content/public/browser/site_instance.h"
30 #include "content/public/common/browser_side_navigation_policy.h" 31 #include "content/public/common/browser_side_navigation_policy.h"
31 #include "content/public/common/content_client.h" 32 #include "content/public/common/content_client.h"
32 #include "content/public/common/url_constants.h" 33 #include "content/public/common/url_constants.h"
33 #include "net/base/net_errors.h" 34 #include "net/base/net_errors.h"
34 #include "net/url_request/redirect_info.h" 35 #include "net/url_request/redirect_info.h"
35 #include "third_party/WebKit/public/platform/WebMixedContentContextType.h"
36 #include "url/gurl.h" 36 #include "url/gurl.h"
37 #include "url/url_constants.h" 37 #include "url/url_constants.h"
38 38
39 namespace content { 39 namespace content {
40 40
41 namespace { 41 namespace {
42 42
43 void UpdateThrottleCheckResult( 43 void UpdateThrottleCheckResult(
44 NavigationThrottle::ThrottleCheckResult* to_update, 44 NavigationThrottle::ThrottleCheckResult* to_update,
45 NavigationThrottle::ThrottleCheckResult result) { 45 NavigationThrottle::ThrottleCheckResult result) {
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 // destruction. 785 // destruction.
786 } 786 }
787 787
788 void NavigationHandleImpl::RegisterNavigationThrottles() { 788 void NavigationHandleImpl::RegisterNavigationThrottles() {
789 // Register the navigation throttles. The vector returned by 789 // Register the navigation throttles. The vector returned by
790 // GetNavigationThrottles is not assigned to throttles_ directly because it 790 // GetNavigationThrottles is not assigned to throttles_ directly because it
791 // would overwrite any throttles previously added with 791 // would overwrite any throttles previously added with
792 // RegisterThrottleForTesting. 792 // RegisterThrottleForTesting.
793 std::vector<std::unique_ptr<NavigationThrottle>> throttles_to_register = 793 std::vector<std::unique_ptr<NavigationThrottle>> throttles_to_register =
794 GetDelegate()->CreateThrottlesForNavigation(this); 794 GetDelegate()->CreateThrottlesForNavigation(this);
795
796 std::unique_ptr<NavigationThrottle> mixed_content_throttle =
797 MixedContentNavigationThrottle::CreateThrottleForNavigation(this);
798 if (mixed_content_throttle)
799 throttles_to_register.push_back(std::move(mixed_content_throttle));
800
795 std::unique_ptr<NavigationThrottle> devtools_throttle = 801 std::unique_ptr<NavigationThrottle> devtools_throttle =
796 RenderFrameDevToolsAgentHost::CreateThrottleForNavigation(this); 802 RenderFrameDevToolsAgentHost::CreateThrottleForNavigation(this);
797 if (devtools_throttle) 803 if (devtools_throttle)
798 throttles_to_register.push_back(std::move(devtools_throttle)); 804 throttles_to_register.push_back(std::move(devtools_throttle));
799 805
800 std::unique_ptr<NavigationThrottle> clear_site_data_throttle = 806 std::unique_ptr<NavigationThrottle> clear_site_data_throttle =
801 ClearSiteDataThrottle::CreateThrottleForNavigation(this); 807 ClearSiteDataThrottle::CreateThrottleForNavigation(this);
802 if (clear_site_data_throttle) 808 if (clear_site_data_throttle)
803 throttles_to_register.push_back(std::move(clear_site_data_throttle)); 809 throttles_to_register.push_back(std::move(clear_site_data_throttle));
804 810
805 std::unique_ptr<content::NavigationThrottle> ancestor_throttle = 811 std::unique_ptr<content::NavigationThrottle> ancestor_throttle =
806 content::AncestorThrottle::MaybeCreateThrottleFor(this); 812 content::AncestorThrottle::MaybeCreateThrottleFor(this);
807 if (ancestor_throttle) 813 if (ancestor_throttle)
808 throttles_.push_back(std::move(ancestor_throttle)); 814 throttles_.push_back(std::move(ancestor_throttle));
809 815
810 throttles_.insert(throttles_.begin(), 816 throttles_.insert(throttles_.begin(),
811 std::make_move_iterator(throttles_to_register.begin()), 817 std::make_move_iterator(throttles_to_register.begin()),
812 std::make_move_iterator(throttles_to_register.end())); 818 std::make_move_iterator(throttles_to_register.end()));
813 } 819 }
814 820
815 } // namespace content 821 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698