Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: chrome/common/render_messages.h

Issue 160229: Merge 21531 - Fix a race condition where rapid back/forward clicks could clos... (Closed) Base URL: svn://chrome-svn/chrome/branches/195/src/
Patch Set: Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
Property Changes:
Modified: svn:mergeinfo
Merged /trunk/src/chrome/common/render_messages.h:r21531
OLDNEW
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
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
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 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
1926 }; 1997 };
1927 1998
1928 1999
1929 } // namespace IPC 2000 } // namespace IPC
1930 2001
1931 2002
1932 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h" 2003 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h"
1933 #include "ipc/ipc_message_macros.h" 2004 #include "ipc/ipc_message_macros.h"
1934 2005
1935 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ 2006 #endif // CHROME_COMMON_RENDER_MESSAGES_H_
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/render_view_host_manager.cc ('k') | chrome/common/render_messages_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698