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

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

Issue 21039: Revert my change to get the tree green. Not sure why the tests became flaky.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 10 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
« no previous file with comments | « chrome/common/plugin_messages_internal.h ('k') | chrome/common/render_messages_internal.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/gfx/native_widget_types.h" 13 #include "base/gfx/native_widget_types.h"
14 #include "base/ref_counted.h" 14 #include "base/ref_counted.h"
15 #include "base/shared_memory.h" 15 #include "base/shared_memory.h"
16 #include "chrome/common/bitmap_wire_data.h" 16 #include "chrome/common/bitmap_wire_data.h"
17 #include "chrome/common/filter_policy.h" 17 #include "chrome/common/filter_policy.h"
18 #include "chrome/common/ipc_message.h"
18 #include "chrome/common/ipc_message_utils.h" 19 #include "chrome/common/ipc_message_utils.h"
19 #include "chrome/common/modal_dialog_event.h" 20 #include "chrome/common/modal_dialog_event.h"
20 #include "chrome/common/page_transition_types.h" 21 #include "chrome/common/page_transition_types.h"
21 #include "googleurl/src/gurl.h" 22 #include "googleurl/src/gurl.h"
22 #include "net/base/upload_data.h" 23 #include "net/base/upload_data.h"
23 #include "net/url_request/url_request_status.h" 24 #include "net/url_request/url_request_status.h"
24 #include "webkit/glue/autofill_form.h" 25 #include "webkit/glue/autofill_form.h"
25 #include "webkit/glue/cache_manager.h" 26 #include "webkit/glue/cache_manager.h"
26 #include "webkit/glue/context_node_types.h" 27 #include "webkit/glue/context_node_types.h"
27 #include "webkit/glue/form_data.h" 28 #include "webkit/glue/form_data.h"
28 #include "webkit/glue/password_form.h" 29 #include "webkit/glue/password_form.h"
29 #include "webkit/glue/password_form_dom_manager.h" 30 #include "webkit/glue/password_form_dom_manager.h"
30 #include "webkit/glue/resource_loader_bridge.h" 31 #include "webkit/glue/resource_loader_bridge.h"
31 #include "webkit/glue/screen_info.h" 32 #include "webkit/glue/screen_info.h"
32 #include "webkit/glue/webdropdata.h" 33 #include "webkit/glue/webdropdata.h"
33 #include "webkit/glue/webinputevent.h"
34 #include "webkit/glue/webplugin.h" 34 #include "webkit/glue/webplugin.h"
35 #include "webkit/glue/webpreferences.h" 35 #include "webkit/glue/webpreferences.h"
36 #include "webkit/glue/webview_delegate.h" 36 #include "webkit/glue/webview_delegate.h"
37 37
38 #if defined(OS_POSIX) 38 #if defined(OS_POSIX)
39 #include "skia/include/SkBitmap.h" 39 #include "skia/include/SkBitmap.h"
40 #endif 40 #endif
41 41
42 // Parameters structure for ViewMsg_Navigate, which has too many data 42 // Parameters structure for ViewMsg_Navigate, which has too many data
43 // parameters to be reasonably put in a predefined IPC message. 43 // parameters to be reasonably put in a predefined IPC message.
(...skipping 15 matching lines...) Expand all
59 PageTransition::Type transition; 59 PageTransition::Type transition;
60 60
61 // Opaque history state (received by ViewHostMsg_UpdateState). 61 // Opaque history state (received by ViewHostMsg_UpdateState).
62 std::string state; 62 std::string state;
63 63
64 // Specifies if the URL should be loaded using 'reload' semantics (i.e., 64 // Specifies if the URL should be loaded using 'reload' semantics (i.e.,
65 // bypassing any locally cached content). 65 // bypassing any locally cached content).
66 bool reload; 66 bool reload;
67 }; 67 };
68 68
69 // Traits for ViewMsg_Navigate_Params structure to pack/unpack. 69 // Parameters structure for ViewHostMsg_FrameNavigate, which has too many data
70 template <> 70 // parameters to be reasonably put in a predefined IPC message.
71 struct ParamTraits<ViewMsg_Navigate_Params> {
72 typedef ViewMsg_Navigate_Params param_type;
73 static void Write(IPC::Message* m, const param_type& p) {
74 WriteParam(m, p.page_id);
75 WriteParam(m, p.url);
76 WriteParam(m, p.referrer);
77 WriteParam(m, p.transition);
78 WriteParam(m, p.state);
79 WriteParam(m, p.reload);
80 }
81 static bool Read(const IPC::Message* m, void** iter, param_type* p) {
82 return
83 ReadParam(m, iter, &p->page_id) &&
84 ReadParam(m, iter, &p->url) &&
85 ReadParam(m, iter, &p->referrer) &&
86 ReadParam(m, iter, &p->transition) &&
87 ReadParam(m, iter, &p->state) &&
88 ReadParam(m, iter, &p->reload);
89 }
90 static void Log(const param_type& p, std::wstring* l) {
91 l->append(L"(");
92 LogParam(p.page_id, l);
93 l->append(L", ");
94 LogParam(p.url, l);
95 l->append(L", ");
96 LogParam(p.transition, l);
97 l->append(L", ");
98 LogParam(p.state, l);
99 l->append(L", ");
100 LogParam(p.reload, l);
101 l->append(L")");
102 }
103 };
104
105
106 struct ViewHostMsg_FrameNavigate_Params { 71 struct ViewHostMsg_FrameNavigate_Params {
107 // Page ID of this navigation. The renderer creates a new unique page ID 72 // Page ID of this navigation. The renderer creates a new unique page ID
108 // anytime a new session history entry is created. This means you'll get new 73 // anytime a new session history entry is created. This means you'll get new
109 // page IDs for user actions, and the old page IDs will be reloaded when 74 // page IDs for user actions, and the old page IDs will be reloaded when
110 // iframes are loaded automatically. 75 // iframes are loaded automatically.
111 int32 page_id; 76 int32 page_id;
112 77
113 // URL of the page being loaded. 78 // URL of the page being loaded.
114 GURL url; 79 GURL url;
115 80
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 std::string contents_mime_type; 114 std::string contents_mime_type;
150 115
151 // True if this was a post request. 116 // True if this was a post request.
152 bool is_post; 117 bool is_post;
153 118
154 // Whether the content of the frame was replaced with some alternate content 119 // Whether the content of the frame was replaced with some alternate content
155 // (this can happen if the resource was insecure). 120 // (this can happen if the resource was insecure).
156 bool is_content_filtered; 121 bool is_content_filtered;
157 }; 122 };
158 123
159 template <> 124 // Parameters structure for ViewHostMsg_ContextMenu, which has too many data
160 struct ParamTraits<ViewHostMsg_FrameNavigate_Params> { 125 // parameters to be reasonably put in a predefined IPC message.
161 typedef ViewHostMsg_FrameNavigate_Params param_type;
162 static void Write(IPC::Message* m, const param_type& p) {
163 WriteParam(m, p.page_id);
164 WriteParam(m, p.url);
165 WriteParam(m, p.referrer);
166 WriteParam(m, p.transition);
167 WriteParam(m, p.redirects);
168 WriteParam(m, p.should_update_history);
169 WriteParam(m, p.searchable_form_url);
170 WriteParam(m, p.searchable_form_element_name);
171 WriteParam(m, p.searchable_form_encoding);
172 WriteParam(m, p.password_form);
173 WriteParam(m, p.security_info);
174 WriteParam(m, p.gesture);
175 WriteParam(m, p.contents_mime_type);
176 WriteParam(m, p.is_post);
177 WriteParam(m, p.is_content_filtered);
178 }
179 static bool Read(const IPC::Message* m, void** iter, param_type* p) {
180 return
181 ReadParam(m, iter, &p->page_id) &&
182 ReadParam(m, iter, &p->url) &&
183 ReadParam(m, iter, &p->referrer) &&
184 ReadParam(m, iter, &p->transition) &&
185 ReadParam(m, iter, &p->redirects) &&
186 ReadParam(m, iter, &p->should_update_history) &&
187 ReadParam(m, iter, &p->searchable_form_url) &&
188 ReadParam(m, iter, &p->searchable_form_element_name) &&
189 ReadParam(m, iter, &p->searchable_form_encoding) &&
190 ReadParam(m, iter, &p->password_form) &&
191 ReadParam(m, iter, &p->security_info) &&
192 ReadParam(m, iter, &p->gesture) &&
193 ReadParam(m, iter, &p->contents_mime_type) &&
194 ReadParam(m, iter, &p->is_post) &&
195 ReadParam(m, iter, &p->is_content_filtered);
196 }
197 static void Log(const param_type& p, std::wstring* l) {
198 l->append(L"(");
199 LogParam(p.page_id, l);
200 l->append(L", ");
201 LogParam(p.url, l);
202 l->append(L", ");
203 LogParam(p.referrer, l);
204 l->append(L", ");
205 LogParam(p.transition, l);
206 l->append(L", ");
207 LogParam(p.redirects, l);
208 l->append(L", ");
209 LogParam(p.should_update_history, l);
210 l->append(L", ");
211 LogParam(p.searchable_form_url, l);
212 l->append(L", ");
213 LogParam(p.searchable_form_element_name, l);
214 l->append(L", ");
215 LogParam(p.searchable_form_encoding, l);
216 l->append(L", ");
217 LogParam(p.password_form, l);
218 l->append(L", ");
219 LogParam(p.security_info, l);
220 l->append(L", ");
221 LogParam(p.gesture, l);
222 l->append(L", ");
223 LogParam(p.contents_mime_type, l);
224 l->append(L", ");
225 LogParam(p.is_post, l);
226 l->append(L", ");
227 LogParam(p.is_content_filtered, l);
228 l->append(L")");
229 }
230 };
231
232
233 // FIXME(beng): This would be more useful in the future and more efficient 126 // FIXME(beng): This would be more useful in the future and more efficient
234 // if the parameters here weren't so literally mapped to what 127 // if the parameters here weren't so literally mapped to what
235 // they contain for the ContextMenu task. It might be better 128 // they contain for the ContextMenu task. It might be better
236 // to make the string fields more generic so that this object 129 // to make the string fields more generic so that this object
237 // could be used for more contextual actions. 130 // could be used for more contextual actions.
238 struct ViewHostMsg_ContextMenu_Params { 131 struct ViewHostMsg_ContextMenu_Params {
239 // This is the type of Context Node that the context menu was invoked on. 132 // This is the type of Context Node that the context menu was invoked on.
240 ContextNode node; 133 ContextNode node;
241 134
242 // These values represent the coordinates of the mouse when the context menu 135 // These values represent the coordinates of the mouse when the context menu
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 bool spellcheck_enabled; 169 bool spellcheck_enabled;
277 170
278 // These flags indicate to the browser whether the renderer believes it is 171 // These flags indicate to the browser whether the renderer believes it is
279 // able to perform the corresponding action. 172 // able to perform the corresponding action.
280 int edit_flags; 173 int edit_flags;
281 174
282 // The security info for the resource we are showing the menu on. 175 // The security info for the resource we are showing the menu on.
283 std::string security_info; 176 std::string security_info;
284 }; 177 };
285 178
286 template <>
287 struct ParamTraits<ViewHostMsg_ContextMenu_Params> {
288 typedef ViewHostMsg_ContextMenu_Params param_type;
289 static void Write(IPC::Message* m, const param_type& p) {
290 WriteParam(m, p.node);
291 WriteParam(m, p.x);
292 WriteParam(m, p.y);
293 WriteParam(m, p.link_url);
294 WriteParam(m, p.image_url);
295 WriteParam(m, p.page_url);
296 WriteParam(m, p.frame_url);
297 WriteParam(m, p.selection_text);
298 WriteParam(m, p.misspelled_word);
299 WriteParam(m, p.dictionary_suggestions);
300 WriteParam(m, p.spellcheck_enabled);
301 WriteParam(m, p.edit_flags);
302 WriteParam(m, p.security_info);
303 }
304 static bool Read(const IPC::Message* m, void** iter, param_type* p) {
305 return
306 ReadParam(m, iter, &p->node) &&
307 ReadParam(m, iter, &p->x) &&
308 ReadParam(m, iter, &p->y) &&
309 ReadParam(m, iter, &p->link_url) &&
310 ReadParam(m, iter, &p->image_url) &&
311 ReadParam(m, iter, &p->page_url) &&
312 ReadParam(m, iter, &p->frame_url) &&
313 ReadParam(m, iter, &p->selection_text) &&
314 ReadParam(m, iter, &p->misspelled_word) &&
315 ReadParam(m, iter, &p->dictionary_suggestions) &&
316 ReadParam(m, iter, &p->spellcheck_enabled) &&
317 ReadParam(m, iter, &p->edit_flags) &&
318 ReadParam(m, iter, &p->security_info);
319 }
320 static void Log(const param_type& p, std::wstring* l) {
321 l->append(L"<ViewHostMsg_ContextMenu_Params>");
322 }
323 };
324
325 // Values that may be OR'd together to form the 'flags' parameter of a 179 // Values that may be OR'd together to form the 'flags' parameter of a
326 // ViewHostMsg_PaintRect message. 180 // ViewHostMsg_PaintRect message.
327 struct ViewHostMsg_PaintRect_Flags { 181 struct ViewHostMsg_PaintRect_Flags {
328 enum { 182 enum {
329 IS_RESIZE_ACK = 1 << 0, 183 IS_RESIZE_ACK = 1 << 0,
330 IS_RESTORE_ACK = 1 << 1, 184 IS_RESTORE_ACK = 1 << 1,
331 IS_REPAINT_ACK = 1 << 2, 185 IS_REPAINT_ACK = 1 << 2,
332 }; 186 };
333 static bool is_resize_ack(int flags) { 187 static bool is_resize_ack(int flags) {
334 return (flags & IS_RESIZE_ACK) != 0; 188 return (flags & IS_RESIZE_ACK) != 0;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 // ViewHostMsg_PaintRect_Flags::IS_RESTORE_ACK 220 // ViewHostMsg_PaintRect_Flags::IS_RESTORE_ACK
367 // Indicates that this is a response to a ViewMsg_WasRestored message. 221 // Indicates that this is a response to a ViewMsg_WasRestored message.
368 // 222 //
369 // If flags is zero, then this message corresponds to an unsoliticed paint 223 // If flags is zero, then this message corresponds to an unsoliticed paint
370 // request by the render view. Both of the above bits may be set in flags, 224 // request by the render view. Both of the above bits may be set in flags,
371 // which would indicate that this paint message is an ACK for multiple 225 // which would indicate that this paint message is an ACK for multiple
372 // request messages. 226 // request messages.
373 int flags; 227 int flags;
374 }; 228 };
375 229
376 template <> 230 // Parameters structure for ViewHostMsg_ScrollRect, which has too many data
377 struct ParamTraits<ViewHostMsg_PaintRect_Params> { 231 // parameters to be reasonably put in a predefined IPC message.
378 typedef ViewHostMsg_PaintRect_Params param_type;
379 static void Write(IPC::Message* m, const param_type& p) {
380 WriteParam(m, p.bitmap);
381 WriteParam(m, p.bitmap_rect);
382 WriteParam(m, p.view_size);
383 WriteParam(m, p.plugin_window_moves);
384 WriteParam(m, p.flags);
385 }
386 static bool Read(const IPC::Message* m, void** iter, param_type* p) {
387 return
388 ReadParam(m, iter, &p->bitmap) &&
389 ReadParam(m, iter, &p->bitmap_rect) &&
390 ReadParam(m, iter, &p->view_size) &&
391 ReadParam(m, iter, &p->plugin_window_moves) &&
392 ReadParam(m, iter, &p->flags);
393 }
394 static void Log(const param_type& p, std::wstring* l) {
395 l->append(L"(");
396 LogParam(p.bitmap, l);
397 l->append(L", ");
398 LogParam(p.bitmap_rect, l);
399 l->append(L", ");
400 LogParam(p.view_size, l);
401 l->append(L", ");
402 LogParam(p.plugin_window_moves, l);
403 l->append(L", ");
404 LogParam(p.flags, l);
405 l->append(L")");
406 }
407 };
408
409
410 struct ViewHostMsg_ScrollRect_Params { 232 struct ViewHostMsg_ScrollRect_Params {
411 // The bitmap to be painted into the rect exposed by scrolling. 233 // The bitmap to be painted into the rect exposed by scrolling.
412 BitmapWireData bitmap; 234 BitmapWireData bitmap;
413 235
414 // The position and size of the bitmap. 236 // The position and size of the bitmap.
415 gfx::Rect bitmap_rect; 237 gfx::Rect bitmap_rect;
416 238
417 // The scroll offset. Only one of these can be non-zero. 239 // The scroll offset. Only one of these can be non-zero.
418 int dx; 240 int dx;
419 int dy; 241 int dy;
420 242
421 // The rectangular region to scroll. 243 // The rectangular region to scroll.
422 gfx::Rect clip_rect; 244 gfx::Rect clip_rect;
423 245
424 // The size of the RenderView when this message was generated. 246 // The size of the RenderView when this message was generated.
425 gfx::Size view_size; 247 gfx::Size view_size;
426 248
427 // New window locations for plugin child windows. 249 // New window locations for plugin child windows.
428 std::vector<WebPluginGeometry> plugin_window_moves; 250 std::vector<WebPluginGeometry> plugin_window_moves;
429 }; 251 };
430 252
431 template <> 253 // Parameters structure for ViewMsg_UploadFile.
432 struct ParamTraits<ViewHostMsg_ScrollRect_Params> {
433 typedef ViewHostMsg_ScrollRect_Params param_type;
434 static void Write(IPC::Message* m, const param_type& p) {
435 WriteParam(m, p.bitmap);
436 WriteParam(m, p.bitmap_rect);
437 WriteParam(m, p.dx);
438 WriteParam(m, p.dy);
439 WriteParam(m, p.clip_rect);
440 WriteParam(m, p.view_size);
441 WriteParam(m, p.plugin_window_moves);
442 }
443 static bool Read(const IPC::Message* m, void** iter, param_type* p) {
444 return
445 ReadParam(m, iter, &p->bitmap) &&
446 ReadParam(m, iter, &p->bitmap_rect) &&
447 ReadParam(m, iter, &p->dx) &&
448 ReadParam(m, iter, &p->dy) &&
449 ReadParam(m, iter, &p->clip_rect) &&
450 ReadParam(m, iter, &p->view_size) &&
451 ReadParam(m, iter, &p->plugin_window_moves);
452 }
453 static void Log(const param_type& p, std::wstring* l) {
454 l->append(L"(");
455 LogParam(p.bitmap, l);
456 l->append(L", ");
457 LogParam(p.bitmap_rect, l);
458 l->append(L", ");
459 LogParam(p.dx, l);
460 l->append(L", ");
461 LogParam(p.dy, l);
462 l->append(L", ");
463 LogParam(p.clip_rect, l);
464 l->append(L", ");
465 LogParam(p.view_size, l);
466 l->append(L", ");
467 LogParam(p.plugin_window_moves, l);
468 l->append(L")");
469 }
470 };
471
472
473 struct ViewMsg_UploadFile_Params { 254 struct ViewMsg_UploadFile_Params {
474 // See WebContents::StartFileUpload for a description of these fields. 255 // See WebContents::StartFileUpload for a description of these fields.
475 std::wstring file_path; 256 std::wstring file_path;
476 std::wstring form; 257 std::wstring form;
477 std::wstring file; 258 std::wstring file;
478 std::wstring submit; 259 std::wstring submit;
479 std::wstring other_values; 260 std::wstring other_values;
480 }; 261 };
481 262
482 template <> 263 // Parameters for a resource request.
483 struct ParamTraits<ViewMsg_UploadFile_Params> {
484 typedef ViewMsg_UploadFile_Params param_type;
485 static void Write(IPC::Message* m, const param_type& p) {
486 WriteParam(m, p.file_path);
487 WriteParam(m, p.form);
488 WriteParam(m, p.file);
489 WriteParam(m, p.submit);
490 WriteParam(m, p.other_values);
491 }
492 static bool Read(const IPC::Message* m, void** iter, param_type* p) {
493 return
494 ReadParam(m, iter, &p->file_path) &&
495 ReadParam(m, iter, &p->form) &&
496 ReadParam(m, iter, &p->file) &&
497 ReadParam(m, iter, &p->submit) &&
498 ReadParam(m, iter, &p->other_values);
499 }
500 static void Log(const param_type& p, std::wstring* l) {
501 l->append(L"<ViewMsg_UploadFile_Params>");
502 }
503 };
504
505
506 struct ViewHostMsg_Resource_Request { 264 struct ViewHostMsg_Resource_Request {
507 // The request method: GET, POST, etc. 265 // The request method: GET, POST, etc.
508 std::string method; 266 std::string method;
509 267
510 // The requested URL. 268 // The requested URL.
511 GURL url; 269 GURL url;
512 270
513 // The URL of the document in the top-level window, which may be checked by 271 // The URL of the document in the top-level window, which may be checked by
514 // the third-party cookie blocking policy. Leaving it empty may lead to 272 // the third-party cookie blocking policy. Leaving it empty may lead to
515 // undesired cookie blocking. Third-party cookie blocking can be bypassed by 273 // undesired cookie blocking. Third-party cookie blocking can be bypassed by
(...skipping 21 matching lines...) Expand all
537 // was loaded over HTTPS. 295 // was loaded over HTTPS.
538 bool mixed_content; 296 bool mixed_content;
539 297
540 // Used by plugin->browser requests to get the correct URLRequestContext. 298 // Used by plugin->browser requests to get the correct URLRequestContext.
541 uint32 request_context; 299 uint32 request_context;
542 300
543 // Optional upload data (may be empty). 301 // Optional upload data (may be empty).
544 std::vector<net::UploadData::Element> upload_content; 302 std::vector<net::UploadData::Element> upload_content;
545 }; 303 };
546 304
547 template <> 305 // Parameters for a resource response header.
548 struct ParamTraits<ViewHostMsg_Resource_Request> {
549 typedef ViewHostMsg_Resource_Request param_type;
550 static void Write(IPC::Message* m, const param_type& p) {
551 WriteParam(m, p.method);
552 WriteParam(m, p.url);
553 WriteParam(m, p.policy_url);
554 WriteParam(m, p.referrer);
555 WriteParam(m, p.headers);
556 WriteParam(m, p.load_flags);
557 WriteParam(m, p.origin_pid);
558 WriteParam(m, p.resource_type);
559 WriteParam(m, p.mixed_content);
560 WriteParam(m, p.request_context);
561 WriteParam(m, p.upload_content);
562 }
563 static bool Read(const IPC::Message* m, void** iter, param_type* r) {
564 return
565 ReadParam(m, iter, &r->method) &&
566 ReadParam(m, iter, &r->url) &&
567 ReadParam(m, iter, &r->policy_url) &&
568 ReadParam(m, iter, &r->referrer) &&
569 ReadParam(m, iter, &r->headers) &&
570 ReadParam(m, iter, &r->load_flags) &&
571 ReadParam(m, iter, &r->origin_pid) &&
572 ReadParam(m, iter, &r->resource_type) &&
573 ReadParam(m, iter, &r->mixed_content) &&
574 ReadParam(m, iter, &r->request_context) &&
575 ReadParam(m, iter, &r->upload_content);
576 }
577 static void Log(const param_type& p, std::wstring* l) {
578 l->append(L"(");
579 LogParam(p.method, l);
580 l->append(L", ");
581 LogParam(p.url, l);
582 l->append(L", ");
583 LogParam(p.referrer, l);
584 l->append(L", ");
585 LogParam(p.load_flags, l);
586 l->append(L", ");
587 LogParam(p.origin_pid, l);
588 l->append(L", ");
589 LogParam(p.resource_type, l);
590 l->append(L", ");
591 LogParam(p.mixed_content, l);
592 l->append(L", ");
593 LogParam(p.request_context, l);
594 l->append(L")");
595 }
596 };
597
598
599 struct ViewMsg_Resource_ResponseHead 306 struct ViewMsg_Resource_ResponseHead
600 : webkit_glue::ResourceLoaderBridge::ResponseInfo { 307 : webkit_glue::ResourceLoaderBridge::ResponseInfo {
601 // The response status. 308 // The response status.
602 URLRequestStatus status; 309 URLRequestStatus status;
603 310
604 // Specifies if the resource should be filtered before being displayed 311 // Specifies if the resource should be filtered before being displayed
605 // (insecure resources can be filtered to keep the page secure). 312 // (insecure resources can be filtered to keep the page secure).
606 FilterPolicy::Type filter_policy; 313 FilterPolicy::Type filter_policy;
607 }; 314 };
608 315
609 template <> 316 // Parameters for a synchronous resource response.
610 struct ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo> {
611 typedef webkit_glue::ResourceLoaderBridge::ResponseInfo param_type;
612 static void Write(IPC::Message* m, const param_type& p) {
613 WriteParam(m, p.request_time);
614 WriteParam(m, p.response_time);
615 WriteParam(m, p.headers);
616 WriteParam(m, p.mime_type);
617 WriteParam(m, p.charset);
618 WriteParam(m, p.security_info);
619 WriteParam(m, p.content_length);
620 }
621 static bool Read(const IPC::Message* m, void** iter, param_type* r) {
622 return
623 ReadParam(m, iter, &r->request_time) &&
624 ReadParam(m, iter, &r->response_time) &&
625 ReadParam(m, iter, &r->headers) &&
626 ReadParam(m, iter, &r->mime_type) &&
627 ReadParam(m, iter, &r->charset) &&
628 ReadParam(m, iter, &r->security_info) &&
629 ReadParam(m, iter, &r->content_length);
630 }
631 static void Log(const param_type& p, std::wstring* l) {
632 l->append(L"(");
633 LogParam(p.request_time, l);
634 l->append(L", ");
635 LogParam(p.response_time, l);
636 l->append(L", ");
637 LogParam(p.headers, l);
638 l->append(L", ");
639 LogParam(p.mime_type, l);
640 l->append(L", ");
641 LogParam(p.charset, l);
642 l->append(L", ");
643 LogParam(p.security_info, l);
644 l->append(L")");
645 }
646 };
647
648 template <>
649 struct ParamTraits<ViewMsg_Resource_ResponseHead> {
650 typedef ViewMsg_Resource_ResponseHead param_type;
651 static void Write(IPC::Message* m, const param_type& p) {
652 ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo>::Write(m, p);
653 WriteParam(m, p.status);
654 WriteParam(m, p.filter_policy);
655 }
656 static bool Read(const IPC::Message* m, void** iter, param_type* r) {
657 return
658 ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo>::Read(m, iter , r) &&
659 ReadParam(m, iter, &r->status) &&
660 ReadParam(m, iter, &r->filter_policy);
661 }
662 static void Log(const param_type& p, std::wstring* l) {
663 // log more?
664 ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo>::Log(p, l);
665 }
666 };
667
668
669 struct ViewHostMsg_SyncLoad_Result : ViewMsg_Resource_ResponseHead { 317 struct ViewHostMsg_SyncLoad_Result : ViewMsg_Resource_ResponseHead {
670 // The final URL after any redirects. 318 // The final URL after any redirects.
671 GURL final_url; 319 GURL final_url;
672 320
673 // The response data. 321 // The response data.
674 std::string data; 322 std::string data;
675 }; 323 };
676 324
677 template <> 325 // Parameters for a render request.
678 struct ParamTraits<ViewHostMsg_SyncLoad_Result> {
679 typedef ViewHostMsg_SyncLoad_Result param_type;
680 static void Write(IPC::Message* m, const param_type& p) {
681 ParamTraits<ViewMsg_Resource_ResponseHead>::Write(m, p);
682 WriteParam(m, p.final_url);
683 WriteParam(m, p.data);
684 }
685 static bool Read(const IPC::Message* m, void** iter, param_type* r) {
686 return
687 ParamTraits<ViewMsg_Resource_ResponseHead>::Read(m, iter, r) &&
688 ReadParam(m, iter, &r->final_url) &&
689 ReadParam(m, iter, &r->data);
690 }
691 static void Log(const param_type& p, std::wstring* l) {
692 // log more?
693 ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo>::Log(p, l);
694 }
695 };
696
697
698 struct ViewMsg_Print_Params { 326 struct ViewMsg_Print_Params {
699 // In pixels according to dpi_x and dpi_y. 327 // In pixels according to dpi_x and dpi_y.
700 gfx::Size printable_size; 328 gfx::Size printable_size;
701 329
702 // Specifies dots per inch. 330 // Specifies dots per inch.
703 double dpi; 331 double dpi;
704 332
705 // Minimum shrink factor. See PrintSettings::min_shrink for more information. 333 // Minimum shrink factor. See PrintSettings::min_shrink for more information.
706 double min_shrink; 334 double min_shrink;
707 335
708 // Maximum shrink factor. See PrintSettings::max_shrink for more information. 336 // Maximum shrink factor. See PrintSettings::max_shrink for more information.
709 double max_shrink; 337 double max_shrink;
710 338
711 // Desired apparent dpi on paper. 339 // Desired apparent dpi on paper.
712 int desired_dpi; 340 int desired_dpi;
713 341
714 // Cookie for the document to ensure correctness. 342 // Cookie for the document to ensure correctness.
715 int document_cookie; 343 int document_cookie;
716 344
717 // Warning: do not compare document_cookie. 345 // Warning: do not compare document_cookie.
718 bool Equals(const ViewMsg_Print_Params& rhs) const { 346 bool Equals(const ViewMsg_Print_Params& rhs) const {
719 return printable_size == rhs.printable_size && 347 return printable_size == rhs.printable_size &&
720 dpi == rhs.dpi && 348 dpi == rhs.dpi &&
721 min_shrink == rhs.min_shrink && 349 min_shrink == rhs.min_shrink &&
722 max_shrink == rhs.max_shrink && 350 max_shrink == rhs.max_shrink &&
723 desired_dpi == rhs.desired_dpi; 351 desired_dpi == rhs.desired_dpi;
724 } 352 }
725 }; 353 };
726 354
727 template <>
728 struct ParamTraits<ViewMsg_Print_Params> {
729 typedef ViewMsg_Print_Params param_type;
730 static void Write(IPC::Message* m, const param_type& p) {
731 WriteParam(m, p.printable_size);
732 WriteParam(m, p.dpi);
733 WriteParam(m, p.min_shrink);
734 WriteParam(m, p.max_shrink);
735 WriteParam(m, p.desired_dpi);
736 WriteParam(m, p.document_cookie);
737 }
738 static bool Read(const IPC::Message* m, void** iter, param_type* p) {
739 return ReadParam(m, iter, &p->printable_size) &&
740 ReadParam(m, iter, &p->dpi) &&
741 ReadParam(m, iter, &p->min_shrink) &&
742 ReadParam(m, iter, &p->max_shrink) &&
743 ReadParam(m, iter, &p->desired_dpi) &&
744 ReadParam(m, iter, &p->document_cookie);
745 }
746 static void Log(const param_type& p, std::wstring* l) {
747 l->append(L"<ViewMsg_Print_Params>");
748 }
749 };
750
751
752 struct ViewMsg_PrintPage_Params { 355 struct ViewMsg_PrintPage_Params {
753 // Parameters to render the page as a printed page. It must always be the same 356 // Parameters to render the page as a printed page. It must always be the same
754 // value for all the document. 357 // value for all the document.
755 ViewMsg_Print_Params params; 358 ViewMsg_Print_Params params;
756 359
757 // The page number is the indicator of the square that should be rendered 360 // The page number is the indicator of the square that should be rendered
758 // according to the layout specified in ViewMsg_Print_Params. 361 // according to the layout specified in ViewMsg_Print_Params.
759 int page_number; 362 int page_number;
760 }; 363 };
761 364
762 template <>
763 struct ParamTraits<ViewMsg_PrintPage_Params> {
764 typedef ViewMsg_PrintPage_Params param_type;
765 static void Write(IPC::Message* m, const param_type& p) {
766 WriteParam(m, p.params);
767 WriteParam(m, p.page_number);
768 }
769 static bool Read(const IPC::Message* m, void** iter, param_type* p) {
770 return ReadParam(m, iter, &p->params) &&
771 ReadParam(m, iter, &p->page_number);
772 }
773 static void Log(const param_type& p, std::wstring* l) {
774 l->append(L"<ViewMsg_PrintPage_Params>");
775 }
776 };
777
778
779 struct ViewMsg_PrintPages_Params { 365 struct ViewMsg_PrintPages_Params {
780 // Parameters to render the page as a printed page. It must always be the same 366 // Parameters to render the page as a printed page. It must always be the same
781 // value for all the document. 367 // value for all the document.
782 ViewMsg_Print_Params params; 368 ViewMsg_Print_Params params;
783 369
784 // If empty, this means a request to render all the printed pages. 370 // If empty, this means a request to render all the printed pages.
785 std::vector<int> pages; 371 std::vector<int> pages;
786 }; 372 };
787 373
788 template <>
789 struct ParamTraits<ViewMsg_PrintPages_Params> {
790 typedef ViewMsg_PrintPages_Params param_type;
791 static void Write(IPC::Message* m, const param_type& p) {
792 WriteParam(m, p.params);
793 WriteParam(m, p.pages);
794 }
795 static bool Read(const IPC::Message* m, void** iter, param_type* p) {
796 return ReadParam(m, iter, &p->params) &&
797 ReadParam(m, iter, &p->pages);
798 }
799 static void Log(const param_type& p, std::wstring* l) {
800 l->append(L"<ViewMsg_PrintPages_Params>");
801 }
802 };
803
804
805 // Parameters to describe a rendered page. 374 // Parameters to describe a rendered page.
806 struct ViewHostMsg_DidPrintPage_Params { 375 struct ViewHostMsg_DidPrintPage_Params {
807 // A shared memory handle to the EMF data. This data can be quite large so a 376 // A shared memory handle to the EMF data. This data can be quite large so a
808 // memory map needs to be used. 377 // memory map needs to be used.
809 base::SharedMemoryHandle emf_data_handle; 378 base::SharedMemoryHandle emf_data_handle;
810 379
811 // Size of the EMF data. 380 // Size of the EMF data.
812 unsigned data_size; 381 unsigned data_size;
813 382
814 // Cookie for the document to ensure correctness. 383 // Cookie for the document to ensure correctness.
815 int document_cookie; 384 int document_cookie;
816 385
817 // Page number. 386 // Page number.
818 int page_number; 387 int page_number;
819 388
820 // Shrink factor used to render this page. 389 // Shrink factor used to render this page.
821 double actual_shrink; 390 double actual_shrink;
822 }; 391 };
823 392
824 template <>
825 struct ParamTraits<ViewHostMsg_DidPrintPage_Params> {
826 typedef ViewHostMsg_DidPrintPage_Params param_type;
827 static void Write(IPC::Message* m, const param_type& p) {
828 WriteParam(m, p.emf_data_handle);
829 WriteParam(m, p.data_size);
830 WriteParam(m, p.document_cookie);
831 WriteParam(m, p.page_number);
832 WriteParam(m, p.actual_shrink);
833 }
834 static bool Read(const IPC::Message* m, void** iter, param_type* p) {
835 return ReadParam(m, iter, &p->emf_data_handle) &&
836 ReadParam(m, iter, &p->data_size) &&
837 ReadParam(m, iter, &p->document_cookie) &&
838 ReadParam(m, iter, &p->page_number) &&
839 ReadParam(m, iter, &p->actual_shrink);
840 }
841 static void Log(const param_type& p, std::wstring* l) {
842 l->append(L"<ViewHostMsg_DidPrintPage_Params>");
843 }
844 };
845
846
847 // Parameters structure to hold a union of the possible IAccessible function 393 // Parameters structure to hold a union of the possible IAccessible function
848 // INPUT variables, with the unused fields always set to default value. Used in 394 // INPUT variables, with the unused fields always set to default value. Used in
849 // ViewMsg_GetAccessibilityInfo, as only parameter. 395 // ViewMsg_GetAccessibilityInfo, as only parameter.
850 struct ViewMsg_Accessibility_In_Params { 396 struct ViewMsg_Accessibility_In_Params {
851 // Identifier to uniquely distinguish which instance of IAccessible is being 397 // Identifier to uniquely distinguish which instance of IAccessible is being
852 // called upon on the renderer side. 398 // called upon on the renderer side.
853 int iaccessible_id; 399 int iaccessible_id;
854 400
855 // Identifier to resolve which IAccessible interface function is being called. 401 // Identifier to resolve which IAccessible interface function is being called.
856 int iaccessible_function_id; 402 int iaccessible_function_id;
857 403
858 // Function input parameters. 404 // Function input parameters.
859 // Input VARIANT structure's LONG field to specify requested object. 405 // Input VARIANT structure's LONG field to specify requested object.
860 long input_variant_lval; 406 long input_variant_lval;
861 407
862 // LONG input parameters, used differently depending on the function called. 408 // LONG input parameters, used differently depending on the function called.
863 long input_long1; 409 long input_long1;
864 long input_long2; 410 long input_long2;
865 }; 411 };
866 412
867 template <>
868 struct ParamTraits<ViewMsg_Accessibility_In_Params> {
869 typedef ViewMsg_Accessibility_In_Params param_type;
870 static void Write(IPC::Message* m, const param_type& p) {
871 WriteParam(m, p.iaccessible_id);
872 WriteParam(m, p.iaccessible_function_id);
873 WriteParam(m, p.input_variant_lval);
874 WriteParam(m, p.input_long1);
875 WriteParam(m, p.input_long2);
876 }
877 static bool Read(const IPC::Message* m, void** iter, param_type* p) {
878 return
879 ReadParam(m, iter, &p->iaccessible_id) &&
880 ReadParam(m, iter, &p->iaccessible_function_id) &&
881 ReadParam(m, iter, &p->input_variant_lval) &&
882 ReadParam(m, iter, &p->input_long1) &&
883 ReadParam(m, iter, &p->input_long2);
884 }
885 static void Log(const param_type& p, std::wstring* l) {
886 l->append(L"(");
887 LogParam(p.iaccessible_id, l);
888 l->append(L", ");
889 LogParam(p.iaccessible_function_id, l);
890 l->append(L", ");
891 LogParam(p.input_variant_lval, l);
892 l->append(L", ");
893 LogParam(p.input_long1, l);
894 l->append(L", ");
895 LogParam(p.input_long2, l);
896 l->append(L")");
897 }
898 };
899
900
901 // Parameters structure to hold a union of the possible IAccessible function 413 // Parameters structure to hold a union of the possible IAccessible function
902 // OUTPUT variables, with the unused fields always set to default value. Used in 414 // OUTPUT variables, with the unused fields always set to default value. Used in
903 // ViewHostMsg_GetAccessibilityInfoResponse, as only parameter. 415 // ViewHostMsg_GetAccessibilityInfoResponse, as only parameter.
904 struct ViewHostMsg_Accessibility_Out_Params { 416 struct ViewHostMsg_Accessibility_Out_Params {
905 // Identifier to uniquely distinguish which instance of IAccessible is being 417 // Identifier to uniquely distinguish which instance of IAccessible is being
906 // called upon on the renderer side. 418 // called upon on the renderer side.
907 int iaccessible_id; 419 int iaccessible_id;
908 420
909 // Function output parameters. 421 // Function output parameters.
910 // Output VARIANT structure's LONG field to specify requested object. 422 // Output VARIANT structure's LONG field to specify requested object.
911 long output_variant_lval; 423 long output_variant_lval;
912 424
913 // LONG output parameters, used differently depending on the function called. 425 // LONG output parameters, used differently depending on the function called.
914 // output_long1 can in some cases be set to -1 to indicate that the child 426 // output_long1 can in some cases be set to -1 to indicate that the child
915 // object found by the called IAccessible function is not a simple object. 427 // object found by the called IAccessible function is not a simple object.
916 long output_long1; 428 long output_long1;
917 long output_long2; 429 long output_long2;
918 long output_long3; 430 long output_long3;
919 long output_long4; 431 long output_long4;
920 432
921 // String output parameter. 433 // String output parameter.
922 std::wstring output_string; 434 std::wstring output_string;
923 435
924 // Return code, either S_OK (true) or S_FALSE (false). WebKit MSAA error 436 // Return code, either S_OK (true) or S_FALSE (false). WebKit MSAA error
925 // return codes (E_POINTER, E_INVALIDARG, E_FAIL, E_NOTIMPL) must be handled 437 // return codes (E_POINTER, E_INVALIDARG, E_FAIL, E_NOTIMPL) must be handled
926 // on the browser side by input validation. 438 // on the browser side by input validation.
927 bool return_code; 439 bool return_code;
928 }; 440 };
929 441
930 template <>
931 struct ParamTraits<ViewHostMsg_Accessibility_Out_Params> {
932 typedef ViewHostMsg_Accessibility_Out_Params param_type;
933 static void Write(IPC::Message* m, const param_type& p) {
934 WriteParam(m, p.iaccessible_id);
935 WriteParam(m, p.output_variant_lval);
936 WriteParam(m, p.output_long1);
937 WriteParam(m, p.output_long2);
938 WriteParam(m, p.output_long3);
939 WriteParam(m, p.output_long4);
940 WriteParam(m, p.output_string);
941 WriteParam(m, p.return_code);
942 }
943 static bool Read(const IPC::Message* m, void** iter, param_type* p) {
944 return
945 ReadParam(m, iter, &p->iaccessible_id) &&
946 ReadParam(m, iter, &p->output_variant_lval) &&
947 ReadParam(m, iter, &p->output_long1) &&
948 ReadParam(m, iter, &p->output_long2) &&
949 ReadParam(m, iter, &p->output_long3) &&
950 ReadParam(m, iter, &p->output_long4) &&
951 ReadParam(m, iter, &p->output_string) &&
952 ReadParam(m, iter, &p->return_code);
953 }
954 static void Log(const param_type& p, std::wstring* l) {
955 l->append(L"(");
956 LogParam(p.iaccessible_id, l);
957 l->append(L", ");
958 LogParam(p.output_variant_lval, l);
959 l->append(L", ");
960 LogParam(p.output_long1, l);
961 l->append(L", ");
962 LogParam(p.output_long2, l);
963 l->append(L", ");
964 LogParam(p.output_long3, l);
965 l->append(L", ");
966 LogParam(p.output_long4, l);
967 l->append(L", ");
968 LogParam(p.output_string, l);
969 l->append(L", ");
970 LogParam(p.return_code, l);
971 l->append(L")");
972 }
973 };
974
975
976 // The first parameter for the ViewHostMsg_ImeUpdateStatus message. 442 // The first parameter for the ViewHostMsg_ImeUpdateStatus message.
977 enum ViewHostMsg_ImeControl { 443 enum ViewHostMsg_ImeControl {
978 IME_DISABLE = 0, 444 IME_DISABLE = 0,
979 IME_MOVE_WINDOWS, 445 IME_MOVE_WINDOWS,
980 IME_COMPLETE_COMPOSITION, 446 IME_COMPLETE_COMPOSITION,
981 }; 447 };
982 448
983 template <> 449 // Multi-pass include of render_messages_internal. Preprocessor magic allows
984 struct ParamTraits<ViewHostMsg_ImeControl> { 450 // us to use 1 header to define the enums and classes for our render messages.
985 typedef ViewHostMsg_ImeControl param_type; 451 #define IPC_MESSAGE_MACROS_ENUMS
986 static void Write(IPC::Message* m, const param_type& p) { 452 #include "chrome/common/render_messages_internal.h"
987 m->WriteInt(p);
988 }
989 static bool Read(const IPC::Message* m, void** iter, param_type* p) {
990 int type;
991 if (!m->ReadInt(iter, &type))
992 return false;
993 *p = static_cast<ViewHostMsg_ImeControl>(type);
994 return true;
995 }
996 static void Log(const param_type& p, std::wstring* l) {
997 std::wstring control;
998 switch (p) {
999 case IME_DISABLE:
1000 control = L"IME_DISABLE";
1001 break;
1002 case IME_MOVE_WINDOWS:
1003 control = L"IME_MOVE_WINDOWS";
1004 break;
1005 case IME_COMPLETE_COMPOSITION:
1006 control = L"IME_COMPLETE_COMPOSITION";
1007 break;
1008 default:
1009 control = L"UNKNOWN";
1010 break;
1011 }
1012 453
1013 LogParam(control, l); 454 #ifdef IPC_MESSAGE_MACROS_LOG_ENABLED
1014 } 455 // When we are supposed to create debug strings, we run it through twice, once
1015 }; 456 // with debug strings on, and once with only CLASSES on to generate both types
457 // of messages.
458 # undef IPC_MESSAGE_MACROS_LOG
459 # define IPC_MESSAGE_MACROS_CLASSES
460 # include "chrome/common/render_messages_internal.h"
461
462 # undef IPC_MESSAGE_MACROS_CLASSES
463 # define IPC_MESSAGE_MACROS_LOG
464 # include "chrome/common/render_messages_internal.h"
465 #else
466 // No debug strings requested, just define the classes
467 # define IPC_MESSAGE_MACROS_CLASSES
468 # include "chrome/common/render_messages_internal.h"
469 #endif
1016 470
1017 471
1018 // These traits are for structures that are defined outside of this file. 472 namespace IPC {
473
1019 template <> 474 template <>
1020 struct ParamTraits<ResourceType::Type> { 475 struct ParamTraits<ResourceType::Type> {
1021 typedef ResourceType::Type param_type; 476 typedef ResourceType::Type param_type;
1022 static void Write(IPC::Message* m, const param_type& p) { 477 static void Write(Message* m, const param_type& p) {
1023 m->WriteInt(p); 478 m->WriteInt(p);
1024 } 479 }
1025 static bool Read(const IPC::Message* m, void** iter, param_type* p) { 480 static bool Read(const Message* m, void** iter, param_type* p) {
1026 int type; 481 int type;
1027 if (!m->ReadInt(iter, &type) || !ResourceType::ValidType(type)) 482 if (!m->ReadInt(iter, &type) || !ResourceType::ValidType(type))
1028 return false; 483 return false;
1029 *p = ResourceType::FromInt(type); 484 *p = ResourceType::FromInt(type);
1030 return true; 485 return true;
1031 } 486 }
1032 static void Log(const param_type& p, std::wstring* l) { 487 static void Log(const param_type& p, std::wstring* l) {
1033 std::wstring type; 488 std::wstring type;
1034 switch (p) { 489 switch (p) {
1035 case ResourceType::MAIN_FRAME: 490 case ResourceType::MAIN_FRAME:
(...skipping 13 matching lines...) Expand all
1049 break; 504 break;
1050 } 505 }
1051 506
1052 LogParam(type, l); 507 LogParam(type, l);
1053 } 508 }
1054 }; 509 };
1055 510
1056 template <> 511 template <>
1057 struct ParamTraits<FilterPolicy::Type> { 512 struct ParamTraits<FilterPolicy::Type> {
1058 typedef FilterPolicy::Type param_type; 513 typedef FilterPolicy::Type param_type;
1059 static void Write(IPC::Message* m, const param_type& p) { 514 static void Write(Message* m, const param_type& p) {
1060 m->WriteInt(p); 515 m->WriteInt(p);
1061 } 516 }
1062 static bool Read(const IPC::Message* m, void** iter, param_type* p) { 517 static bool Read(const Message* m, void** iter, param_type* p) {
1063 int type; 518 int type;
1064 if (!m->ReadInt(iter, &type) || !FilterPolicy::ValidType(type)) 519 if (!m->ReadInt(iter, &type) || !FilterPolicy::ValidType(type))
1065 return false; 520 return false;
1066 *p = FilterPolicy::FromInt(type); 521 *p = FilterPolicy::FromInt(type);
1067 return true; 522 return true;
1068 } 523 }
1069 static void Log(const param_type& p, std::wstring* l) { 524 static void Log(const param_type& p, std::wstring* l) {
1070 std::wstring type; 525 std::wstring type;
1071 switch (p) { 526 switch (p) {
1072 case FilterPolicy::DONT_FILTER: 527 case FilterPolicy::DONT_FILTER:
(...skipping 10 matching lines...) Expand all
1083 break; 538 break;
1084 } 539 }
1085 540
1086 LogParam(type, l); 541 LogParam(type, l);
1087 } 542 }
1088 }; 543 };
1089 544
1090 template <> 545 template <>
1091 struct ParamTraits<ContextNode> { 546 struct ParamTraits<ContextNode> {
1092 typedef ContextNode param_type; 547 typedef ContextNode param_type;
1093 static void Write(IPC::Message* m, const param_type& p) { 548 static void Write(Message* m, const param_type& p) {
1094 m->WriteInt(p.type); 549 m->WriteInt(p.type);
1095 } 550 }
1096 static bool Read(const IPC::Message* m, void** iter, param_type* p) { 551 static bool Read(const Message* m, void** iter, param_type* p) {
1097 int type; 552 int type;
1098 if (!m->ReadInt(iter, &type)) 553 if (!m->ReadInt(iter, &type))
1099 return false; 554 return false;
1100 *p = ContextNode(type); 555 *p = ContextNode(type);
1101 return true; 556 return true;
1102 } 557 }
1103 static void Log(const param_type& p, std::wstring* l) { 558 static void Log(const param_type& p, std::wstring* l) {
1104 std::wstring event = L""; 559 std::wstring event = L"";
1105 560
1106 if (!p.type) { 561 if (!p.type) {
(...skipping 17 matching lines...) Expand all
1124 event.append(L")"); 579 event.append(L")");
1125 } 580 }
1126 581
1127 LogParam(event, l); 582 LogParam(event, l);
1128 } 583 }
1129 }; 584 };
1130 585
1131 template <> 586 template <>
1132 struct ParamTraits<WebInputEvent::Type> { 587 struct ParamTraits<WebInputEvent::Type> {
1133 typedef WebInputEvent::Type param_type; 588 typedef WebInputEvent::Type param_type;
1134 static void Write(IPC::Message* m, const param_type& p) { 589 static void Write(Message* m, const param_type& p) {
1135 m->WriteInt(p); 590 m->WriteInt(p);
1136 } 591 }
1137 static bool Read(const IPC::Message* m, void** iter, param_type* p) { 592 static bool Read(const Message* m, void** iter, param_type* p) {
1138 int type; 593 int type;
1139 if (!m->ReadInt(iter, &type)) 594 if (!m->ReadInt(iter, &type))
1140 return false; 595 return false;
1141 *p = static_cast<WebInputEvent::Type>(type); 596 *p = static_cast<WebInputEvent::Type>(type);
1142 return true; 597 return true;
1143 } 598 }
1144 static void Log(const param_type& p, std::wstring* l) { 599 static void Log(const param_type& p, std::wstring* l) {
1145 std::wstring type; 600 std::wstring type;
1146 switch (p) { 601 switch (p) {
1147 case WebInputEvent::MOUSE_DOWN: 602 case WebInputEvent::MOUSE_DOWN:
(...skipping 22 matching lines...) Expand all
1170 break; 625 break;
1171 default: 626 default:
1172 type = L"UNKNOWN"; 627 type = L"UNKNOWN";
1173 break; 628 break;
1174 } 629 }
1175 630
1176 LogParam(type, l); 631 LogParam(type, l);
1177 } 632 }
1178 }; 633 };
1179 634
635 // Traits for ViewMsg_Accessibility_In_Params structure to pack/unpack.
636 template <>
637 struct ParamTraits<ViewMsg_Accessibility_In_Params> {
638 typedef ViewMsg_Accessibility_In_Params param_type;
639 static void Write(Message* m, const param_type& p) {
640 WriteParam(m, p.iaccessible_id);
641 WriteParam(m, p.iaccessible_function_id);
642 WriteParam(m, p.input_variant_lval);
643 WriteParam(m, p.input_long1);
644 WriteParam(m, p.input_long2);
645 }
646 static bool Read(const Message* m, void** iter, param_type* p) {
647 return
648 ReadParam(m, iter, &p->iaccessible_id) &&
649 ReadParam(m, iter, &p->iaccessible_function_id) &&
650 ReadParam(m, iter, &p->input_variant_lval) &&
651 ReadParam(m, iter, &p->input_long1) &&
652 ReadParam(m, iter, &p->input_long2);
653 }
654 static void Log(const param_type& p, std::wstring* l) {
655 l->append(L"(");
656 LogParam(p.iaccessible_id, l);
657 l->append(L", ");
658 LogParam(p.iaccessible_function_id, l);
659 l->append(L", ");
660 LogParam(p.input_variant_lval, l);
661 l->append(L", ");
662 LogParam(p.input_long1, l);
663 l->append(L", ");
664 LogParam(p.input_long2, l);
665 l->append(L")");
666 }
667 };
668
669 // Traits for ViewHostMsg_Accessibility_Out_Params structure to pack/unpack.
670 template <>
671 struct ParamTraits<ViewHostMsg_Accessibility_Out_Params> {
672 typedef ViewHostMsg_Accessibility_Out_Params param_type;
673 static void Write(Message* m, const param_type& p) {
674 WriteParam(m, p.iaccessible_id);
675 WriteParam(m, p.output_variant_lval);
676 WriteParam(m, p.output_long1);
677 WriteParam(m, p.output_long2);
678 WriteParam(m, p.output_long3);
679 WriteParam(m, p.output_long4);
680 WriteParam(m, p.output_string);
681 WriteParam(m, p.return_code);
682 }
683 static bool Read(const Message* m, void** iter, param_type* p) {
684 return
685 ReadParam(m, iter, &p->iaccessible_id) &&
686 ReadParam(m, iter, &p->output_variant_lval) &&
687 ReadParam(m, iter, &p->output_long1) &&
688 ReadParam(m, iter, &p->output_long2) &&
689 ReadParam(m, iter, &p->output_long3) &&
690 ReadParam(m, iter, &p->output_long4) &&
691 ReadParam(m, iter, &p->output_string) &&
692 ReadParam(m, iter, &p->return_code);
693 }
694 static void Log(const param_type& p, std::wstring* l) {
695 l->append(L"(");
696 LogParam(p.iaccessible_id, l);
697 l->append(L", ");
698 LogParam(p.output_variant_lval, l);
699 l->append(L", ");
700 LogParam(p.output_long1, l);
701 l->append(L", ");
702 LogParam(p.output_long2, l);
703 l->append(L", ");
704 LogParam(p.output_long3, l);
705 l->append(L", ");
706 LogParam(p.output_long4, l);
707 l->append(L", ");
708 LogParam(p.output_string, l);
709 l->append(L", ");
710 LogParam(p.return_code, l);
711 l->append(L")");
712 }
713 };
714
1180 template <> 715 template <>
716 struct ParamTraits<ViewHostMsg_ImeControl> {
717 typedef ViewHostMsg_ImeControl param_type;
718 static void Write(Message* m, const param_type& p) {
719 m->WriteInt(p);
720 }
721 static bool Read(const Message* m, void** iter, param_type* p) {
722 int type;
723 if (!m->ReadInt(iter, &type))
724 return false;
725 *p = static_cast<ViewHostMsg_ImeControl>(type);
726 return true;
727 }
728 static void Log(const param_type& p, std::wstring* l) {
729 std::wstring control;
730 switch (p) {
731 case IME_DISABLE:
732 control = L"IME_DISABLE";
733 break;
734 case IME_MOVE_WINDOWS:
735 control = L"IME_MOVE_WINDOWS";
736 break;
737 case IME_COMPLETE_COMPOSITION:
738 control = L"IME_COMPLETE_COMPOSITION";
739 break;
740 default:
741 control = L"UNKNOWN";
742 break;
743 }
744
745 LogParam(control, l);
746 }
747 };
748
749 // Traits for ViewMsg_Navigate_Params structure to pack/unpack.
750 template <>
751 struct ParamTraits<ViewMsg_Navigate_Params> {
752 typedef ViewMsg_Navigate_Params param_type;
753 static void Write(Message* m, const param_type& p) {
754 WriteParam(m, p.page_id);
755 WriteParam(m, p.url);
756 WriteParam(m, p.referrer);
757 WriteParam(m, p.transition);
758 WriteParam(m, p.state);
759 WriteParam(m, p.reload);
760 }
761 static bool Read(const Message* m, void** iter, param_type* p) {
762 return
763 ReadParam(m, iter, &p->page_id) &&
764 ReadParam(m, iter, &p->url) &&
765 ReadParam(m, iter, &p->referrer) &&
766 ReadParam(m, iter, &p->transition) &&
767 ReadParam(m, iter, &p->state) &&
768 ReadParam(m, iter, &p->reload);
769 }
770 static void Log(const param_type& p, std::wstring* l) {
771 l->append(L"(");
772 LogParam(p.page_id, l);
773 l->append(L", ");
774 LogParam(p.url, l);
775 l->append(L", ");
776 LogParam(p.transition, l);
777 l->append(L", ");
778 LogParam(p.state, l);
779 l->append(L", ");
780 LogParam(p.reload, l);
781 l->append(L")");
782 }
783 };
784
785 // Traits for PasswordForm_Params structure to pack/unpack.
786 template <>
1181 struct ParamTraits<PasswordForm> { 787 struct ParamTraits<PasswordForm> {
1182 typedef PasswordForm param_type; 788 typedef PasswordForm param_type;
1183 static void Write(IPC::Message* m, const param_type& p) { 789 static void Write(Message* m, const param_type& p) {
1184 WriteParam(m, p.signon_realm); 790 WriteParam(m, p.signon_realm);
1185 WriteParam(m, p.origin); 791 WriteParam(m, p.origin);
1186 WriteParam(m, p.action); 792 WriteParam(m, p.action);
1187 WriteParam(m, p.submit_element); 793 WriteParam(m, p.submit_element);
1188 WriteParam(m, p.username_element); 794 WriteParam(m, p.username_element);
1189 WriteParam(m, p.username_value); 795 WriteParam(m, p.username_value);
1190 WriteParam(m, p.password_element); 796 WriteParam(m, p.password_element);
1191 WriteParam(m, p.password_value); 797 WriteParam(m, p.password_value);
1192 WriteParam(m, p.old_password_element); 798 WriteParam(m, p.old_password_element);
1193 WriteParam(m, p.old_password_value); 799 WriteParam(m, p.old_password_value);
1194 WriteParam(m, p.ssl_valid); 800 WriteParam(m, p.ssl_valid);
1195 WriteParam(m, p.preferred); 801 WriteParam(m, p.preferred);
1196 WriteParam(m, p.blacklisted_by_user); 802 WriteParam(m, p.blacklisted_by_user);
1197 } 803 }
1198 static bool Read(const IPC::Message* m, void** iter, param_type* p) { 804 static bool Read(const Message* m, void** iter, param_type* p) {
1199 return 805 return
1200 ReadParam(m, iter, &p->signon_realm) && 806 ReadParam(m, iter, &p->signon_realm) &&
1201 ReadParam(m, iter, &p->origin) && 807 ReadParam(m, iter, &p->origin) &&
1202 ReadParam(m, iter, &p->action) && 808 ReadParam(m, iter, &p->action) &&
1203 ReadParam(m, iter, &p->submit_element) && 809 ReadParam(m, iter, &p->submit_element) &&
1204 ReadParam(m, iter, &p->username_element) && 810 ReadParam(m, iter, &p->username_element) &&
1205 ReadParam(m, iter, &p->username_value) && 811 ReadParam(m, iter, &p->username_value) &&
1206 ReadParam(m, iter, &p->password_element) && 812 ReadParam(m, iter, &p->password_element) &&
1207 ReadParam(m, iter, &p->password_value) && 813 ReadParam(m, iter, &p->password_value) &&
1208 ReadParam(m, iter, &p->old_password_element) && 814 ReadParam(m, iter, &p->old_password_element) &&
1209 ReadParam(m, iter, &p->old_password_value) && 815 ReadParam(m, iter, &p->old_password_value) &&
1210 ReadParam(m, iter, &p->ssl_valid) && 816 ReadParam(m, iter, &p->ssl_valid) &&
1211 ReadParam(m, iter, &p->preferred) && 817 ReadParam(m, iter, &p->preferred) &&
1212 ReadParam(m, iter, &p->blacklisted_by_user); 818 ReadParam(m, iter, &p->blacklisted_by_user);
1213 } 819 }
1214 static void Log(const param_type& p, std::wstring* l) { 820 static void Log(const param_type& p, std::wstring* l) {
1215 l->append(L"<PasswordForm>"); 821 l->append(L"<PasswordForm>");
1216 } 822 }
1217 }; 823 };
1218 824
825 // Traits for AutofillForm_Params structure to pack/unpack.
1219 template <> 826 template <>
1220 struct ParamTraits<AutofillForm> { 827 struct ParamTraits<AutofillForm> {
1221 typedef AutofillForm param_type; 828 typedef AutofillForm param_type;
1222 static void Write(IPC::Message* m, const param_type& p) { 829 static void Write(Message* m, const param_type& p) {
1223 WriteParam(m, p.elements.size()); 830 WriteParam(m, p.elements.size());
1224 for (std::vector<AutofillForm::Element>::const_iterator itr = 831 for (std::vector<AutofillForm::Element>::const_iterator itr =
1225 p.elements.begin(); 832 p.elements.begin();
1226 itr != p.elements.end(); 833 itr != p.elements.end();
1227 itr++) { 834 itr++) {
1228 WriteParam(m, itr->name); 835 WriteParam(m, itr->name);
1229 WriteParam(m, itr->value); 836 WriteParam(m, itr->value);
1230 } 837 }
1231 } 838 }
1232 static bool Read(const IPC::Message* m, void** iter, param_type* p) { 839 static bool Read(const Message* m, void** iter, param_type* p) {
1233 bool result = true; 840 bool result = true;
1234 size_t elements_size = 0; 841 size_t elements_size = 0;
1235 result = result && ReadParam(m, iter, &elements_size); 842 result = result && ReadParam(m, iter, &elements_size);
1236 p->elements.resize(elements_size); 843 p->elements.resize(elements_size);
1237 for (size_t i = 0; i < elements_size; i++) { 844 for (size_t i = 0; i < elements_size; i++) {
1238 std::wstring s; 845 std::wstring s;
1239 result = result && ReadParam(m, iter, &(p->elements[i].name)); 846 result = result && ReadParam(m, iter, &(p->elements[i].name));
1240 result = result && ReadParam(m, iter, &(p->elements[i].value)); 847 result = result && ReadParam(m, iter, &(p->elements[i].value));
1241 } 848 }
1242 return result; 849 return result;
1243 } 850 }
1244 static void Log(const param_type& p, std::wstring* l) { 851 static void Log(const param_type& p, std::wstring* l) {
1245 l->append(L"<AutofillForm>"); 852 l->append(L"<AutofillForm>");
1246 } 853 }
1247 }; 854 };
1248 855
856 // Traits for ViewHostMsg_FrameNavigate_Params structure to pack/unpack.
857 template <>
858 struct ParamTraits<ViewHostMsg_FrameNavigate_Params> {
859 typedef ViewHostMsg_FrameNavigate_Params param_type;
860 static void Write(Message* m, const param_type& p) {
861 WriteParam(m, p.page_id);
862 WriteParam(m, p.url);
863 WriteParam(m, p.referrer);
864 WriteParam(m, p.transition);
865 WriteParam(m, p.redirects);
866 WriteParam(m, p.should_update_history);
867 WriteParam(m, p.searchable_form_url);
868 WriteParam(m, p.searchable_form_element_name);
869 WriteParam(m, p.searchable_form_encoding);
870 WriteParam(m, p.password_form);
871 WriteParam(m, p.security_info);
872 WriteParam(m, p.gesture);
873 WriteParam(m, p.contents_mime_type);
874 WriteParam(m, p.is_post);
875 WriteParam(m, p.is_content_filtered);
876 }
877 static bool Read(const Message* m, void** iter, param_type* p) {
878 return
879 ReadParam(m, iter, &p->page_id) &&
880 ReadParam(m, iter, &p->url) &&
881 ReadParam(m, iter, &p->referrer) &&
882 ReadParam(m, iter, &p->transition) &&
883 ReadParam(m, iter, &p->redirects) &&
884 ReadParam(m, iter, &p->should_update_history) &&
885 ReadParam(m, iter, &p->searchable_form_url) &&
886 ReadParam(m, iter, &p->searchable_form_element_name) &&
887 ReadParam(m, iter, &p->searchable_form_encoding) &&
888 ReadParam(m, iter, &p->password_form) &&
889 ReadParam(m, iter, &p->security_info) &&
890 ReadParam(m, iter, &p->gesture) &&
891 ReadParam(m, iter, &p->contents_mime_type) &&
892 ReadParam(m, iter, &p->is_post) &&
893 ReadParam(m, iter, &p->is_content_filtered);
894 }
895 static void Log(const param_type& p, std::wstring* l) {
896 l->append(L"(");
897 LogParam(p.page_id, l);
898 l->append(L", ");
899 LogParam(p.url, l);
900 l->append(L", ");
901 LogParam(p.referrer, l);
902 l->append(L", ");
903 LogParam(p.transition, l);
904 l->append(L", ");
905 LogParam(p.redirects, l);
906 l->append(L", ");
907 LogParam(p.should_update_history, l);
908 l->append(L", ");
909 LogParam(p.searchable_form_url, l);
910 l->append(L", ");
911 LogParam(p.searchable_form_element_name, l);
912 l->append(L", ");
913 LogParam(p.searchable_form_encoding, l);
914 l->append(L", ");
915 LogParam(p.password_form, l);
916 l->append(L", ");
917 LogParam(p.security_info, l);
918 l->append(L", ");
919 LogParam(p.gesture, l);
920 l->append(L", ");
921 LogParam(p.contents_mime_type, l);
922 l->append(L", ");
923 LogParam(p.is_post, l);
924 l->append(L", ");
925 LogParam(p.is_content_filtered, l);
926 l->append(L")");
927 }
928 };
929
930 // Traits for ViewHostMsg_ContextMenu_Params structure to pack/unpack.
931 template <>
932 struct ParamTraits<ViewHostMsg_ContextMenu_Params> {
933 typedef ViewHostMsg_ContextMenu_Params param_type;
934 static void Write(Message* m, const param_type& p) {
935 WriteParam(m, p.node);
936 WriteParam(m, p.x);
937 WriteParam(m, p.y);
938 WriteParam(m, p.link_url);
939 WriteParam(m, p.image_url);
940 WriteParam(m, p.page_url);
941 WriteParam(m, p.frame_url);
942 WriteParam(m, p.selection_text);
943 WriteParam(m, p.misspelled_word);
944 WriteParam(m, p.dictionary_suggestions);
945 WriteParam(m, p.spellcheck_enabled);
946 WriteParam(m, p.edit_flags);
947 WriteParam(m, p.security_info);
948 }
949 static bool Read(const Message* m, void** iter, param_type* p) {
950 return
951 ReadParam(m, iter, &p->node) &&
952 ReadParam(m, iter, &p->x) &&
953 ReadParam(m, iter, &p->y) &&
954 ReadParam(m, iter, &p->link_url) &&
955 ReadParam(m, iter, &p->image_url) &&
956 ReadParam(m, iter, &p->page_url) &&
957 ReadParam(m, iter, &p->frame_url) &&
958 ReadParam(m, iter, &p->selection_text) &&
959 ReadParam(m, iter, &p->misspelled_word) &&
960 ReadParam(m, iter, &p->dictionary_suggestions) &&
961 ReadParam(m, iter, &p->spellcheck_enabled) &&
962 ReadParam(m, iter, &p->edit_flags) &&
963 ReadParam(m, iter, &p->security_info);
964 }
965 static void Log(const param_type& p, std::wstring* l) {
966 l->append(L"<ViewHostMsg_ContextMenu_Params>");
967 }
968 };
969
970 // Traits for ViewHostMsg_PaintRect_Params structure to pack/unpack.
971 template <>
972 struct ParamTraits<ViewHostMsg_PaintRect_Params> {
973 typedef ViewHostMsg_PaintRect_Params param_type;
974 static void Write(Message* m, const param_type& p) {
975 WriteParam(m, p.bitmap);
976 WriteParam(m, p.bitmap_rect);
977 WriteParam(m, p.view_size);
978 WriteParam(m, p.plugin_window_moves);
979 WriteParam(m, p.flags);
980 }
981 static bool Read(const Message* m, void** iter, param_type* p) {
982 return
983 ReadParam(m, iter, &p->bitmap) &&
984 ReadParam(m, iter, &p->bitmap_rect) &&
985 ReadParam(m, iter, &p->view_size) &&
986 ReadParam(m, iter, &p->plugin_window_moves) &&
987 ReadParam(m, iter, &p->flags);
988 }
989 static void Log(const param_type& p, std::wstring* l) {
990 l->append(L"(");
991 LogParam(p.bitmap, l);
992 l->append(L", ");
993 LogParam(p.bitmap_rect, l);
994 l->append(L", ");
995 LogParam(p.view_size, l);
996 l->append(L", ");
997 LogParam(p.plugin_window_moves, l);
998 l->append(L", ");
999 LogParam(p.flags, l);
1000 l->append(L")");
1001 }
1002 };
1003
1004 // Traits for ViewHostMsg_ScrollRect_Params structure to pack/unpack.
1005 template <>
1006 struct ParamTraits<ViewHostMsg_ScrollRect_Params> {
1007 typedef ViewHostMsg_ScrollRect_Params param_type;
1008 static void Write(Message* m, const param_type& p) {
1009 WriteParam(m, p.bitmap);
1010 WriteParam(m, p.bitmap_rect);
1011 WriteParam(m, p.dx);
1012 WriteParam(m, p.dy);
1013 WriteParam(m, p.clip_rect);
1014 WriteParam(m, p.view_size);
1015 WriteParam(m, p.plugin_window_moves);
1016 }
1017 static bool Read(const Message* m, void** iter, param_type* p) {
1018 return
1019 ReadParam(m, iter, &p->bitmap) &&
1020 ReadParam(m, iter, &p->bitmap_rect) &&
1021 ReadParam(m, iter, &p->dx) &&
1022 ReadParam(m, iter, &p->dy) &&
1023 ReadParam(m, iter, &p->clip_rect) &&
1024 ReadParam(m, iter, &p->view_size) &&
1025 ReadParam(m, iter, &p->plugin_window_moves);
1026 }
1027 static void Log(const param_type& p, std::wstring* l) {
1028 l->append(L"(");
1029 LogParam(p.bitmap, l);
1030 l->append(L", ");
1031 LogParam(p.bitmap_rect, l);
1032 l->append(L", ");
1033 LogParam(p.dx, l);
1034 l->append(L", ");
1035 LogParam(p.dy, l);
1036 l->append(L", ");
1037 LogParam(p.clip_rect, l);
1038 l->append(L", ");
1039 LogParam(p.view_size, l);
1040 l->append(L", ");
1041 LogParam(p.plugin_window_moves, l);
1042 l->append(L")");
1043 }
1044 };
1249 1045
1250 template <> 1046 template <>
1251 struct ParamTraits<WebPluginGeometry> { 1047 struct ParamTraits<WebPluginGeometry> {
1252 typedef WebPluginGeometry param_type; 1048 typedef WebPluginGeometry param_type;
1253 static void Write(IPC::Message* m, const param_type& p) { 1049 static void Write(Message* m, const param_type& p) {
1254 WriteParam(m, p.window); 1050 WriteParam(m, p.window);
1255 WriteParam(m, p.window_rect); 1051 WriteParam(m, p.window_rect);
1256 WriteParam(m, p.clip_rect); 1052 WriteParam(m, p.clip_rect);
1257 WriteParam(m, p.cutout_rects); 1053 WriteParam(m, p.cutout_rects);
1258 WriteParam(m, p.visible); 1054 WriteParam(m, p.visible);
1259 } 1055 }
1260 static bool Read(const IPC::Message* m, void** iter, param_type* p) { 1056 static bool Read(const Message* m, void** iter, param_type* p) {
1261 return 1057 return
1262 ReadParam(m, iter, &p->window) && 1058 ReadParam(m, iter, &p->window) &&
1263 ReadParam(m, iter, &p->window_rect) && 1059 ReadParam(m, iter, &p->window_rect) &&
1264 ReadParam(m, iter, &p->clip_rect) && 1060 ReadParam(m, iter, &p->clip_rect) &&
1265 ReadParam(m, iter, &p->cutout_rects) && 1061 ReadParam(m, iter, &p->cutout_rects) &&
1266 ReadParam(m, iter, &p->visible); 1062 ReadParam(m, iter, &p->visible);
1267 } 1063 }
1268 static void Log(const param_type& p, std::wstring* l) { 1064 static void Log(const param_type& p, std::wstring* l) {
1269 l->append(L"("); 1065 l->append(L"(");
1270 LogParam(p.window, l); 1066 LogParam(p.window, l);
1271 l->append(L", "); 1067 l->append(L", ");
1272 LogParam(p.window_rect, l); 1068 LogParam(p.window_rect, l);
1273 l->append(L", "); 1069 l->append(L", ");
1274 LogParam(p.clip_rect, l); 1070 LogParam(p.clip_rect, l);
1275 l->append(L", "); 1071 l->append(L", ");
1276 LogParam(p.cutout_rects, l); 1072 LogParam(p.cutout_rects, l);
1277 l->append(L", "); 1073 l->append(L", ");
1278 LogParam(p.visible, l); 1074 LogParam(p.visible, l);
1279 l->append(L")"); 1075 l->append(L")");
1280 } 1076 }
1281 }; 1077 };
1282 1078
1283 1079 // Traits for ViewMsg_GetPlugins_Reply structure to pack/unpack.
1284 template <> 1080 template <>
1285 struct ParamTraits<WebPluginMimeType> { 1081 struct ParamTraits<WebPluginMimeType> {
1286 typedef WebPluginMimeType param_type; 1082 typedef WebPluginMimeType param_type;
1287 static void Write(IPC::Message* m, const param_type& p) { 1083 static void Write(Message* m, const param_type& p) {
1288 WriteParam(m, p.mime_type); 1084 WriteParam(m, p.mime_type);
1289 WriteParam(m, p.file_extensions); 1085 WriteParam(m, p.file_extensions);
1290 WriteParam(m, p.description); 1086 WriteParam(m, p.description);
1291 } 1087 }
1292 static bool Read(const IPC::Message* m, void** iter, param_type* r) { 1088 static bool Read(const Message* m, void** iter, param_type* r) {
1293 return 1089 return
1294 ReadParam(m, iter, &r->mime_type) && 1090 ReadParam(m, iter, &r->mime_type) &&
1295 ReadParam(m, iter, &r->file_extensions) && 1091 ReadParam(m, iter, &r->file_extensions) &&
1296 ReadParam(m, iter, &r->description); 1092 ReadParam(m, iter, &r->description);
1297 } 1093 }
1298 static void Log(const param_type& p, std::wstring* l) { 1094 static void Log(const param_type& p, std::wstring* l) {
1299 l->append(L"("); 1095 l->append(L"(");
1300 LogParam(p.mime_type, l); 1096 LogParam(p.mime_type, l);
1301 l->append(L", "); 1097 l->append(L", ");
1302 LogParam(p.file_extensions, l); 1098 LogParam(p.file_extensions, l);
1303 l->append(L", "); 1099 l->append(L", ");
1304 LogParam(p.description, l); 1100 LogParam(p.description, l);
1305 l->append(L")"); 1101 l->append(L")");
1306 } 1102 }
1307 }; 1103 };
1308 1104
1309 1105
1310 template <> 1106 template <>
1311 struct ParamTraits<WebPluginInfo> { 1107 struct ParamTraits<WebPluginInfo> {
1312 typedef WebPluginInfo param_type; 1108 typedef WebPluginInfo param_type;
1313 static void Write(IPC::Message* m, const param_type& p) { 1109 static void Write(Message* m, const param_type& p) {
1314 WriteParam(m, p.name); 1110 WriteParam(m, p.name);
1315 WriteParam(m, p.path); 1111 WriteParam(m, p.path);
1316 WriteParam(m, p.version); 1112 WriteParam(m, p.version);
1317 WriteParam(m, p.desc); 1113 WriteParam(m, p.desc);
1318 WriteParam(m, p.mime_types); 1114 WriteParam(m, p.mime_types);
1319 } 1115 }
1320 static bool Read(const IPC::Message* m, void** iter, param_type* r) { 1116 static bool Read(const Message* m, void** iter, param_type* r) {
1321 return 1117 return
1322 ReadParam(m, iter, &r->name) && 1118 ReadParam(m, iter, &r->name) &&
1323 ReadParam(m, iter, &r->path) && 1119 ReadParam(m, iter, &r->path) &&
1324 ReadParam(m, iter, &r->version) && 1120 ReadParam(m, iter, &r->version) &&
1325 ReadParam(m, iter, &r->desc) && 1121 ReadParam(m, iter, &r->desc) &&
1326 ReadParam(m, iter, &r->mime_types); 1122 ReadParam(m, iter, &r->mime_types);
1327 } 1123 }
1328 static void Log(const param_type& p, std::wstring* l) { 1124 static void Log(const param_type& p, std::wstring* l) {
1329 l->append(L"("); 1125 l->append(L"(");
1330 LogParam(p.name, l); 1126 LogParam(p.name, l);
1331 l->append(L", "); 1127 l->append(L", ");
1332 l->append(L", "); 1128 l->append(L", ");
1333 LogParam(p.path, l); 1129 LogParam(p.path, l);
1334 l->append(L", "); 1130 l->append(L", ");
1335 LogParam(p.version, l); 1131 LogParam(p.version, l);
1336 l->append(L", "); 1132 l->append(L", ");
1337 LogParam(p.desc, l); 1133 LogParam(p.desc, l);
1338 l->append(L", "); 1134 l->append(L", ");
1339 LogParam(p.mime_types, l); 1135 LogParam(p.mime_types, l);
1340 l->append(L")"); 1136 l->append(L")");
1341 } 1137 }
1342 }; 1138 };
1343 1139
1140 // Traits for ViewMsg_UploadFile_Params structure to pack/unpack.
1141 template <>
1142 struct ParamTraits<ViewMsg_UploadFile_Params> {
1143 typedef ViewMsg_UploadFile_Params param_type;
1144 static void Write(Message* m, const param_type& p) {
1145 WriteParam(m, p.file_path);
1146 WriteParam(m, p.form);
1147 WriteParam(m, p.file);
1148 WriteParam(m, p.submit);
1149 WriteParam(m, p.other_values);
1150 }
1151 static bool Read(const Message* m, void** iter, param_type* p) {
1152 return
1153 ReadParam(m, iter, &p->file_path) &&
1154 ReadParam(m, iter, &p->form) &&
1155 ReadParam(m, iter, &p->file) &&
1156 ReadParam(m, iter, &p->submit) &&
1157 ReadParam(m, iter, &p->other_values);
1158 }
1159 static void Log(const param_type& p, std::wstring* l) {
1160 l->append(L"<ViewMsg_UploadFile_Params>");
1161 }
1162 };
1163
1164 // Traits for net::UploadData::Element.
1344 template <> 1165 template <>
1345 struct ParamTraits<net::UploadData::Element> { 1166 struct ParamTraits<net::UploadData::Element> {
1346 typedef net::UploadData::Element param_type; 1167 typedef net::UploadData::Element param_type;
1347 static void Write(IPC::Message* m, const param_type& p) { 1168 static void Write(Message* m, const param_type& p) {
1348 WriteParam(m, static_cast<int>(p.type())); 1169 WriteParam(m, static_cast<int>(p.type()));
1349 if (p.type() == net::UploadData::TYPE_BYTES) { 1170 if (p.type() == net::UploadData::TYPE_BYTES) {
1350 m->WriteData(&p.bytes()[0], static_cast<int>(p.bytes().size())); 1171 m->WriteData(&p.bytes()[0], static_cast<int>(p.bytes().size()));
1351 } else { 1172 } else {
1352 WriteParam(m, p.file_path()); 1173 WriteParam(m, p.file_path());
1353 WriteParam(m, p.file_range_offset()); 1174 WriteParam(m, p.file_range_offset());
1354 WriteParam(m, p.file_range_length()); 1175 WriteParam(m, p.file_range_length());
1355 } 1176 }
1356 } 1177 }
1357 static bool Read(const IPC::Message* m, void** iter, param_type* r) { 1178 static bool Read(const Message* m, void** iter, param_type* r) {
1358 int type; 1179 int type;
1359 if (!ReadParam(m, iter, &type)) 1180 if (!ReadParam(m, iter, &type))
1360 return false; 1181 return false;
1361 if (type == net::UploadData::TYPE_BYTES) { 1182 if (type == net::UploadData::TYPE_BYTES) {
1362 const char* data; 1183 const char* data;
1363 int len; 1184 int len;
1364 if (!m->ReadData(iter, &data, &len)) 1185 if (!m->ReadData(iter, &data, &len))
1365 return false; 1186 return false;
1366 r->SetToBytes(data, len); 1187 r->SetToBytes(data, len);
1367 } else { 1188 } else {
1368 DCHECK(type == net::UploadData::TYPE_FILE); 1189 DCHECK(type == net::UploadData::TYPE_FILE);
1369 std::wstring file_path; 1190 std::wstring file_path;
1370 uint64 offset, length; 1191 uint64 offset, length;
1371 if (!ReadParam(m, iter, &file_path)) 1192 if (!ReadParam(m, iter, &file_path))
1372 return false; 1193 return false;
1373 if (!ReadParam(m, iter, &offset)) 1194 if (!ReadParam(m, iter, &offset))
1374 return false; 1195 return false;
1375 if (!ReadParam(m, iter, &length)) 1196 if (!ReadParam(m, iter, &length))
1376 return false; 1197 return false;
1377 r->SetToFilePathRange(file_path, offset, length); 1198 r->SetToFilePathRange(file_path, offset, length);
1378 } 1199 }
1379 return true; 1200 return true;
1380 } 1201 }
1381 static void Log(const param_type& p, std::wstring* l) { 1202 static void Log(const param_type& p, std::wstring* l) {
1382 l->append(L"<net::UploadData::Element>"); 1203 l->append(L"<net::UploadData::Element>");
1383 } 1204 }
1384 }; 1205 };
1385 1206
1207 // Traits for CacheManager::UsageStats
1386 template <> 1208 template <>
1387 struct ParamTraits<CacheManager::UsageStats> { 1209 struct ParamTraits<CacheManager::UsageStats> {
1388 typedef CacheManager::UsageStats param_type; 1210 typedef CacheManager::UsageStats param_type;
1389 static void Write(IPC::Message* m, const param_type& p) { 1211 static void Write(Message* m, const param_type& p) {
1390 WriteParam(m, p.min_dead_capacity); 1212 WriteParam(m, p.min_dead_capacity);
1391 WriteParam(m, p.max_dead_capacity); 1213 WriteParam(m, p.max_dead_capacity);
1392 WriteParam(m, p.capacity); 1214 WriteParam(m, p.capacity);
1393 WriteParam(m, p.live_size); 1215 WriteParam(m, p.live_size);
1394 WriteParam(m, p.dead_size); 1216 WriteParam(m, p.dead_size);
1395 } 1217 }
1396 static bool Read(const IPC::Message* m, void** iter, param_type* r) { 1218 static bool Read(const Message* m, void** iter, param_type* r) {
1397 return 1219 return
1398 ReadParam(m, iter, &r->min_dead_capacity) && 1220 ReadParam(m, iter, &r->min_dead_capacity) &&
1399 ReadParam(m, iter, &r->max_dead_capacity) && 1221 ReadParam(m, iter, &r->max_dead_capacity) &&
1400 ReadParam(m, iter, &r->capacity) && 1222 ReadParam(m, iter, &r->capacity) &&
1401 ReadParam(m, iter, &r->live_size) && 1223 ReadParam(m, iter, &r->live_size) &&
1402 ReadParam(m, iter, &r->dead_size); 1224 ReadParam(m, iter, &r->dead_size);
1403 } 1225 }
1404 static void Log(const param_type& p, std::wstring* l) { 1226 static void Log(const param_type& p, std::wstring* l) {
1405 l->append(L"<CacheManager::UsageStats>"); 1227 l->append(L"<CacheManager::UsageStats>");
1406 } 1228 }
1407 }; 1229 };
1408 1230
1231 // Traits for PasswordFormDomManager::FillData.
1409 template <> 1232 template <>
1410 struct ParamTraits<PasswordFormDomManager::FillData> { 1233 struct ParamTraits<PasswordFormDomManager::FillData> {
1411 typedef PasswordFormDomManager::FillData param_type; 1234 typedef PasswordFormDomManager::FillData param_type;
1412 static void Write(IPC::Message* m, const param_type& p) { 1235 static void Write(Message* m, const param_type& p) {
1413 WriteParam(m, p.basic_data); 1236 WriteParam(m, p.basic_data);
1414 WriteParam(m, p.additional_logins); 1237 WriteParam(m, p.additional_logins);
1415 WriteParam(m, p.wait_for_username); 1238 WriteParam(m, p.wait_for_username);
1416 } 1239 }
1417 static bool Read(const IPC::Message* m, void** iter, param_type* r) { 1240 static bool Read(const Message* m, void** iter, param_type* r) {
1418 return 1241 return
1419 ReadParam(m, iter, &r->basic_data) && 1242 ReadParam(m, iter, &r->basic_data) &&
1420 ReadParam(m, iter, &r->additional_logins) && 1243 ReadParam(m, iter, &r->additional_logins) &&
1421 ReadParam(m, iter, &r->wait_for_username); 1244 ReadParam(m, iter, &r->wait_for_username);
1422 } 1245 }
1423 static void Log(const param_type& p, std::wstring* l) { 1246 static void Log(const param_type& p, std::wstring* l) {
1424 l->append(L"<PasswordFormDomManager::FillData>"); 1247 l->append(L"<PasswordFormDomManager::FillData>");
1425 } 1248 }
1426 }; 1249 };
1427 1250
1428 template<> 1251 template<>
1429 struct ParamTraits<NavigationGesture> { 1252 struct ParamTraits<NavigationGesture> {
1430 typedef NavigationGesture param_type; 1253 typedef NavigationGesture param_type;
1431 static void Write(IPC::Message* m, const param_type& p) { 1254 static void Write(Message* m, const param_type& p) {
1432 m->WriteInt(p); 1255 m->WriteInt(p);
1433 } 1256 }
1434 static bool Read(const IPC::Message* m, void** iter, param_type* p) { 1257 static bool Read(const Message* m, void** iter, param_type* p) {
1435 int type; 1258 int type;
1436 if (!m->ReadInt(iter, &type)) 1259 if (!m->ReadInt(iter, &type))
1437 return false; 1260 return false;
1438 *p = static_cast<NavigationGesture>(type); 1261 *p = static_cast<NavigationGesture>(type);
1439 return true; 1262 return true;
1440 } 1263 }
1441 static void Log(const param_type& p, std::wstring* l) { 1264 static void Log(const param_type& p, std::wstring* l) {
1442 std::wstring event; 1265 std::wstring event;
1443 switch (p) { 1266 switch (p) {
1444 case NavigationGestureUser: 1267 case NavigationGestureUser:
1445 event = L"GESTURE_USER"; 1268 event = L"GESTURE_USER";
1446 break; 1269 break;
1447 case NavigationGestureAuto: 1270 case NavigationGestureAuto:
1448 event = L"GESTURE_AUTO"; 1271 event = L"GESTURE_AUTO";
1449 break; 1272 break;
1450 default: 1273 default:
1451 event = L"GESTURE_UNKNOWN"; 1274 event = L"GESTURE_UNKNOWN";
1452 break; 1275 break;
1453 } 1276 }
1454 LogParam(event, l); 1277 LogParam(event, l);
1455 } 1278 }
1456 }; 1279 };
1457 1280
1281 // Traits for ViewHostMsg_Resource_Request
1282 template <>
1283 struct ParamTraits<ViewHostMsg_Resource_Request> {
1284 typedef ViewHostMsg_Resource_Request param_type;
1285 static void Write(Message* m, const param_type& p) {
1286 WriteParam(m, p.method);
1287 WriteParam(m, p.url);
1288 WriteParam(m, p.policy_url);
1289 WriteParam(m, p.referrer);
1290 WriteParam(m, p.headers);
1291 WriteParam(m, p.load_flags);
1292 WriteParam(m, p.origin_pid);
1293 WriteParam(m, p.resource_type);
1294 WriteParam(m, p.mixed_content);
1295 WriteParam(m, p.request_context);
1296 WriteParam(m, p.upload_content);
1297 }
1298 static bool Read(const Message* m, void** iter, param_type* r) {
1299 return
1300 ReadParam(m, iter, &r->method) &&
1301 ReadParam(m, iter, &r->url) &&
1302 ReadParam(m, iter, &r->policy_url) &&
1303 ReadParam(m, iter, &r->referrer) &&
1304 ReadParam(m, iter, &r->headers) &&
1305 ReadParam(m, iter, &r->load_flags) &&
1306 ReadParam(m, iter, &r->origin_pid) &&
1307 ReadParam(m, iter, &r->resource_type) &&
1308 ReadParam(m, iter, &r->mixed_content) &&
1309 ReadParam(m, iter, &r->request_context) &&
1310 ReadParam(m, iter, &r->upload_content);
1311 }
1312 static void Log(const param_type& p, std::wstring* l) {
1313 l->append(L"(");
1314 LogParam(p.method, l);
1315 l->append(L", ");
1316 LogParam(p.url, l);
1317 l->append(L", ");
1318 LogParam(p.referrer, l);
1319 l->append(L", ");
1320 LogParam(p.load_flags, l);
1321 l->append(L", ");
1322 LogParam(p.origin_pid, l);
1323 l->append(L", ");
1324 LogParam(p.resource_type, l);
1325 l->append(L", ");
1326 LogParam(p.mixed_content, l);
1327 l->append(L", ");
1328 LogParam(p.request_context, l);
1329 l->append(L")");
1330 }
1331 };
1332
1333 // Traits for URLRequestStatus
1458 template <> 1334 template <>
1459 struct ParamTraits<URLRequestStatus> { 1335 struct ParamTraits<URLRequestStatus> {
1460 typedef URLRequestStatus param_type; 1336 typedef URLRequestStatus param_type;
1461 static void Write(IPC::Message* m, const param_type& p) { 1337 static void Write(Message* m, const param_type& p) {
1462 WriteParam(m, static_cast<int>(p.status())); 1338 WriteParam(m, static_cast<int>(p.status()));
1463 WriteParam(m, p.os_error()); 1339 WriteParam(m, p.os_error());
1464 } 1340 }
1465 static bool Read(const IPC::Message* m, void** iter, param_type* r) { 1341 static bool Read(const Message* m, void** iter, param_type* r) {
1466 int status, os_error; 1342 int status, os_error;
1467 if (!ReadParam(m, iter, &status) || 1343 if (!ReadParam(m, iter, &status) ||
1468 !ReadParam(m, iter, &os_error)) 1344 !ReadParam(m, iter, &os_error))
1469 return false; 1345 return false;
1470 r->set_status(static_cast<URLRequestStatus::Status>(status)); 1346 r->set_status(static_cast<URLRequestStatus::Status>(status));
1471 r->set_os_error(os_error); 1347 r->set_os_error(os_error);
1472 return true; 1348 return true;
1473 } 1349 }
1474 static void Log(const param_type& p, std::wstring* l) { 1350 static void Log(const param_type& p, std::wstring* l) {
1475 std::wstring status; 1351 std::wstring status;
(...skipping 26 matching lines...) Expand all
1502 l->append(L", "); 1378 l->append(L", ");
1503 LogParam(p.os_error(), l); 1379 LogParam(p.os_error(), l);
1504 l->append(L")"); 1380 l->append(L")");
1505 } 1381 }
1506 } 1382 }
1507 }; 1383 };
1508 1384
1509 template <> 1385 template <>
1510 struct ParamTraits<scoped_refptr<net::HttpResponseHeaders> > { 1386 struct ParamTraits<scoped_refptr<net::HttpResponseHeaders> > {
1511 typedef scoped_refptr<net::HttpResponseHeaders> param_type; 1387 typedef scoped_refptr<net::HttpResponseHeaders> param_type;
1512 static void Write(IPC::Message* m, const param_type& p) { 1388 static void Write(Message* m, const param_type& p) {
1513 WriteParam(m, p.get() != NULL); 1389 WriteParam(m, p.get() != NULL);
1514 if (p) { 1390 if (p) {
1515 // Do not disclose Set-Cookie headers over IPC. 1391 // Do not disclose Set-Cookie headers over IPC.
1516 p->Persist(m, net::HttpResponseHeaders::PERSIST_SANS_COOKIES); 1392 p->Persist(m, net::HttpResponseHeaders::PERSIST_SANS_COOKIES);
1517 } 1393 }
1518 } 1394 }
1519 static bool Read(const IPC::Message* m, void** iter, param_type* r) { 1395 static bool Read(const Message* m, void** iter, param_type* r) {
1520 bool has_object; 1396 bool has_object;
1521 if (!ReadParam(m, iter, &has_object)) 1397 if (!ReadParam(m, iter, &has_object))
1522 return false; 1398 return false;
1523 if (has_object) 1399 if (has_object)
1524 *r = new net::HttpResponseHeaders(*m, iter); 1400 *r = new net::HttpResponseHeaders(*m, iter);
1525 return true; 1401 return true;
1526 } 1402 }
1527 static void Log(const param_type& p, std::wstring* l) { 1403 static void Log(const param_type& p, std::wstring* l) {
1528 l->append(L"<HttpResponseHeaders>"); 1404 l->append(L"<HttpResponseHeaders>");
1529 } 1405 }
1530 }; 1406 };
1531 1407
1408 // Traits for webkit_glue::ResourceLoaderBridge::ResponseInfo
1409 template <>
1410 struct ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo> {
1411 typedef webkit_glue::ResourceLoaderBridge::ResponseInfo param_type;
1412 static void Write(Message* m, const param_type& p) {
1413 WriteParam(m, p.request_time);
1414 WriteParam(m, p.response_time);
1415 WriteParam(m, p.headers);
1416 WriteParam(m, p.mime_type);
1417 WriteParam(m, p.charset);
1418 WriteParam(m, p.security_info);
1419 WriteParam(m, p.content_length);
1420 }
1421 static bool Read(const Message* m, void** iter, param_type* r) {
1422 return
1423 ReadParam(m, iter, &r->request_time) &&
1424 ReadParam(m, iter, &r->response_time) &&
1425 ReadParam(m, iter, &r->headers) &&
1426 ReadParam(m, iter, &r->mime_type) &&
1427 ReadParam(m, iter, &r->charset) &&
1428 ReadParam(m, iter, &r->security_info) &&
1429 ReadParam(m, iter, &r->content_length);
1430 }
1431 static void Log(const param_type& p, std::wstring* l) {
1432 l->append(L"(");
1433 LogParam(p.request_time, l);
1434 l->append(L", ");
1435 LogParam(p.response_time, l);
1436 l->append(L", ");
1437 LogParam(p.headers, l);
1438 l->append(L", ");
1439 LogParam(p.mime_type, l);
1440 l->append(L", ");
1441 LogParam(p.charset, l);
1442 l->append(L", ");
1443 LogParam(p.security_info, l);
1444 l->append(L")");
1445 }
1446 };
1447
1448 // Traits for ViewMsg_Resource_ResponseHead
1449 template <>
1450 struct ParamTraits<ViewMsg_Resource_ResponseHead> {
1451 typedef ViewMsg_Resource_ResponseHead param_type;
1452 static void Write(Message* m, const param_type& p) {
1453 ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo>::Write(m, p);
1454 WriteParam(m, p.status);
1455 WriteParam(m, p.filter_policy);
1456 }
1457 static bool Read(const Message* m, void** iter, param_type* r) {
1458 return
1459 ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo>::Read(m, iter , r) &&
1460 ReadParam(m, iter, &r->status) &&
1461 ReadParam(m, iter, &r->filter_policy);
1462 }
1463 static void Log(const param_type& p, std::wstring* l) {
1464 // log more?
1465 ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo>::Log(p, l);
1466 }
1467 };
1468
1469 // Traits for ViewHostMsg_Resource_SyncLoad_Response
1470 template <>
1471 struct ParamTraits<ViewHostMsg_SyncLoad_Result> {
1472 typedef ViewHostMsg_SyncLoad_Result param_type;
1473 static void Write(Message* m, const param_type& p) {
1474 ParamTraits<ViewMsg_Resource_ResponseHead>::Write(m, p);
1475 WriteParam(m, p.final_url);
1476 WriteParam(m, p.data);
1477 }
1478 static bool Read(const Message* m, void** iter, param_type* r) {
1479 return
1480 ParamTraits<ViewMsg_Resource_ResponseHead>::Read(m, iter, r) &&
1481 ReadParam(m, iter, &r->final_url) &&
1482 ReadParam(m, iter, &r->data);
1483 }
1484 static void Log(const param_type& p, std::wstring* l) {
1485 // log more?
1486 ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo>::Log(p, l);
1487 }
1488 };
1489
1490 // Traits for FormData structure to pack/unpack.
1532 template <> 1491 template <>
1533 struct ParamTraits<FormData> { 1492 struct ParamTraits<FormData> {
1534 typedef FormData param_type; 1493 typedef FormData param_type;
1535 static void Write(IPC::Message* m, const param_type& p) { 1494 static void Write(Message* m, const param_type& p) {
1536 WriteParam(m, p.origin); 1495 WriteParam(m, p.origin);
1537 WriteParam(m, p.action); 1496 WriteParam(m, p.action);
1538 WriteParam(m, p.elements); 1497 WriteParam(m, p.elements);
1539 WriteParam(m, p.values); 1498 WriteParam(m, p.values);
1540 WriteParam(m, p.submit); 1499 WriteParam(m, p.submit);
1541 } 1500 }
1542 static bool Read(const IPC::Message* m, void** iter, param_type* p) { 1501 static bool Read(const Message* m, void** iter, param_type* p) {
1543 return 1502 return
1544 ReadParam(m, iter, &p->origin) && 1503 ReadParam(m, iter, &p->origin) &&
1545 ReadParam(m, iter, &p->action) && 1504 ReadParam(m, iter, &p->action) &&
1546 ReadParam(m, iter, &p->elements) && 1505 ReadParam(m, iter, &p->elements) &&
1547 ReadParam(m, iter, &p->values) && 1506 ReadParam(m, iter, &p->values) &&
1548 ReadParam(m, iter, &p->submit); 1507 ReadParam(m, iter, &p->submit);
1549 } 1508 }
1550 static void Log(const param_type& p, std::wstring* l) { 1509 static void Log(const param_type& p, std::wstring* l) {
1551 l->append(L"<FormData>"); 1510 l->append(L"<FormData>");
1552 } 1511 }
1553 }; 1512 };
1554 1513
1514 // Traits for ViewMsg_Print_Params
1515 template <>
1516 struct ParamTraits<ViewMsg_Print_Params> {
1517 typedef ViewMsg_Print_Params param_type;
1518 static void Write(Message* m, const param_type& p) {
1519 WriteParam(m, p.printable_size);
1520 WriteParam(m, p.dpi);
1521 WriteParam(m, p.min_shrink);
1522 WriteParam(m, p.max_shrink);
1523 WriteParam(m, p.desired_dpi);
1524 WriteParam(m, p.document_cookie);
1525 }
1526 static bool Read(const Message* m, void** iter, param_type* p) {
1527 return ReadParam(m, iter, &p->printable_size) &&
1528 ReadParam(m, iter, &p->dpi) &&
1529 ReadParam(m, iter, &p->min_shrink) &&
1530 ReadParam(m, iter, &p->max_shrink) &&
1531 ReadParam(m, iter, &p->desired_dpi) &&
1532 ReadParam(m, iter, &p->document_cookie);
1533 }
1534 static void Log(const param_type& p, std::wstring* l) {
1535 l->append(L"<ViewMsg_Print_Params>");
1536 }
1537 };
1538
1539 // Traits for ViewMsg_PrintPage_Params
1540 template <>
1541 struct ParamTraits<ViewMsg_PrintPage_Params> {
1542 typedef ViewMsg_PrintPage_Params param_type;
1543 static void Write(Message* m, const param_type& p) {
1544 WriteParam(m, p.params);
1545 WriteParam(m, p.page_number);
1546 }
1547 static bool Read(const Message* m, void** iter, param_type* p) {
1548 return ReadParam(m, iter, &p->params) &&
1549 ReadParam(m, iter, &p->page_number);
1550 }
1551 static void Log(const param_type& p, std::wstring* l) {
1552 l->append(L"<ViewMsg_PrintPage_Params>");
1553 }
1554 };
1555
1556 // Traits for ViewMsg_PrintPages_Params
1557 template <>
1558 struct ParamTraits<ViewMsg_PrintPages_Params> {
1559 typedef ViewMsg_PrintPages_Params param_type;
1560 static void Write(Message* m, const param_type& p) {
1561 WriteParam(m, p.params);
1562 WriteParam(m, p.pages);
1563 }
1564 static bool Read(const Message* m, void** iter, param_type* p) {
1565 return ReadParam(m, iter, &p->params) &&
1566 ReadParam(m, iter, &p->pages);
1567 }
1568 static void Log(const param_type& p, std::wstring* l) {
1569 l->append(L"<ViewMsg_PrintPages_Params>");
1570 }
1571 };
1572
1573 // Traits for ViewHostMsg_DidPrintPage_Params
1574 template <>
1575 struct ParamTraits<ViewHostMsg_DidPrintPage_Params> {
1576 typedef ViewHostMsg_DidPrintPage_Params param_type;
1577 static void Write(Message* m, const param_type& p) {
1578 WriteParam(m, p.emf_data_handle);
1579 WriteParam(m, p.data_size);
1580 WriteParam(m, p.document_cookie);
1581 WriteParam(m, p.page_number);
1582 WriteParam(m, p.actual_shrink);
1583 }
1584 static bool Read(const Message* m, void** iter, param_type* p) {
1585 return ReadParam(m, iter, &p->emf_data_handle) &&
1586 ReadParam(m, iter, &p->data_size) &&
1587 ReadParam(m, iter, &p->document_cookie) &&
1588 ReadParam(m, iter, &p->page_number) &&
1589 ReadParam(m, iter, &p->actual_shrink);
1590 }
1591 static void Log(const param_type& p, std::wstring* l) {
1592 l->append(L"<ViewHostMsg_DidPrintPage_Params>");
1593 }
1594 };
1595
1596 // Traits for WebPreferences structure to pack/unpack.
1555 template <> 1597 template <>
1556 struct ParamTraits<WebPreferences> { 1598 struct ParamTraits<WebPreferences> {
1557 typedef WebPreferences param_type; 1599 typedef WebPreferences param_type;
1558 static void Write(IPC::Message* m, const param_type& p) { 1600 static void Write(Message* m, const param_type& p) {
1559 WriteParam(m, p.standard_font_family); 1601 WriteParam(m, p.standard_font_family);
1560 WriteParam(m, p.fixed_font_family); 1602 WriteParam(m, p.fixed_font_family);
1561 WriteParam(m, p.serif_font_family); 1603 WriteParam(m, p.serif_font_family);
1562 WriteParam(m, p.sans_serif_font_family); 1604 WriteParam(m, p.sans_serif_font_family);
1563 WriteParam(m, p.cursive_font_family); 1605 WriteParam(m, p.cursive_font_family);
1564 WriteParam(m, p.fantasy_font_family); 1606 WriteParam(m, p.fantasy_font_family);
1565 WriteParam(m, p.default_font_size); 1607 WriteParam(m, p.default_font_size);
1566 WriteParam(m, p.default_fixed_font_size); 1608 WriteParam(m, p.default_fixed_font_size);
1567 WriteParam(m, p.minimum_font_size); 1609 WriteParam(m, p.minimum_font_size);
1568 WriteParam(m, p.minimum_logical_font_size); 1610 WriteParam(m, p.minimum_logical_font_size);
1569 WriteParam(m, p.default_encoding); 1611 WriteParam(m, p.default_encoding);
1570 WriteParam(m, p.javascript_enabled); 1612 WriteParam(m, p.javascript_enabled);
1571 WriteParam(m, p.javascript_can_open_windows_automatically); 1613 WriteParam(m, p.javascript_can_open_windows_automatically);
1572 WriteParam(m, p.loads_images_automatically); 1614 WriteParam(m, p.loads_images_automatically);
1573 WriteParam(m, p.plugins_enabled); 1615 WriteParam(m, p.plugins_enabled);
1574 WriteParam(m, p.dom_paste_enabled); 1616 WriteParam(m, p.dom_paste_enabled);
1575 WriteParam(m, p.developer_extras_enabled); 1617 WriteParam(m, p.developer_extras_enabled);
1576 WriteParam(m, p.shrinks_standalone_images_to_fit); 1618 WriteParam(m, p.shrinks_standalone_images_to_fit);
1577 WriteParam(m, p.uses_universal_detector); 1619 WriteParam(m, p.uses_universal_detector);
1578 WriteParam(m, p.text_areas_are_resizable); 1620 WriteParam(m, p.text_areas_are_resizable);
1579 WriteParam(m, p.java_enabled); 1621 WriteParam(m, p.java_enabled);
1580 WriteParam(m, p.user_style_sheet_enabled); 1622 WriteParam(m, p.user_style_sheet_enabled);
1581 WriteParam(m, p.user_style_sheet_location); 1623 WriteParam(m, p.user_style_sheet_location);
1582 WriteParam(m, p.uses_page_cache); 1624 WriteParam(m, p.uses_page_cache);
1583 } 1625 }
1584 static bool Read(const IPC::Message* m, void** iter, param_type* p) { 1626 static bool Read(const Message* m, void** iter, param_type* p) {
1585 return 1627 return
1586 ReadParam(m, iter, &p->standard_font_family) && 1628 ReadParam(m, iter, &p->standard_font_family) &&
1587 ReadParam(m, iter, &p->fixed_font_family) && 1629 ReadParam(m, iter, &p->fixed_font_family) &&
1588 ReadParam(m, iter, &p->serif_font_family) && 1630 ReadParam(m, iter, &p->serif_font_family) &&
1589 ReadParam(m, iter, &p->sans_serif_font_family) && 1631 ReadParam(m, iter, &p->sans_serif_font_family) &&
1590 ReadParam(m, iter, &p->cursive_font_family) && 1632 ReadParam(m, iter, &p->cursive_font_family) &&
1591 ReadParam(m, iter, &p->fantasy_font_family) && 1633 ReadParam(m, iter, &p->fantasy_font_family) &&
1592 ReadParam(m, iter, &p->default_font_size) && 1634 ReadParam(m, iter, &p->default_font_size) &&
1593 ReadParam(m, iter, &p->default_fixed_font_size) && 1635 ReadParam(m, iter, &p->default_fixed_font_size) &&
1594 ReadParam(m, iter, &p->minimum_font_size) && 1636 ReadParam(m, iter, &p->minimum_font_size) &&
(...skipping 11 matching lines...) Expand all
1606 ReadParam(m, iter, &p->java_enabled) && 1648 ReadParam(m, iter, &p->java_enabled) &&
1607 ReadParam(m, iter, &p->user_style_sheet_enabled) && 1649 ReadParam(m, iter, &p->user_style_sheet_enabled) &&
1608 ReadParam(m, iter, &p->user_style_sheet_location) && 1650 ReadParam(m, iter, &p->user_style_sheet_location) &&
1609 ReadParam(m, iter, &p->uses_page_cache); 1651 ReadParam(m, iter, &p->uses_page_cache);
1610 } 1652 }
1611 static void Log(const param_type& p, std::wstring* l) { 1653 static void Log(const param_type& p, std::wstring* l) {
1612 l->append(L"<WebPreferences>"); 1654 l->append(L"<WebPreferences>");
1613 } 1655 }
1614 }; 1656 };
1615 1657
1658 // Traits for WebDropData
1616 template <> 1659 template <>
1617 struct ParamTraits<WebDropData> { 1660 struct ParamTraits<WebDropData> {
1618 typedef WebDropData param_type; 1661 typedef WebDropData param_type;
1619 static void Write(IPC::Message* m, const param_type& p) { 1662 static void Write(Message* m, const param_type& p) {
1620 WriteParam(m, p.url); 1663 WriteParam(m, p.url);
1621 WriteParam(m, p.url_title); 1664 WriteParam(m, p.url_title);
1622 WriteParam(m, p.file_extension); 1665 WriteParam(m, p.file_extension);
1623 WriteParam(m, p.filenames); 1666 WriteParam(m, p.filenames);
1624 WriteParam(m, p.plain_text); 1667 WriteParam(m, p.plain_text);
1625 WriteParam(m, p.text_html); 1668 WriteParam(m, p.text_html);
1626 WriteParam(m, p.html_base_url); 1669 WriteParam(m, p.html_base_url);
1627 WriteParam(m, p.file_description_filename); 1670 WriteParam(m, p.file_description_filename);
1628 WriteParam(m, p.file_contents); 1671 WriteParam(m, p.file_contents);
1629 } 1672 }
1630 static bool Read(const IPC::Message* m, void** iter, param_type* p) { 1673 static bool Read(const Message* m, void** iter, param_type* p) {
1631 return 1674 return
1632 ReadParam(m, iter, &p->url) && 1675 ReadParam(m, iter, &p->url) &&
1633 ReadParam(m, iter, &p->url_title) && 1676 ReadParam(m, iter, &p->url_title) &&
1634 ReadParam(m, iter, &p->file_extension) && 1677 ReadParam(m, iter, &p->file_extension) &&
1635 ReadParam(m, iter, &p->filenames) && 1678 ReadParam(m, iter, &p->filenames) &&
1636 ReadParam(m, iter, &p->plain_text) && 1679 ReadParam(m, iter, &p->plain_text) &&
1637 ReadParam(m, iter, &p->text_html) && 1680 ReadParam(m, iter, &p->text_html) &&
1638 ReadParam(m, iter, &p->html_base_url) && 1681 ReadParam(m, iter, &p->html_base_url) &&
1639 ReadParam(m, iter, &p->file_description_filename) && 1682 ReadParam(m, iter, &p->file_description_filename) &&
1640 ReadParam(m, iter, &p->file_contents); 1683 ReadParam(m, iter, &p->file_contents);
1641 } 1684 }
1642 static void Log(const param_type& p, std::wstring* l) { 1685 static void Log(const param_type& p, std::wstring* l) {
1643 l->append(L"<WebDropData>"); 1686 l->append(L"<WebDropData>");
1644 } 1687 }
1645 }; 1688 };
1646 1689
1690 // Traits for ScreenInfo
1647 template <> 1691 template <>
1648 struct ParamTraits<webkit_glue::ScreenInfo> { 1692 struct ParamTraits<webkit_glue::ScreenInfo> {
1649 typedef webkit_glue::ScreenInfo param_type; 1693 typedef webkit_glue::ScreenInfo param_type;
1650 static void Write(IPC::Message* m, const param_type& p) { 1694 static void Write(Message* m, const param_type& p) {
1651 WriteParam(m, p.depth); 1695 WriteParam(m, p.depth);
1652 WriteParam(m, p.depth_per_component); 1696 WriteParam(m, p.depth_per_component);
1653 WriteParam(m, p.is_monochrome); 1697 WriteParam(m, p.is_monochrome);
1654 WriteParam(m, p.rect); 1698 WriteParam(m, p.rect);
1655 WriteParam(m, p.available_rect); 1699 WriteParam(m, p.available_rect);
1656 } 1700 }
1657 static bool Read(const IPC::Message* m, void** iter, param_type* p) { 1701 static bool Read(const Message* m, void** iter, param_type* p) {
1658 return 1702 return
1659 ReadParam(m, iter, &p->depth) && 1703 ReadParam(m, iter, &p->depth) &&
1660 ReadParam(m, iter, &p->depth_per_component) && 1704 ReadParam(m, iter, &p->depth_per_component) &&
1661 ReadParam(m, iter, &p->is_monochrome) && 1705 ReadParam(m, iter, &p->is_monochrome) &&
1662 ReadParam(m, iter, &p->rect) && 1706 ReadParam(m, iter, &p->rect) &&
1663 ReadParam(m, iter, &p->available_rect); 1707 ReadParam(m, iter, &p->available_rect);
1664 } 1708 }
1665 static void Log(const param_type& p, std::wstring* l) { 1709 static void Log(const param_type& p, std::wstring* l) {
1666 l->append(L"<webkit_glue::ScreenInfo>"); 1710 l->append(L"<webkit_glue::ScreenInfo>");
1667 } 1711 }
1668 }; 1712 };
1669 1713
1670 template<> 1714 template<>
1671 struct ParamTraits<ModalDialogEvent> { 1715 struct ParamTraits<ModalDialogEvent> {
1672 typedef ModalDialogEvent param_type; 1716 typedef ModalDialogEvent param_type;
1673 #if defined(OS_WIN) 1717 #if defined(OS_WIN)
1674 static void Write(IPC::Message* m, const param_type& p) { 1718 static void Write(Message* m, const param_type& p) {
1675 WriteParam(m, p.event); 1719 WriteParam(m, p.event);
1676 } 1720 }
1677 static bool Read(const IPC::Message* m, void** iter, param_type* p) { 1721 static bool Read(const Message* m, void** iter, param_type* p) {
1678 return ReadParam(m, iter, &p->event); 1722 return ReadParam(m, iter, &p->event);
1679 } 1723 }
1680 #else 1724 #else
1681 static void Write(IPC::Message* m, const param_type& p) { 1725 static void Write(Message* m, const param_type& p) {
1682 } 1726 }
1683 static bool Read(const IPC::Message* m, void** iter, param_type* p) { 1727 static bool Read(const Message* m, void** iter, param_type* p) {
1684 return true; 1728 return true;
1685 } 1729 }
1686 #endif 1730 #endif
1687 1731
1688 static void Log(const param_type& p, std::wstring* l) { 1732 static void Log(const param_type& p, std::wstring* l) {
1689 l->append(L"<ModalDialogEvent>"); 1733 l->append(L"<ModalDialogEvent>");
1690 } 1734 }
1691 }; 1735 };
1692 1736
1693 #if defined(OS_POSIX) 1737 #if defined(OS_POSIX)
1694 1738
1695 // TODO(port): this shouldn't exist. However, the plugin stuff is really using 1739 // TODO(port): this shouldn't exist. However, the plugin stuff is really using
1696 // HWNDS (NativeView), and making Windows calls based on them. I've not figured 1740 // HWNDS (NativeView), and making Windows calls based on them. I've not figured
1697 // out the deal with plugins yet. 1741 // out the deal with plugins yet.
1698 template <> 1742 template <>
1699 struct ParamTraits<gfx::NativeView> { 1743 struct ParamTraits<gfx::NativeView> {
1700 typedef gfx::NativeView param_type; 1744 typedef gfx::NativeView param_type;
1701 static void Write(IPC::Message* m, const param_type& p) { 1745 static void Write(Message* m, const param_type& p) {
1702 NOTIMPLEMENTED(); 1746 NOTIMPLEMENTED();
1703 } 1747 }
1704 1748
1705 static bool Read(const IPC::Message* m, void** iter, param_type* p) { 1749 static bool Read(const Message* m, void** iter, param_type* p) {
1706 NOTIMPLEMENTED(); 1750 NOTIMPLEMENTED();
1707 *p = NULL; 1751 *p = NULL;
1708 return true; 1752 return true;
1709 } 1753 }
1710 1754
1711 static void Log(const param_type& p, std::wstring* l) { 1755 static void Log(const param_type& p, std::wstring* l) {
1712 l->append(StringPrintf(L"<gfx::NativeView>")); 1756 l->append(StringPrintf(L"<gfx::NativeView>"));
1713 } 1757 }
1714 }; 1758 };
1715 1759
1716 #endif // defined(OS_POSIX) 1760 #endif // defined(OS_POSIX)
1717 1761
1718 1762 } // namespace IPC
1719 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h"
1720 #include "chrome/common/ipc_message_macros.h"
1721 1763
1722 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ 1764 #endif // CHROME_COMMON_RENDER_MESSAGES_H_
OLDNEW
« no previous file with comments | « chrome/common/plugin_messages_internal.h ('k') | chrome/common/render_messages_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698