| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 CHROME_COMMON_RENDER_MESSAGES_H_ | 5 #ifndef CHROME_COMMON_RENDER_MESSAGES_H_ |
| 6 #define CHROME_COMMON_RENDER_MESSAGES_H_ | 6 #define CHROME_COMMON_RENDER_MESSAGES_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 // Parameters structure for ViewMsg_UploadFile. | 216 // Parameters structure for ViewMsg_UploadFile. |
| 217 struct ViewMsg_UploadFile_Params { | 217 struct ViewMsg_UploadFile_Params { |
| 218 // See TabContents::StartFileUpload for a description of these fields. | 218 // See TabContents::StartFileUpload for a description of these fields. |
| 219 std::wstring file_path; | 219 std::wstring file_path; |
| 220 std::wstring form; | 220 std::wstring form; |
| 221 std::wstring file; | 221 std::wstring file; |
| 222 std::wstring submit; | 222 std::wstring submit; |
| 223 std::wstring other_values; | 223 std::wstring other_values; |
| 224 }; | 224 }; |
| 225 | 225 |
| 226 // Information on closing a tab. This is used both for ViewMsg_ClosePage, and |
| 227 // the corresponding ViewHostMsg_ClosePage_ACK. |
| 228 struct ViewMsg_ClosePage_Params { |
| 229 // The identifier of the RenderProcessHost for the currently closing view. |
| 230 // |
| 231 // These first two parameters are technically redundant since they are |
| 232 // needed only when processing the ACK message, and the processor |
| 233 // theoretically knows both the process and route ID. However, this is |
| 234 // difficult to figure out with our current implementation, so this |
| 235 // information is duplicate here. |
| 236 int closing_process_id; |
| 237 |
| 238 // The route identifier for the currently closing RenderView. |
| 239 int closing_route_id; |
| 240 |
| 241 // True when this close is for the first (closing) tab of a cross-site |
| 242 // transition where we switch processes. False indicates the close is for the |
| 243 // entire tab. |
| 244 // |
| 245 // When true, the new_* variables below must be filled in. Otherwise they must |
| 246 // both be -1. |
| 247 bool for_cross_site_transition; |
| 248 |
| 249 // The identifier of the RenderProcessHost for the new view attempting to |
| 250 // replace the closing one above. This must be valid when |
| 251 // for_cross_site_transition is set, and must be -1 otherwise. |
| 252 int new_render_process_host_id; |
| 253 |
| 254 // The identifier of the *request* the new view made that is causing the |
| 255 // cross-site transition. This is *not* a route_id, but the request that we |
| 256 // will resume once the ACK from the closing view has been received. This |
| 257 // must be valid when for_cross_site_transition is set, and must be -1 |
| 258 // otherwise. |
| 259 int new_request_id; |
| 260 }; |
| 261 |
| 226 // Parameters for a resource request. | 262 // Parameters for a resource request. |
| 227 struct ViewHostMsg_Resource_Request { | 263 struct ViewHostMsg_Resource_Request { |
| 228 // The request method: GET, POST, etc. | 264 // The request method: GET, POST, etc. |
| 229 std::string method; | 265 std::string method; |
| 230 | 266 |
| 231 // The requested URL. | 267 // The requested URL. |
| 232 GURL url; | 268 GURL url; |
| 233 | 269 |
| 234 // Usually the URL of the document in the top-level window, which may be | 270 // Usually the URL of the document in the top-level window, which may be |
| 235 // checked by the third-party cookie blocking policy. Leaving it empty may | 271 // checked by the third-party cookie blocking policy. Leaving it empty may |
| (...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1196 event = L"GESTURE_AUTO"; | 1232 event = L"GESTURE_AUTO"; |
| 1197 break; | 1233 break; |
| 1198 default: | 1234 default: |
| 1199 event = L"GESTURE_UNKNOWN"; | 1235 event = L"GESTURE_UNKNOWN"; |
| 1200 break; | 1236 break; |
| 1201 } | 1237 } |
| 1202 LogParam(event, l); | 1238 LogParam(event, l); |
| 1203 } | 1239 } |
| 1204 }; | 1240 }; |
| 1205 | 1241 |
| 1242 // Traits for ViewMsg_Close_Params. |
| 1243 template <> |
| 1244 struct ParamTraits<ViewMsg_ClosePage_Params> { |
| 1245 typedef ViewMsg_ClosePage_Params param_type; |
| 1246 static void Write(Message* m, const param_type& p) { |
| 1247 WriteParam(m, p.closing_process_id); |
| 1248 WriteParam(m, p.closing_route_id); |
| 1249 WriteParam(m, p.for_cross_site_transition); |
| 1250 WriteParam(m, p.new_render_process_host_id); |
| 1251 WriteParam(m, p.new_request_id); |
| 1252 } |
| 1253 |
| 1254 static bool Read(const Message* m, void** iter, param_type* r) { |
| 1255 return ReadParam(m, iter, &r->closing_process_id) && |
| 1256 ReadParam(m, iter, &r->closing_route_id) && |
| 1257 ReadParam(m, iter, &r->for_cross_site_transition) && |
| 1258 ReadParam(m, iter, &r->new_render_process_host_id) && |
| 1259 ReadParam(m, iter, &r->new_request_id); |
| 1260 } |
| 1261 |
| 1262 static void Log(const param_type& p, std::wstring* l) { |
| 1263 l->append(L"("); |
| 1264 LogParam(p.closing_process_id, l); |
| 1265 l->append(L", "); |
| 1266 LogParam(p.closing_route_id, l); |
| 1267 l->append(L", "); |
| 1268 LogParam(p.for_cross_site_transition, l); |
| 1269 l->append(L", "); |
| 1270 LogParam(p.new_render_process_host_id, l); |
| 1271 l->append(L", "); |
| 1272 LogParam(p.new_request_id, l); |
| 1273 l->append(L")"); |
| 1274 } |
| 1275 }; |
| 1276 |
| 1206 // Traits for ViewHostMsg_Resource_Request | 1277 // Traits for ViewHostMsg_Resource_Request |
| 1207 template <> | 1278 template <> |
| 1208 struct ParamTraits<ViewHostMsg_Resource_Request> { | 1279 struct ParamTraits<ViewHostMsg_Resource_Request> { |
| 1209 typedef ViewHostMsg_Resource_Request param_type; | 1280 typedef ViewHostMsg_Resource_Request param_type; |
| 1210 static void Write(Message* m, const param_type& p) { | 1281 static void Write(Message* m, const param_type& p) { |
| 1211 WriteParam(m, p.method); | 1282 WriteParam(m, p.method); |
| 1212 WriteParam(m, p.url); | 1283 WriteParam(m, p.url); |
| 1213 WriteParam(m, p.first_party_for_cookies); | 1284 WriteParam(m, p.first_party_for_cookies); |
| 1214 WriteParam(m, p.referrer); | 1285 WriteParam(m, p.referrer); |
| 1215 WriteParam(m, p.frame_origin); | 1286 WriteParam(m, p.frame_origin); |
| (...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1946 }; | 2017 }; |
| 1947 | 2018 |
| 1948 | 2019 |
| 1949 } // namespace IPC | 2020 } // namespace IPC |
| 1950 | 2021 |
| 1951 | 2022 |
| 1952 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h" | 2023 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h" |
| 1953 #include "ipc/ipc_message_macros.h" | 2024 #include "ipc/ipc_message_macros.h" |
| 1954 | 2025 |
| 1955 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ | 2026 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ |
| OLD | NEW |