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 <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 "ui/base/page_transition_types.h" | 16 #include "ui/base/page_transition_types.h" |
| 17 #include "url/gurl.h" | 17 #include "url/gurl.h" |
| 18 | 18 |
| 19 namespace base { | 19 namespace base { |
| 20 class RefCountedMemory; | 20 class RefCountedMemory; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace content { | 23 namespace content { |
| 24 class NavigationEntry; | 24 class NavigationEntry; |
| 25 | 25 |
| 26 // The following structures hold parameters used during a navigation. In | 26 // The following structures hold parameters used during a navigation. In |
| 27 // particular they are used by FrameMsg_Navigate, FrameMsg_CommitNavigation and | 27 // particular they are used by FrameMsg_Navigate, FrameMsg_CommitNavigation and |
| 28 // FrameHostMsg_BeginNavigation. | 28 // FrameHostMsg_BeginNavigation. |
| 29 // TODO(clamy): Depending on the avancement of the history refactoring move the | |
| 30 // history parameters from FrameMsg_Navigate into one of the structs. | |
| 31 | 29 |
| 32 // Used by all navigation IPCs. | 30 // Used by all navigation IPCs. |
| 33 struct CONTENT_EXPORT CommonNavigationParams { | 31 struct CONTENT_EXPORT CommonNavigationParams { |
| 34 CommonNavigationParams(); | 32 CommonNavigationParams(); |
| 35 CommonNavigationParams(const GURL& url, | 33 CommonNavigationParams(const GURL& url, |
| 36 const Referrer& referrer, | 34 const Referrer& referrer, |
| 37 ui::PageTransition transition, | 35 ui::PageTransition transition, |
| 38 FrameMsg_Navigate_Type::Value navigation_type, | 36 FrameMsg_Navigate_Type::Value navigation_type, |
| 39 bool allow_download, | 37 bool allow_download, |
| 40 base::TimeTicks ui_timestamp, | 38 base::TimeTicks ui_timestamp, |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 99 | 97 |
| 100 // True if the request was user initiated. | 98 // True if the request was user initiated. |
| 101 bool has_user_gesture; | 99 bool has_user_gesture; |
| 102 }; | 100 }; |
| 103 | 101 |
| 104 // Used by FrameMsg_Navigate. | 102 // Used by FrameMsg_Navigate. |
| 105 // PlzNavigate: sent to the renderer when the navigation is ready to commit. | 103 // PlzNavigate: sent to the renderer when the navigation is ready to commit. |
| 106 struct CONTENT_EXPORT CommitNavigationParams { | 104 struct CONTENT_EXPORT CommitNavigationParams { |
| 107 CommitNavigationParams(); | 105 CommitNavigationParams(); |
| 108 CommitNavigationParams(bool is_overriding_user_agent, | 106 CommitNavigationParams(bool is_overriding_user_agent, |
| 109 base::TimeTicks navigation_start); | 107 base::TimeTicks navigation_start, |
| 108 const std::vector<GURL>& redirects, | |
| 109 bool can_load_local_resources, | |
| 110 const std::string& frame_to_navigate, | |
| 111 base::Time request_time); | |
| 110 ~CommitNavigationParams(); | 112 ~CommitNavigationParams(); |
| 111 | 113 |
| 112 // Whether or not the user agent override string should be used. | 114 // Whether or not the user agent override string should be used. |
| 113 bool is_overriding_user_agent; | 115 bool is_overriding_user_agent; |
| 114 | 116 |
| 115 // The navigationStart time to expose through the Navigation Timing API to JS. | 117 // The navigationStart time to expose through the Navigation Timing API to JS. |
| 116 base::TimeTicks browser_navigation_start; | 118 base::TimeTicks browser_navigation_start; |
| 117 | 119 |
| 118 // TODO(clamy): Move the redirect chain here. | 120 // Any redirect URLs that occurred before |url|. Useful for cross-process |
| 121 // navigations; defaults to empty. | |
| 122 std::vector<GURL> redirects; | |
| 123 | |
| 124 // Whether or not this url should be allowed to access local file:// | |
| 125 // resources. | |
| 126 bool can_load_local_resources; | |
| 127 | |
| 128 // If not empty, which frame to navigate. | |
| 129 std::string frame_to_navigate; | |
| 130 | |
| 131 // The time the request was created. This is used by the old performance | |
| 132 // infrastructure to set up DocumentState associated with the RenderView. | |
| 133 // TODO(ppi): make it go away. | |
| 134 base::Time request_time; | |
| 119 }; | 135 }; |
| 120 | 136 |
| 121 // Used by FrameMsg_Navigate. | 137 // Used by FrameMsg_Navigate. |
| 122 // PlzNavigate: sent to the renderer when the navigation is ready to commit. | 138 // PlzNavigate: sent to the renderer when the navigation is ready to commit. |
| 123 struct CONTENT_EXPORT HistoryNavigationParams { | 139 struct CONTENT_EXPORT HistoryNavigationParams { |
| 124 HistoryNavigationParams(); | 140 HistoryNavigationParams(); |
| 125 HistoryNavigationParams(const PageState& page_state, | 141 HistoryNavigationParams(const PageState& page_state, |
| 126 int32 page_id, | 142 int32 page_id, |
| 127 int pending_history_list_offset, | 143 int pending_history_list_offset, |
| 128 int current_history_list_offset, | 144 int current_history_list_offset, |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 147 // size of the session history list. | 163 // size of the session history list. |
| 148 int current_history_list_offset; | 164 int current_history_list_offset; |
| 149 int current_history_list_length; | 165 int current_history_list_length; |
| 150 | 166 |
| 151 // Whether session history should be cleared. In that case, the RenderView | 167 // Whether session history should be cleared. In that case, the RenderView |
| 152 // needs to notify the browser that the clearing was succesful when the | 168 // needs to notify the browser that the clearing was succesful when the |
| 153 // navigation commits. | 169 // navigation commits. |
| 154 bool should_clear_history_list; | 170 bool should_clear_history_list; |
| 155 }; | 171 }; |
| 156 | 172 |
| 173 // Parameters needed at the start of a navigation. Used by FrameMsg_navigate. | |
|
nasko
2015/03/09 23:24:23
nit: FrameMsg_Navigate
clamy
2015/03/10 16:45:44
Done.
| |
| 174 // PlzNavigate: these parameters are not used in navigation. | |
| 175 struct CONTENT_EXPORT StartNavigationParams { | |
|
clamy
2015/03/09 14:34:47
I was not quite sure what to name those, so I'd be
| |
| 176 StartNavigationParams(); | |
| 177 StartNavigationParams( | |
| 178 bool is_post, | |
| 179 const std::string& extra_headers, | |
| 180 const std::vector<unsigned char>& browser_initiated_post_data, | |
| 181 bool should_replace_current_entry, | |
| 182 int transferred_request_child_id, | |
| 183 int transferred_request_request_id); | |
| 184 ~StartNavigationParams(); | |
| 185 // Whether the navigation is a POST request (as opposed to a GET). | |
|
nasko
2015/03/09 23:24:23
nit: Empty line above the comment.
clamy
2015/03/10 16:45:44
Done.
| |
| 186 bool is_post; | |
| 187 | |
| 188 // Extra headers (separated by \n) to send during the request. | |
| 189 std::string extra_headers; | |
| 190 | |
| 191 // If is_post is true, holds the post_data information from browser. Empty | |
| 192 // otherwise. | |
| 193 std::vector<unsigned char> browser_initiated_post_data; | |
| 194 | |
| 195 // Informs the RenderView the pending navigation should replace the current | |
| 196 // history entry when it commits. This is used for cross-process redirects so | |
| 197 // the transferred navigation can recover the navigation state. | |
| 198 bool should_replace_current_entry; | |
| 199 | |
| 200 // The following two members identify a previous request that has been | |
| 201 // created before this navigation is being transferred to a new render view. | |
| 202 // This serves the purpose of recycling the old request. | |
| 203 // Unless this refers to a transferred navigation, these values are -1 and -1. | |
| 204 int transferred_request_child_id; | |
| 205 int transferred_request_request_id; | |
| 206 }; | |
| 207 | |
| 157 } // namespace content | 208 } // namespace content |
| 158 | 209 |
| 159 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ | 210 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ |
| OLD | NEW |