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/common/service_worker/service_worker_types.h" | |
clamy
2015/08/31 12:09:27
nit; remove unnecessary include.
Fabrice (no longer in Chrome)
2015/08/31 14:00:35
Done.
| |
14 #include "content/public/common/page_state.h" | 15 #include "content/public/common/page_state.h" |
15 #include "content/public/common/referrer.h" | 16 #include "content/public/common/referrer.h" |
17 #include "content/public/common/request_context_frame_type.h" | |
clamy
2015/08/31 12:09:27
nit: remove unnecessary include.
Fabrice (no longer in Chrome)
2015/08/31 14:00:35
Done.
| |
18 #include "content/public/common/request_context_type.h" | |
16 #include "ui/base/page_transition_types.h" | 19 #include "ui/base/page_transition_types.h" |
17 #include "url/gurl.h" | 20 #include "url/gurl.h" |
18 | 21 |
19 namespace base { | 22 namespace base { |
20 class RefCountedMemory; | 23 class RefCountedMemory; |
21 } | 24 } |
22 | 25 |
23 namespace content { | 26 namespace content { |
24 | 27 |
25 // PlzNavigate | 28 // PlzNavigate |
(...skipping 13 matching lines...) Expand all Loading... | |
39 CommonNavigationParams(); | 42 CommonNavigationParams(); |
40 CommonNavigationParams(const GURL& url, | 43 CommonNavigationParams(const GURL& url, |
41 const Referrer& referrer, | 44 const Referrer& referrer, |
42 ui::PageTransition transition, | 45 ui::PageTransition transition, |
43 FrameMsg_Navigate_Type::Value navigation_type, | 46 FrameMsg_Navigate_Type::Value navigation_type, |
44 bool allow_download, | 47 bool allow_download, |
45 bool should_replace_current_entry, | 48 bool should_replace_current_entry, |
46 base::TimeTicks ui_timestamp, | 49 base::TimeTicks ui_timestamp, |
47 FrameMsg_UILoadMetricsReportType::Value report_type, | 50 FrameMsg_UILoadMetricsReportType::Value report_type, |
48 const GURL& base_url_for_data_url, | 51 const GURL& base_url_for_data_url, |
49 const GURL& history_url_for_data_url); | 52 const GURL& history_url_for_data_url, |
53 int service_worker_provider_id); | |
50 ~CommonNavigationParams(); | 54 ~CommonNavigationParams(); |
51 | 55 |
52 // The URL to navigate to. | 56 // The URL to navigate to. |
53 // PlzNavigate: May be modified when the navigation is ready to commit. | 57 // PlzNavigate: May be modified when the navigation is ready to commit. |
54 GURL url; | 58 GURL url; |
55 | 59 |
56 // The URL to send in the "Referer" header field. Can be empty if there is | 60 // The URL to send in the "Referer" header field. Can be empty if there is |
57 // no referrer. | 61 // no referrer. |
58 Referrer referrer; | 62 Referrer referrer; |
59 | 63 |
(...skipping 22 matching lines...) Expand all Loading... | |
82 // The report type to be used when recording the metric using |ui_timestamp|. | 86 // The report type to be used when recording the metric using |ui_timestamp|. |
83 FrameMsg_UILoadMetricsReportType::Value report_type; | 87 FrameMsg_UILoadMetricsReportType::Value report_type; |
84 | 88 |
85 // Base URL for use in Blink's SubstituteData. | 89 // Base URL for use in Blink's SubstituteData. |
86 // Is only used with data: URLs. | 90 // Is only used with data: URLs. |
87 GURL base_url_for_data_url; | 91 GURL base_url_for_data_url; |
88 | 92 |
89 // History URL for use in Blink's SubstituteData. | 93 // History URL for use in Blink's SubstituteData. |
90 // Is only used with data: URLs. | 94 // Is only used with data: URLs. |
91 GURL history_url_for_data_url; | 95 GURL history_url_for_data_url; |
96 | |
97 // PlzNavigate | |
98 // The ServiceWorker provider ID associated with the navigation. | |
99 int service_worker_provider_id; | |
92 }; | 100 }; |
93 | 101 |
94 // Provided by the renderer ---------------------------------------------------- | 102 // Provided by the renderer ---------------------------------------------------- |
95 // | 103 // |
96 // This struct holds parameters sent by the renderer to the browser. It is only | 104 // 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 | 105 // used in PlzNavigate (since in the current architecture, the renderer does not |
98 // inform the browser of navigations until they commit). | 106 // inform the browser of navigations until they commit). |
99 | 107 |
100 // This struct is not used outside of the PlzNavigate project. | 108 // This struct is not used outside of the PlzNavigate project. |
101 // PlzNavigate: parameters needed to start a navigation on the IO thread, | 109 // PlzNavigate: parameters needed to start a navigation on the IO thread, |
102 // following a renderer-initiated navigation request. | 110 // following a renderer-initiated navigation request. |
103 struct CONTENT_EXPORT BeginNavigationParams { | 111 struct CONTENT_EXPORT BeginNavigationParams { |
104 // TODO(clamy): See if it is possible to reuse this in | 112 // TODO(clamy): See if it is possible to reuse this in |
105 // ResourceMsg_Request_Params. | 113 // ResourceMsg_Request_Params. |
106 BeginNavigationParams(); | 114 BeginNavigationParams(); |
107 BeginNavigationParams(std::string method, | 115 BeginNavigationParams(std::string method, |
108 std::string headers, | 116 std::string headers, |
109 int load_flags, | 117 int load_flags, |
110 bool has_user_gesture); | 118 bool has_user_gesture, |
119 bool skip_service_worker, | |
120 RequestContextType request_context_type); | |
111 | 121 |
112 // The request method: GET, POST, etc. | 122 // The request method: GET, POST, etc. |
113 std::string method; | 123 std::string method; |
114 | 124 |
115 // Additional HTTP request headers. | 125 // Additional HTTP request headers. |
116 std::string headers; | 126 std::string headers; |
117 | 127 |
118 // net::URLRequest load flags (net::LOAD_NORMAL) by default). | 128 // net::URLRequest load flags (net::LOAD_NORMAL) by default). |
119 int load_flags; | 129 int load_flags; |
120 | 130 |
121 // True if the request was user initiated. | 131 // True if the request was user initiated. |
122 bool has_user_gesture; | 132 bool has_user_gesture; |
133 | |
134 // True if the ServiceWorker should be skipped. | |
135 bool skip_service_worker; | |
136 | |
137 // Indicates the request context type. | |
138 RequestContextType request_context_type; | |
123 }; | 139 }; |
124 | 140 |
125 // Provided by the browser ----------------------------------------------------- | 141 // Provided by the browser ----------------------------------------------------- |
126 // | 142 // |
127 // These structs are sent by the browser to the renderer to start/commit a | 143 // These structs are sent by the browser to the renderer to start/commit a |
128 // navigation depending on whether browser-side navigation is enabled. | 144 // navigation depending on whether browser-side navigation is enabled. |
129 // Parameters used both in the current architecture and PlzNavigate should be | 145 // Parameters used both in the current architecture and PlzNavigate should be |
130 // put in RequestNavigationParams. Parameters only used by the current | 146 // put in RequestNavigationParams. Parameters only used by the current |
131 // architecture should go in StartNavigationParams. | 147 // architecture should go in StartNavigationParams. |
132 | 148 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 |