Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_ |
| 6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 89 // should no longer be manipulated afterwards on the UI thread. | 89 // should no longer be manipulated afterwards on the UI thread. |
| 90 // TODO(clamy): see if ResourceRequestBody could be un-refcounted to avoid | 90 // TODO(clamy): see if ResourceRequestBody could be un-refcounted to avoid |
| 91 // threading subtleties. | 91 // threading subtleties. |
| 92 static std::unique_ptr<NavigationRequest> CreateRendererInitiated( | 92 static std::unique_ptr<NavigationRequest> CreateRendererInitiated( |
| 93 FrameTreeNode* frame_tree_node, | 93 FrameTreeNode* frame_tree_node, |
| 94 const CommonNavigationParams& common_params, | 94 const CommonNavigationParams& common_params, |
| 95 const BeginNavigationParams& begin_params, | 95 const BeginNavigationParams& begin_params, |
| 96 int current_history_list_offset, | 96 int current_history_list_offset, |
| 97 int current_history_list_length); | 97 int current_history_list_length); |
| 98 | 98 |
| 99 // Creates a request for a renderer-intiated history navigation. Currently | |
| 100 // only invoked for history navigations for child frames. | |
| 101 // |is_history_navigation_in_new_child| should always be true. | |
| 102 static std::unique_ptr<NavigationRequest> | |
| 103 CreateRendererInitiatedHistoryNavigation( | |
|
clamy
2017/02/15 16:27:55
I don't think creating a new way to create a Navig
ananta
2017/02/15 23:45:02
Done. I added a is_user_action parameter to this f
| |
| 104 FrameTreeNode* frame_tree_node, | |
| 105 const GURL& dest_url, | |
| 106 const Referrer& dest_referrer, | |
| 107 const FrameNavigationEntry& frame_entry, | |
| 108 const NavigationEntryImpl& entry, | |
| 109 FrameMsg_Navigate_Type::Value navigation_type, | |
| 110 PreviewsState previews_state, | |
| 111 bool is_history_navigation_in_new_child, | |
| 112 bool has_user_gesture, | |
| 113 const base::TimeTicks& navigation_start, | |
| 114 NavigationControllerImpl* controller); | |
| 115 | |
| 99 ~NavigationRequest() override; | 116 ~NavigationRequest() override; |
| 100 | 117 |
| 101 // Called on the UI thread by the Navigator to start the navigation. | 118 // Called on the UI thread by the Navigator to start the navigation. |
| 102 void BeginNavigation(); | 119 void BeginNavigation(); |
| 103 | 120 |
| 104 const CommonNavigationParams& common_params() const { return common_params_; } | 121 const CommonNavigationParams& common_params() const { return common_params_; } |
| 105 | 122 |
| 106 const BeginNavigationParams& begin_params() const { return begin_params_; } | 123 const BeginNavigationParams& begin_params() const { return begin_params_; } |
| 107 | 124 |
| 108 const RequestNavigationParams& request_params() const { | 125 const RequestNavigationParams& request_params() const { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 160 // destroyed when a navigation is ready for commit. | 177 // destroyed when a navigation is ready for commit. |
| 161 void TransferNavigationHandleOwnership( | 178 void TransferNavigationHandleOwnership( |
| 162 RenderFrameHostImpl* render_frame_host); | 179 RenderFrameHostImpl* render_frame_host); |
| 163 | 180 |
| 164 void set_on_start_checks_complete_closure_for_testing( | 181 void set_on_start_checks_complete_closure_for_testing( |
| 165 const base::Closure& closure) { | 182 const base::Closure& closure) { |
| 166 on_start_checks_complete_closure_ = closure; | 183 on_start_checks_complete_closure_ = closure; |
| 167 } | 184 } |
| 168 | 185 |
| 169 private: | 186 private: |
| 187 // Helper function to create a navigation request. | |
| 188 static std::unique_ptr<NavigationRequest> CreateNavigationHelper( | |
| 189 FrameTreeNode* frame_tree_node, | |
| 190 const GURL& dest_url, | |
| 191 const Referrer& dest_referrer, | |
| 192 const FrameNavigationEntry& frame_entry, | |
| 193 const NavigationEntryImpl& entry, | |
| 194 FrameMsg_Navigate_Type::Value navigation_type, | |
| 195 PreviewsState previews_state, | |
| 196 bool is_history_navigation_in_new_child, | |
| 197 bool has_user_gesture, | |
| 198 bool browser_initiated, | |
| 199 const base::TimeTicks& navigation_start, | |
| 200 NavigationControllerImpl* controller); | |
| 201 | |
| 170 NavigationRequest(FrameTreeNode* frame_tree_node, | 202 NavigationRequest(FrameTreeNode* frame_tree_node, |
| 171 const CommonNavigationParams& common_params, | 203 const CommonNavigationParams& common_params, |
| 172 const BeginNavigationParams& begin_params, | 204 const BeginNavigationParams& begin_params, |
| 173 const RequestNavigationParams& request_params, | 205 const RequestNavigationParams& request_params, |
| 174 bool browser_initiated, | 206 bool browser_initiated, |
| 175 bool may_transfer, | 207 bool may_transfer, |
| 176 const FrameNavigationEntry* frame_navigation_entry, | 208 const FrameNavigationEntry* frame_navigation_entry, |
| 177 const NavigationEntryImpl* navitation_entry); | 209 const NavigationEntryImpl* navitation_entry); |
| 178 | 210 |
| 179 // NavigationURLLoaderDelegate implementation. | 211 // NavigationURLLoaderDelegate implementation. |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 254 std::unique_ptr<StreamHandle> body_; | 286 std::unique_ptr<StreamHandle> body_; |
| 255 | 287 |
| 256 base::Closure on_start_checks_complete_closure_; | 288 base::Closure on_start_checks_complete_closure_; |
| 257 | 289 |
| 258 DISALLOW_COPY_AND_ASSIGN(NavigationRequest); | 290 DISALLOW_COPY_AND_ASSIGN(NavigationRequest); |
| 259 }; | 291 }; |
| 260 | 292 |
| 261 } // namespace content | 293 } // namespace content |
| 262 | 294 |
| 263 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_ | 295 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_ |
| OLD | NEW |