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> |
11 | 11 |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
16 #include "content/common/frame_message_enums.h" | 16 #include "content/common/frame_message_enums.h" |
17 #include "content/common/resource_request_body.h" | 17 #include "content/common/resource_request_body_impl.h" |
18 #include "content/public/common/page_state.h" | 18 #include "content/public/common/page_state.h" |
19 #include "content/public/common/referrer.h" | 19 #include "content/public/common/referrer.h" |
20 #include "content/public/common/request_context_type.h" | 20 #include "content/public/common/request_context_type.h" |
21 #include "ui/base/page_transition_types.h" | 21 #include "ui/base/page_transition_types.h" |
22 #include "url/gurl.h" | 22 #include "url/gurl.h" |
23 | 23 |
24 namespace content { | 24 namespace content { |
25 | 25 |
26 // The LoFi state which determines whether to add the Lo-Fi header. | 26 // The LoFi state which determines whether to add the Lo-Fi header. |
27 enum LoFiState { | 27 enum LoFiState { |
(...skipping 15 matching lines...) Expand all Loading... |
43 | 43 |
44 // The following structures hold parameters used during a navigation. In | 44 // The following structures hold parameters used during a navigation. In |
45 // particular they are used by FrameMsg_Navigate, FrameMsg_CommitNavigation and | 45 // particular they are used by FrameMsg_Navigate, FrameMsg_CommitNavigation and |
46 // FrameHostMsg_BeginNavigation. | 46 // FrameHostMsg_BeginNavigation. |
47 | 47 |
48 // Provided by the browser or the renderer ------------------------------------- | 48 // Provided by the browser or the renderer ------------------------------------- |
49 | 49 |
50 // Used by all navigation IPCs. | 50 // Used by all navigation IPCs. |
51 struct CONTENT_EXPORT CommonNavigationParams { | 51 struct CONTENT_EXPORT CommonNavigationParams { |
52 CommonNavigationParams(); | 52 CommonNavigationParams(); |
53 CommonNavigationParams(const GURL& url, | 53 CommonNavigationParams( |
54 const Referrer& referrer, | 54 const GURL& url, |
55 ui::PageTransition transition, | 55 const Referrer& referrer, |
56 FrameMsg_Navigate_Type::Value navigation_type, | 56 ui::PageTransition transition, |
57 bool allow_download, | 57 FrameMsg_Navigate_Type::Value navigation_type, |
58 bool should_replace_current_entry, | 58 bool allow_download, |
59 base::TimeTicks ui_timestamp, | 59 bool should_replace_current_entry, |
60 FrameMsg_UILoadMetricsReportType::Value report_type, | 60 base::TimeTicks ui_timestamp, |
61 const GURL& base_url_for_data_url, | 61 FrameMsg_UILoadMetricsReportType::Value report_type, |
62 const GURL& history_url_for_data_url, | 62 const GURL& base_url_for_data_url, |
63 LoFiState lofi_state, | 63 const GURL& history_url_for_data_url, |
64 const base::TimeTicks& navigation_start, | 64 LoFiState lofi_state, |
65 std::string method, | 65 const base::TimeTicks& navigation_start, |
66 const scoped_refptr<ResourceRequestBody>& post_data); | 66 std::string method, |
| 67 const scoped_refptr<ResourceRequestBodyImpl>& post_data); |
67 CommonNavigationParams(const CommonNavigationParams& other); | 68 CommonNavigationParams(const CommonNavigationParams& other); |
68 ~CommonNavigationParams(); | 69 ~CommonNavigationParams(); |
69 | 70 |
70 // The URL to navigate to. | 71 // The URL to navigate to. |
71 // PlzNavigate: May be modified when the navigation is ready to commit. | 72 // PlzNavigate: May be modified when the navigation is ready to commit. |
72 GURL url; | 73 GURL url; |
73 | 74 |
74 // The URL to send in the "Referer" header field. Can be empty if there is | 75 // The URL to send in the "Referer" header field. Can be empty if there is |
75 // no referrer. | 76 // no referrer. |
76 Referrer referrer; | 77 Referrer referrer; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 // If this is for a browser-initiated navigation, this can override the | 117 // If this is for a browser-initiated navigation, this can override the |
117 // navigation_start value in Blink. | 118 // navigation_start value in Blink. |
118 // PlzNavigate: For renderer initiated navigations, this will be set on the | 119 // PlzNavigate: For renderer initiated navigations, this will be set on the |
119 // renderer side and sent with FrameHostMsg_BeginNavigation. | 120 // renderer side and sent with FrameHostMsg_BeginNavigation. |
120 base::TimeTicks navigation_start; | 121 base::TimeTicks navigation_start; |
121 | 122 |
122 // The request method: GET, POST, etc. | 123 // The request method: GET, POST, etc. |
123 std::string method; | 124 std::string method; |
124 | 125 |
125 // Body of HTTP POST request. | 126 // Body of HTTP POST request. |
126 scoped_refptr<ResourceRequestBody> post_data; | 127 scoped_refptr<ResourceRequestBodyImpl> post_data; |
127 }; | 128 }; |
128 | 129 |
129 // Provided by the renderer ---------------------------------------------------- | 130 // Provided by the renderer ---------------------------------------------------- |
130 // | 131 // |
131 // This struct holds parameters sent by the renderer to the browser. It is only | 132 // This struct holds parameters sent by the renderer to the browser. It is only |
132 // used in PlzNavigate (since in the current architecture, the renderer does not | 133 // used in PlzNavigate (since in the current architecture, the renderer does not |
133 // inform the browser of navigations until they commit). | 134 // inform the browser of navigations until they commit). |
134 | 135 |
135 // This struct is not used outside of the PlzNavigate project. | 136 // This struct is not used outside of the PlzNavigate project. |
136 // PlzNavigate: parameters needed to start a navigation on the IO thread, | 137 // PlzNavigate: parameters needed to start a navigation on the IO thread, |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 ~NavigationParams(); | 323 ~NavigationParams(); |
323 | 324 |
324 CommonNavigationParams common_params; | 325 CommonNavigationParams common_params; |
325 StartNavigationParams start_params; | 326 StartNavigationParams start_params; |
326 RequestNavigationParams request_params; | 327 RequestNavigationParams request_params; |
327 }; | 328 }; |
328 | 329 |
329 } // namespace content | 330 } // namespace content |
330 | 331 |
331 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ | 332 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ |
OLD | NEW |