| 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 13 matching lines...) Expand all Loading... |
| 39 CommonNavigationParams(); | 40 CommonNavigationParams(); |
| 40 CommonNavigationParams(const GURL& url, | 41 CommonNavigationParams(const GURL& url, |
| 41 const Referrer& referrer, | 42 const Referrer& referrer, |
| 42 ui::PageTransition transition, | 43 ui::PageTransition transition, |
| 43 FrameMsg_Navigate_Type::Value navigation_type, | 44 FrameMsg_Navigate_Type::Value navigation_type, |
| 44 bool allow_download, | 45 bool allow_download, |
| 45 bool should_replace_current_entry, | 46 bool should_replace_current_entry, |
| 46 base::TimeTicks ui_timestamp, | 47 base::TimeTicks ui_timestamp, |
| 47 FrameMsg_UILoadMetricsReportType::Value report_type, | 48 FrameMsg_UILoadMetricsReportType::Value report_type, |
| 48 const GURL& base_url_for_data_url, | 49 const GURL& base_url_for_data_url, |
| 49 const GURL& history_url_for_data_url); | 50 const GURL& history_url_for_data_url, |
| 51 int service_worker_provider_id); |
| 50 ~CommonNavigationParams(); | 52 ~CommonNavigationParams(); |
| 51 | 53 |
| 52 // The URL to navigate to. | 54 // The URL to navigate to. |
| 53 // PlzNavigate: May be modified when the navigation is ready to commit. | 55 // PlzNavigate: May be modified when the navigation is ready to commit. |
| 54 GURL url; | 56 GURL url; |
| 55 | 57 |
| 56 // The URL to send in the "Referer" header field. Can be empty if there is | 58 // The URL to send in the "Referer" header field. Can be empty if there is |
| 57 // no referrer. | 59 // no referrer. |
| 58 Referrer referrer; | 60 Referrer referrer; |
| 59 | 61 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 82 // The report type to be used when recording the metric using |ui_timestamp|. | 84 // The report type to be used when recording the metric using |ui_timestamp|. |
| 83 FrameMsg_UILoadMetricsReportType::Value report_type; | 85 FrameMsg_UILoadMetricsReportType::Value report_type; |
| 84 | 86 |
| 85 // Base URL for use in Blink's SubstituteData. | 87 // Base URL for use in Blink's SubstituteData. |
| 86 // Is only used with data: URLs. | 88 // Is only used with data: URLs. |
| 87 GURL base_url_for_data_url; | 89 GURL base_url_for_data_url; |
| 88 | 90 |
| 89 // History URL for use in Blink's SubstituteData. | 91 // History URL for use in Blink's SubstituteData. |
| 90 // Is only used with data: URLs. | 92 // Is only used with data: URLs. |
| 91 GURL history_url_for_data_url; | 93 GURL history_url_for_data_url; |
| 94 |
| 95 // PlzNavigate |
| 96 // The ServiceWorker provider ID associated with the navigation. |
| 97 int service_worker_provider_id; |
| 92 }; | 98 }; |
| 93 | 99 |
| 94 // Provided by the renderer ---------------------------------------------------- | 100 // Provided by the renderer ---------------------------------------------------- |
| 95 // | 101 // |
| 96 // This struct holds parameters sent by the renderer to the browser. It is only | 102 // This struct holds parameters sent by the renderer to the browser. It is only |
| 97 // used in PlzNavigate (since in the current architecture, the renderer does not | 103 // used in PlzNavigate (since in the current architecture, the renderer does not |
| 98 // inform the browser of navigations until they commit). | 104 // inform the browser of navigations until they commit). |
| 99 | 105 |
| 100 // This struct is not used outside of the PlzNavigate project. | 106 // This struct is not used outside of the PlzNavigate project. |
| 101 // PlzNavigate: parameters needed to start a navigation on the IO thread, | 107 // PlzNavigate: parameters needed to start a navigation on the IO thread, |
| 102 // following a renderer-initiated navigation request. | 108 // following a renderer-initiated navigation request. |
| 103 struct CONTENT_EXPORT BeginNavigationParams { | 109 struct CONTENT_EXPORT BeginNavigationParams { |
| 104 // TODO(clamy): See if it is possible to reuse this in | 110 // TODO(clamy): See if it is possible to reuse this in |
| 105 // ResourceMsg_Request_Params. | 111 // ResourceMsg_Request_Params. |
| 106 BeginNavigationParams(); | 112 BeginNavigationParams(); |
| 107 BeginNavigationParams(std::string method, | 113 BeginNavigationParams(std::string method, |
| 108 std::string headers, | 114 std::string headers, |
| 109 int load_flags, | 115 int load_flags, |
| 110 bool has_user_gesture); | 116 bool has_user_gesture, |
| 117 bool skip_service_worker, |
| 118 RequestContextType request_context_type); |
| 111 | 119 |
| 112 // The request method: GET, POST, etc. | 120 // The request method: GET, POST, etc. |
| 113 std::string method; | 121 std::string method; |
| 114 | 122 |
| 115 // Additional HTTP request headers. | 123 // Additional HTTP request headers. |
| 116 std::string headers; | 124 std::string headers; |
| 117 | 125 |
| 118 // net::URLRequest load flags (net::LOAD_NORMAL) by default). | 126 // net::URLRequest load flags (net::LOAD_NORMAL) by default). |
| 119 int load_flags; | 127 int load_flags; |
| 120 | 128 |
| 121 // True if the request was user initiated. | 129 // True if the request was user initiated. |
| 122 bool has_user_gesture; | 130 bool has_user_gesture; |
| 131 |
| 132 // True if the ServiceWorker should be skipped. |
| 133 bool skip_service_worker; |
| 134 |
| 135 // Indicates the request context type. |
| 136 RequestContextType request_context_type; |
| 123 }; | 137 }; |
| 124 | 138 |
| 125 // Provided by the browser ----------------------------------------------------- | 139 // Provided by the browser ----------------------------------------------------- |
| 126 // | 140 // |
| 127 // These structs are sent by the browser to the renderer to start/commit a | 141 // These structs are sent by the browser to the renderer to start/commit a |
| 128 // navigation depending on whether browser-side navigation is enabled. | 142 // navigation depending on whether browser-side navigation is enabled. |
| 129 // Parameters used both in the current architecture and PlzNavigate should be | 143 // Parameters used both in the current architecture and PlzNavigate should be |
| 130 // put in RequestNavigationParams. Parameters only used by the current | 144 // put in RequestNavigationParams. Parameters only used by the current |
| 131 // architecture should go in StartNavigationParams. | 145 // architecture should go in StartNavigationParams. |
| 132 | 146 |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 ~NavigationParams(); | 282 ~NavigationParams(); |
| 269 | 283 |
| 270 CommonNavigationParams common_params; | 284 CommonNavigationParams common_params; |
| 271 StartNavigationParams start_params; | 285 StartNavigationParams start_params; |
| 272 RequestNavigationParams request_params; | 286 RequestNavigationParams request_params; |
| 273 }; | 287 }; |
| 274 | 288 |
| 275 } // namespace content | 289 } // namespace content |
| 276 | 290 |
| 277 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ | 291 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ |
| OLD | NEW |