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