| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
| 12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 13 #include "content/common/frame_message_enums.h" | 13 #include "content/common/frame_message_enums.h" |
| 14 #include "content/public/common/page_state.h" | 14 #include "content/public/common/page_state.h" |
| 15 #include "content/public/common/referrer.h" | 15 #include "content/public/common/referrer.h" |
| 16 #include "content/public/common/request_context_type.h" |
| 16 #include "ui/base/page_transition_types.h" | 17 #include "ui/base/page_transition_types.h" |
| 17 #include "url/gurl.h" | 18 #include "url/gurl.h" |
| 18 | 19 |
| 19 namespace base { | 20 namespace base { |
| 20 class RefCountedMemory; | 21 class RefCountedMemory; |
| 21 } | 22 } |
| 22 | 23 |
| 23 namespace content { | 24 namespace content { |
| 24 | 25 |
| 25 // PlzNavigate | 26 // PlzNavigate |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 // This struct is not used outside of the PlzNavigate project. | 101 // This struct is not used outside of the PlzNavigate project. |
| 101 // PlzNavigate: parameters needed to start a navigation on the IO thread, | 102 // PlzNavigate: parameters needed to start a navigation on the IO thread, |
| 102 // following a renderer-initiated navigation request. | 103 // following a renderer-initiated navigation request. |
| 103 struct CONTENT_EXPORT BeginNavigationParams { | 104 struct CONTENT_EXPORT BeginNavigationParams { |
| 104 // TODO(clamy): See if it is possible to reuse this in | 105 // TODO(clamy): See if it is possible to reuse this in |
| 105 // ResourceMsg_Request_Params. | 106 // ResourceMsg_Request_Params. |
| 106 BeginNavigationParams(); | 107 BeginNavigationParams(); |
| 107 BeginNavigationParams(std::string method, | 108 BeginNavigationParams(std::string method, |
| 108 std::string headers, | 109 std::string headers, |
| 109 int load_flags, | 110 int load_flags, |
| 110 bool has_user_gesture); | 111 bool has_user_gesture, |
| 112 bool skip_service_worker, |
| 113 RequestContextType request_context_type); |
| 111 | 114 |
| 112 // The request method: GET, POST, etc. | 115 // The request method: GET, POST, etc. |
| 113 std::string method; | 116 std::string method; |
| 114 | 117 |
| 115 // Additional HTTP request headers. | 118 // Additional HTTP request headers. |
| 116 std::string headers; | 119 std::string headers; |
| 117 | 120 |
| 118 // net::URLRequest load flags (net::LOAD_NORMAL) by default). | 121 // net::URLRequest load flags (net::LOAD_NORMAL) by default). |
| 119 int load_flags; | 122 int load_flags; |
| 120 | 123 |
| 121 // True if the request was user initiated. | 124 // True if the request was user initiated. |
| 122 bool has_user_gesture; | 125 bool has_user_gesture; |
| 126 |
| 127 // True if the ServiceWorker should be skipped. |
| 128 bool skip_service_worker; |
| 129 |
| 130 // Indicates the request context type. |
| 131 RequestContextType request_context_type; |
| 123 }; | 132 }; |
| 124 | 133 |
| 125 // Provided by the browser ----------------------------------------------------- | 134 // Provided by the browser ----------------------------------------------------- |
| 126 // | 135 // |
| 127 // These structs are sent by the browser to the renderer to start/commit a | 136 // These structs are sent by the browser to the renderer to start/commit a |
| 128 // navigation depending on whether browser-side navigation is enabled. | 137 // navigation depending on whether browser-side navigation is enabled. |
| 129 // Parameters used both in the current architecture and PlzNavigate should be | 138 // Parameters used both in the current architecture and PlzNavigate should be |
| 130 // put in RequestNavigationParams. Parameters only used by the current | 139 // put in RequestNavigationParams. Parameters only used by the current |
| 131 // architecture should go in StartNavigationParams. | 140 // architecture should go in StartNavigationParams. |
| 132 | 141 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 | 259 |
| 251 // Where its current page contents reside in session history and the total | 260 // Where its current page contents reside in session history and the total |
| 252 // size of the session history list. | 261 // size of the session history list. |
| 253 int current_history_list_offset; | 262 int current_history_list_offset; |
| 254 int current_history_list_length; | 263 int current_history_list_length; |
| 255 | 264 |
| 256 // Whether session history should be cleared. In that case, the RenderView | 265 // Whether session history should be cleared. In that case, the RenderView |
| 257 // needs to notify the browser that the clearing was succesful when the | 266 // needs to notify the browser that the clearing was succesful when the |
| 258 // navigation commits. | 267 // navigation commits. |
| 259 bool should_clear_history_list; | 268 bool should_clear_history_list; |
| 269 |
| 270 // PlzNavigate |
| 271 // The ServiceWorkerProviderHost ID used for navigations. |
| 272 // Set to kInvalidServiceWorkerProviderId for sandboxed frames and sync loads. |
| 273 // This parameter is not used in the current navigation architecture, where it |
| 274 // will always be equal to kInvalidServiceWorkerProviderId. |
| 275 int service_worker_provider_id; |
| 260 }; | 276 }; |
| 261 | 277 |
| 262 // Helper struct keeping track in one place of all the parameters the browser | 278 // Helper struct keeping track in one place of all the parameters the browser |
| 263 // needs to provide to the renderer. | 279 // needs to provide to the renderer. |
| 264 struct NavigationParams { | 280 struct NavigationParams { |
| 265 NavigationParams(const CommonNavigationParams& common_params, | 281 NavigationParams(const CommonNavigationParams& common_params, |
| 266 const StartNavigationParams& start_params, | 282 const StartNavigationParams& start_params, |
| 267 const RequestNavigationParams& request_params); | 283 const RequestNavigationParams& request_params); |
| 268 ~NavigationParams(); | 284 ~NavigationParams(); |
| 269 | 285 |
| 270 CommonNavigationParams common_params; | 286 CommonNavigationParams common_params; |
| 271 StartNavigationParams start_params; | 287 StartNavigationParams start_params; |
| 272 RequestNavigationParams request_params; | 288 RequestNavigationParams request_params; |
| 273 }; | 289 }; |
| 274 | 290 |
| 275 } // namespace content | 291 } // namespace content |
| 276 | 292 |
| 277 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ | 293 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ |
| OLD | NEW |