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" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 // static | 58 // static |
59 std::unique_ptr<NavigationHandleImpl> NavigationHandleImpl::Create( | 59 std::unique_ptr<NavigationHandleImpl> NavigationHandleImpl::Create( |
60 const GURL& url, | 60 const GURL& url, |
61 const std::vector<GURL>& redirect_chain, | 61 const std::vector<GURL>& redirect_chain, |
62 FrameTreeNode* frame_tree_node, | 62 FrameTreeNode* frame_tree_node, |
63 bool is_renderer_initiated, | 63 bool is_renderer_initiated, |
64 bool is_same_page, | 64 bool is_same_page, |
65 const base::TimeTicks& navigation_start, | 65 const base::TimeTicks& navigation_start, |
66 int pending_nav_entry_id, | 66 int pending_nav_entry_id, |
67 bool started_from_context_menu) { | 67 bool started_from_context_menu, |
| 68 CSPDisposition should_check_main_world_csp) { |
68 return std::unique_ptr<NavigationHandleImpl>(new NavigationHandleImpl( | 69 return std::unique_ptr<NavigationHandleImpl>(new NavigationHandleImpl( |
69 url, redirect_chain, frame_tree_node, is_renderer_initiated, is_same_page, | 70 url, redirect_chain, frame_tree_node, is_renderer_initiated, is_same_page, |
70 navigation_start, pending_nav_entry_id, | 71 navigation_start, pending_nav_entry_id, started_from_context_menu, |
71 started_from_context_menu)); | 72 should_check_main_world_csp)); |
72 } | 73 } |
73 | 74 |
74 NavigationHandleImpl::NavigationHandleImpl( | 75 NavigationHandleImpl::NavigationHandleImpl( |
75 const GURL& url, | 76 const GURL& url, |
76 const std::vector<GURL>& redirect_chain, | 77 const std::vector<GURL>& redirect_chain, |
77 FrameTreeNode* frame_tree_node, | 78 FrameTreeNode* frame_tree_node, |
78 bool is_renderer_initiated, | 79 bool is_renderer_initiated, |
79 bool is_same_page, | 80 bool is_same_page, |
80 const base::TimeTicks& navigation_start, | 81 const base::TimeTicks& navigation_start, |
81 int pending_nav_entry_id, | 82 int pending_nav_entry_id, |
82 bool started_from_context_menu) | 83 bool started_from_context_menu, |
| 84 CSPDisposition should_check_main_world_csp) |
83 : url_(url), | 85 : url_(url), |
84 has_user_gesture_(false), | 86 has_user_gesture_(false), |
85 transition_(ui::PAGE_TRANSITION_LINK), | 87 transition_(ui::PAGE_TRANSITION_LINK), |
86 is_external_protocol_(false), | 88 is_external_protocol_(false), |
87 net_error_code_(net::OK), | 89 net_error_code_(net::OK), |
88 render_frame_host_(nullptr), | 90 render_frame_host_(nullptr), |
89 is_renderer_initiated_(is_renderer_initiated), | 91 is_renderer_initiated_(is_renderer_initiated), |
90 is_same_page_(is_same_page), | 92 is_same_page_(is_same_page), |
91 was_redirected_(false), | 93 was_redirected_(false), |
92 did_replace_entry_(false), | 94 did_replace_entry_(false), |
(...skipping 10 matching lines...) Expand all Loading... |
103 request_context_type_(REQUEST_CONTEXT_TYPE_UNSPECIFIED), | 105 request_context_type_(REQUEST_CONTEXT_TYPE_UNSPECIFIED), |
104 mixed_content_context_type_(blink::WebMixedContentContextType::Blockable), | 106 mixed_content_context_type_(blink::WebMixedContentContextType::Blockable), |
105 should_replace_current_entry_(false), | 107 should_replace_current_entry_(false), |
106 redirect_chain_(redirect_chain), | 108 redirect_chain_(redirect_chain), |
107 is_download_(false), | 109 is_download_(false), |
108 is_stream_(false), | 110 is_stream_(false), |
109 started_from_context_menu_(started_from_context_menu), | 111 started_from_context_menu_(started_from_context_menu), |
110 reload_type_(ReloadType::NONE), | 112 reload_type_(ReloadType::NONE), |
111 restore_type_(RestoreType::NONE), | 113 restore_type_(RestoreType::NONE), |
112 navigation_type_(NAVIGATION_TYPE_UNKNOWN), | 114 navigation_type_(NAVIGATION_TYPE_UNKNOWN), |
| 115 should_check_main_world_csp_(should_check_main_world_csp), |
113 weak_factory_(this) { | 116 weak_factory_(this) { |
114 DCHECK(!navigation_start.is_null()); | 117 DCHECK(!navigation_start.is_null()); |
115 if (redirect_chain_.empty()) | 118 if (redirect_chain_.empty()) |
116 redirect_chain_.push_back(url); | 119 redirect_chain_.push_back(url); |
117 | 120 |
118 starting_site_instance_ = | 121 starting_site_instance_ = |
119 frame_tree_node_->current_frame_host()->GetSiteInstance(); | 122 frame_tree_node_->current_frame_host()->GetSiteInstance(); |
120 | 123 |
121 if (pending_nav_entry_id_) { | 124 if (pending_nav_entry_id_) { |
122 NavigationControllerImpl* nav_controller = | 125 NavigationControllerImpl* nav_controller = |
(...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
966 if (node->current_url().EqualsIgnoringRef(url_)) { | 969 if (node->current_url().EqualsIgnoringRef(url_)) { |
967 if (found_self_reference) | 970 if (found_self_reference) |
968 return true; | 971 return true; |
969 found_self_reference = true; | 972 found_self_reference = true; |
970 } | 973 } |
971 } | 974 } |
972 return false; | 975 return false; |
973 } | 976 } |
974 | 977 |
975 } // namespace content | 978 } // namespace content |
OLD | NEW |