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_COMMON_NAVIGATION_PARAMS_H_ | 5 #ifndef CONTENT_COMMON_NAVIGATION_PARAMS_H_ |
| 6 #define CONTENT_COMMON_NAVIGATION_PARAMS_H_ | 6 #define CONTENT_COMMON_NAVIGATION_PARAMS_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 52 const Referrer& referrer, | 52 const Referrer& referrer, |
| 53 ui::PageTransition transition, | 53 ui::PageTransition transition, |
| 54 FrameMsg_Navigate_Type::Value navigation_type, | 54 FrameMsg_Navigate_Type::Value navigation_type, |
| 55 bool allow_download, | 55 bool allow_download, |
| 56 bool should_replace_current_entry, | 56 bool should_replace_current_entry, |
| 57 base::TimeTicks ui_timestamp, | 57 base::TimeTicks ui_timestamp, |
| 58 FrameMsg_UILoadMetricsReportType::Value report_type, | 58 FrameMsg_UILoadMetricsReportType::Value report_type, |
| 59 const GURL& base_url_for_data_url, | 59 const GURL& base_url_for_data_url, |
| 60 const GURL& history_url_for_data_url, | 60 const GURL& history_url_for_data_url, |
| 61 LoFiState lofi_state, | 61 LoFiState lofi_state, |
| 62 const base::TimeTicks& navigation_start); | 62 const base::TimeTicks& navigation_start, |
| 63 bool is_post); | |
|
Charlie Reis
2016/02/17 05:55:28
I would think that moving this to CommonNavParams
clamy
2016/02/17 12:39:39
It is used both at request time in the browser, an
Charlie Reis
2016/02/17 21:52:06
Ah, I'm missing the second part. Where do we use
clamy
2016/02/22 12:48:36
Yes it seems the comment above CommonNavParams is
Charlie Reis
2016/02/27 00:21:49
It's fine if this isn't used at commit time, but t
clamy
2016/02/29 10:54:02
That's indeed the case.
| |
| 63 ~CommonNavigationParams(); | 64 ~CommonNavigationParams(); |
| 64 | 65 |
| 65 // The URL to navigate to. | 66 // The URL to navigate to. |
| 66 // PlzNavigate: May be modified when the navigation is ready to commit. | 67 // PlzNavigate: May be modified when the navigation is ready to commit. |
| 67 GURL url; | 68 GURL url; |
| 68 | 69 |
| 69 // The URL to send in the "Referer" header field. Can be empty if there is | 70 // The URL to send in the "Referer" header field. Can be empty if there is |
| 70 // no referrer. | 71 // no referrer. |
| 71 Referrer referrer; | 72 Referrer referrer; |
| 72 | 73 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 106 // Whether or not to request a LoFi version of the document or let the browser | 107 // Whether or not to request a LoFi version of the document or let the browser |
| 107 // decide. | 108 // decide. |
| 108 LoFiState lofi_state; | 109 LoFiState lofi_state; |
| 109 | 110 |
| 110 // The navigationStart time exposed through the Navigation Timing API to JS. | 111 // The navigationStart time exposed through the Navigation Timing API to JS. |
| 111 // If this is for a browser-initiated navigation, this can override the | 112 // If this is for a browser-initiated navigation, this can override the |
| 112 // navigation_start value in Blink. | 113 // navigation_start value in Blink. |
| 113 // PlzNavigate: For renderer initiated navigations, this will be set on the | 114 // PlzNavigate: For renderer initiated navigations, this will be set on the |
| 114 // renderer side and sent with FrameHostMsg_BeginNavigation. | 115 // renderer side and sent with FrameHostMsg_BeginNavigation. |
| 115 base::TimeTicks navigation_start; | 116 base::TimeTicks navigation_start; |
| 117 | |
| 118 // Whether the navigation is a POST request (as opposed to a GET). | |
| 119 bool is_post; | |
| 116 }; | 120 }; |
| 117 | 121 |
| 118 // Provided by the renderer ---------------------------------------------------- | 122 // Provided by the renderer ---------------------------------------------------- |
| 119 // | 123 // |
| 120 // This struct holds parameters sent by the renderer to the browser. It is only | 124 // This struct holds parameters sent by the renderer to the browser. It is only |
| 121 // used in PlzNavigate (since in the current architecture, the renderer does not | 125 // used in PlzNavigate (since in the current architecture, the renderer does not |
| 122 // inform the browser of navigations until they commit). | 126 // inform the browser of navigations until they commit). |
| 123 | 127 |
| 124 // This struct is not used outside of the PlzNavigate project. | 128 // This struct is not used outside of the PlzNavigate project. |
| 125 // PlzNavigate: parameters needed to start a navigation on the IO thread, | 129 // PlzNavigate: parameters needed to start a navigation on the IO thread, |
| 126 // following a renderer-initiated navigation request. | 130 // following a renderer-initiated navigation request. |
| 127 struct CONTENT_EXPORT BeginNavigationParams { | 131 struct CONTENT_EXPORT BeginNavigationParams { |
| 128 // TODO(clamy): See if it is possible to reuse this in | 132 // TODO(clamy): See if it is possible to reuse this in |
| 129 // ResourceMsg_Request_Params. | 133 // ResourceMsg_Request_Params. |
| 130 BeginNavigationParams(); | 134 BeginNavigationParams(); |
| 131 BeginNavigationParams(std::string method, | 135 BeginNavigationParams(std::string headers, |
| 132 std::string headers, | |
| 133 int load_flags, | 136 int load_flags, |
| 134 bool has_user_gesture, | 137 bool has_user_gesture, |
| 135 bool skip_service_worker, | 138 bool skip_service_worker, |
| 136 RequestContextType request_context_type); | 139 RequestContextType request_context_type); |
| 137 | 140 |
| 138 // The request method: GET, POST, etc. | |
|
Charlie Reis
2016/02/17 05:55:28
Again, I wonder about whether the "etc" was intent
clamy
2016/02/17 12:39:39
Changed the boolean to a string.
| |
| 139 std::string method; | |
| 140 | |
| 141 // Additional HTTP request headers. | 141 // Additional HTTP request headers. |
| 142 std::string headers; | 142 std::string headers; |
| 143 | 143 |
| 144 // net::URLRequest load flags (net::LOAD_NORMAL) by default). | 144 // net::URLRequest load flags (net::LOAD_NORMAL) by default). |
| 145 int load_flags; | 145 int load_flags; |
| 146 | 146 |
| 147 // True if the request was user initiated. | 147 // True if the request was user initiated. |
| 148 bool has_user_gesture; | 148 bool has_user_gesture; |
| 149 | 149 |
| 150 // True if the ServiceWorker should be skipped. | 150 // True if the ServiceWorker should be skipped. |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 164 | 164 |
| 165 // Used by FrameMsg_Navigate. Holds the parameters needed by the renderer to | 165 // Used by FrameMsg_Navigate. Holds the parameters needed by the renderer to |
| 166 // start a browser-initiated navigation besides those in CommonNavigationParams. | 166 // start a browser-initiated navigation besides those in CommonNavigationParams. |
| 167 // The difference with the RequestNavigationParams below is that they are only | 167 // The difference with the RequestNavigationParams below is that they are only |
| 168 // used in the current architecture of navigation, and will not be used by | 168 // used in the current architecture of navigation, and will not be used by |
| 169 // PlzNavigate. | 169 // PlzNavigate. |
| 170 // PlzNavigate: These are not used. | 170 // PlzNavigate: These are not used. |
| 171 struct CONTENT_EXPORT StartNavigationParams { | 171 struct CONTENT_EXPORT StartNavigationParams { |
| 172 StartNavigationParams(); | 172 StartNavigationParams(); |
| 173 StartNavigationParams( | 173 StartNavigationParams( |
| 174 bool is_post, | |
| 175 const std::string& extra_headers, | 174 const std::string& extra_headers, |
| 176 const std::vector<unsigned char>& browser_initiated_post_data, | 175 const std::vector<unsigned char>& browser_initiated_post_data, |
| 177 #if defined(OS_ANDROID) | 176 #if defined(OS_ANDROID) |
| 178 bool has_user_gesture, | 177 bool has_user_gesture, |
| 179 #endif | 178 #endif |
| 180 int transferred_request_child_id, | 179 int transferred_request_child_id, |
| 181 int transferred_request_request_id); | 180 int transferred_request_request_id); |
| 182 ~StartNavigationParams(); | 181 ~StartNavigationParams(); |
| 183 | 182 |
| 184 // Whether the navigation is a POST request (as opposed to a GET). | |
| 185 bool is_post; | |
| 186 | |
| 187 // Extra headers (separated by \n) to send during the request. | 183 // Extra headers (separated by \n) to send during the request. |
| 188 std::string extra_headers; | 184 std::string extra_headers; |
| 189 | 185 |
| 190 // If is_post is true, holds the post_data information from browser. Empty | 186 // If is_post is true, holds the post_data information from browser. Empty |
| 191 // otherwise. | 187 // otherwise. |
| 192 std::vector<unsigned char> browser_initiated_post_data; | 188 std::vector<unsigned char> browser_initiated_post_data; |
| 193 | 189 |
| 194 #if defined(OS_ANDROID) | 190 #if defined(OS_ANDROID) |
| 195 bool has_user_gesture; | 191 bool has_user_gesture; |
| 196 #endif | 192 #endif |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 322 ~NavigationParams(); | 318 ~NavigationParams(); |
| 323 | 319 |
| 324 CommonNavigationParams common_params; | 320 CommonNavigationParams common_params; |
| 325 StartNavigationParams start_params; | 321 StartNavigationParams start_params; |
| 326 RequestNavigationParams request_params; | 322 RequestNavigationParams request_params; |
| 327 }; | 323 }; |
| 328 | 324 |
| 329 } // namespace content | 325 } // namespace content |
| 330 | 326 |
| 331 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ | 327 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ |
| OLD | NEW |