OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_PARAMS_H_ | 5 #ifndef CHROME_COMMON_RENDER_MESSAGES_PARAMS_H_ |
6 #define CHROME_COMMON_RENDER_MESSAGES_PARAMS_H_ | 6 #define CHROME_COMMON_RENDER_MESSAGES_PARAMS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 // ViewHostMsg_UpdateRect_Flags::IS_REPAINT_ACK | 269 // ViewHostMsg_UpdateRect_Flags::IS_REPAINT_ACK |
270 // Indicates that this is a response to a ViewMsg_Repaint message. | 270 // Indicates that this is a response to a ViewMsg_Repaint message. |
271 // | 271 // |
272 // If flags is zero, then this message corresponds to an unsoliticed paint | 272 // If flags is zero, then this message corresponds to an unsoliticed paint |
273 // request by the render view. Any of the above bits may be set in flags, | 273 // request by the render view. Any of the above bits may be set in flags, |
274 // which would indicate that this paint message is an ACK for multiple | 274 // which would indicate that this paint message is an ACK for multiple |
275 // request messages. | 275 // request messages. |
276 int flags; | 276 int flags; |
277 }; | 277 }; |
278 | 278 |
279 // Information on closing a tab. This is used both for ViewMsg_ClosePage, and | |
280 // the corresponding ViewHostMsg_ClosePage_ACK. | |
281 struct ViewMsg_ClosePage_Params { | |
282 ViewMsg_ClosePage_Params(); | |
283 ~ViewMsg_ClosePage_Params(); | |
284 | |
285 // The identifier of the RenderProcessHost for the currently closing view. | |
286 // | |
287 // These first two parameters are technically redundant since they are | |
288 // needed only when processing the ACK message, and the processor | |
289 // theoretically knows both the process and route ID. However, this is | |
290 // difficult to figure out with our current implementation, so this | |
291 // information is duplicate here. | |
292 int closing_process_id; | |
293 | |
294 // The route identifier for the currently closing RenderView. | |
295 int closing_route_id; | |
296 | |
297 // True when this close is for the first (closing) tab of a cross-site | |
298 // transition where we switch processes. False indicates the close is for the | |
299 // entire tab. | |
300 // | |
301 // When true, the new_* variables below must be filled in. Otherwise they must | |
302 // both be -1. | |
303 bool for_cross_site_transition; | |
304 | |
305 // The identifier of the RenderProcessHost for the new view attempting to | |
306 // replace the closing one above. This must be valid when | |
307 // for_cross_site_transition is set, and must be -1 otherwise. | |
308 int new_render_process_host_id; | |
309 | |
310 // The identifier of the *request* the new view made that is causing the | |
311 // cross-site transition. This is *not* a route_id, but the request that we | |
312 // will resume once the ACK from the closing view has been received. This | |
313 // must be valid when for_cross_site_transition is set, and must be -1 | |
314 // otherwise. | |
315 int new_request_id; | |
316 }; | |
317 | |
318 // Parameters for a render request. | 279 // Parameters for a render request. |
319 struct ViewMsg_Print_Params { | 280 struct ViewMsg_Print_Params { |
320 ViewMsg_Print_Params(); | 281 ViewMsg_Print_Params(); |
321 ~ViewMsg_Print_Params(); | 282 ~ViewMsg_Print_Params(); |
322 | 283 |
323 // Physical size of the page, including non-printable margins, | 284 // Physical size of the page, including non-printable margins, |
324 // in pixels according to dpi. | 285 // in pixels according to dpi. |
325 gfx::Size page_size; | 286 gfx::Size page_size; |
326 | 287 |
327 // In pixels according to dpi_x and dpi_y. | 288 // In pixels according to dpi_x and dpi_y. |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 // Whether the code is JavaScript or CSS. | 427 // Whether the code is JavaScript or CSS. |
467 bool is_javascript; | 428 bool is_javascript; |
468 | 429 |
469 // String of code to execute. | 430 // String of code to execute. |
470 std::string code; | 431 std::string code; |
471 | 432 |
472 // Whether to inject into all frames, or only the root frame. | 433 // Whether to inject into all frames, or only the root frame. |
473 bool all_frames; | 434 bool all_frames; |
474 }; | 435 }; |
475 | 436 |
476 // Parameters for the message that creates a worker thread. | |
477 struct ViewHostMsg_CreateWorker_Params { | |
478 ViewHostMsg_CreateWorker_Params(); | |
479 ~ViewHostMsg_CreateWorker_Params(); | |
480 | |
481 // URL for the worker script. | |
482 GURL url; | |
483 | |
484 // True if this is a SharedWorker, false if it is a dedicated Worker. | |
485 bool is_shared; | |
486 | |
487 // Name for a SharedWorker, otherwise empty string. | |
488 string16 name; | |
489 | |
490 // The ID of the parent document (unique within parent renderer). | |
491 unsigned long long document_id; | |
492 | |
493 // RenderView routing id used to send messages back to the parent. | |
494 int render_view_route_id; | |
495 | |
496 // The route ID to associate with the worker. If MSG_ROUTING_NONE is passed, | |
497 // a new unique ID is created and assigned to the worker. | |
498 int route_id; | |
499 | |
500 // The ID of the parent's appcache host, only valid for dedicated workers. | |
501 int parent_appcache_host_id; | |
502 | |
503 // The ID of the appcache the main shared worker script resource was loaded | |
504 // from, only valid for shared workers. | |
505 int64 script_resource_appcache_id; | |
506 }; | |
507 | |
508 struct ViewHostMsg_CreateWindow_Params { | 437 struct ViewHostMsg_CreateWindow_Params { |
509 ViewHostMsg_CreateWindow_Params(); | 438 ViewHostMsg_CreateWindow_Params(); |
510 ~ViewHostMsg_CreateWindow_Params(); | 439 ~ViewHostMsg_CreateWindow_Params(); |
511 | 440 |
512 // Routing ID of the view initiating the open. | 441 // Routing ID of the view initiating the open. |
513 int opener_id; | 442 int opener_id; |
514 | 443 |
515 // True if this open request came in the context of a user gesture. | 444 // True if this open request came in the context of a user gesture. |
516 bool user_gesture; | 445 bool user_gesture; |
517 | 446 |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
711 | 640 |
712 template <> | 641 template <> |
713 struct ParamTraits<ViewHostMsg_UpdateRect_Params> { | 642 struct ParamTraits<ViewHostMsg_UpdateRect_Params> { |
714 typedef ViewHostMsg_UpdateRect_Params param_type; | 643 typedef ViewHostMsg_UpdateRect_Params param_type; |
715 static void Write(Message* m, const param_type& p); | 644 static void Write(Message* m, const param_type& p); |
716 static bool Read(const Message* m, void** iter, param_type* p); | 645 static bool Read(const Message* m, void** iter, param_type* p); |
717 static void Log(const param_type& p, std::string* l); | 646 static void Log(const param_type& p, std::string* l); |
718 }; | 647 }; |
719 | 648 |
720 template <> | 649 template <> |
721 struct ParamTraits<ViewMsg_ClosePage_Params> { | |
722 typedef ViewMsg_ClosePage_Params param_type; | |
723 static void Write(Message* m, const param_type& p); | |
724 static bool Read(const Message* m, void** iter, param_type* r); | |
725 static void Log(const param_type& p, std::string* l); | |
726 }; | |
727 | |
728 template <> | |
729 struct ParamTraits<ViewMsg_Print_Params> { | 650 struct ParamTraits<ViewMsg_Print_Params> { |
730 typedef ViewMsg_Print_Params param_type; | 651 typedef ViewMsg_Print_Params param_type; |
731 static void Write(Message* m, const param_type& p); | 652 static void Write(Message* m, const param_type& p); |
732 static bool Read(const Message* m, void** iter, param_type* p); | 653 static bool Read(const Message* m, void** iter, param_type* p); |
733 static void Log(const param_type& p, std::string* l); | 654 static void Log(const param_type& p, std::string* l); |
734 }; | 655 }; |
735 | 656 |
736 template <> | 657 template <> |
737 struct ParamTraits<ViewMsg_PrintPage_Params> { | 658 struct ParamTraits<ViewMsg_PrintPage_Params> { |
738 typedef ViewMsg_PrintPage_Params param_type; | 659 typedef ViewMsg_PrintPage_Params param_type; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 }; | 695 }; |
775 | 696 |
776 template <> | 697 template <> |
777 struct ParamTraits<ViewMsg_ExecuteCode_Params> { | 698 struct ParamTraits<ViewMsg_ExecuteCode_Params> { |
778 typedef ViewMsg_ExecuteCode_Params param_type; | 699 typedef ViewMsg_ExecuteCode_Params param_type; |
779 static void Write(Message* m, const param_type& p); | 700 static void Write(Message* m, const param_type& p); |
780 static bool Read(const Message* m, void** iter, param_type* p); | 701 static bool Read(const Message* m, void** iter, param_type* p); |
781 static void Log(const param_type& p, std::string* l); | 702 static void Log(const param_type& p, std::string* l); |
782 }; | 703 }; |
783 | 704 |
784 template <> | |
785 struct ParamTraits<ViewHostMsg_CreateWorker_Params> { | |
786 typedef ViewHostMsg_CreateWorker_Params param_type; | |
787 static void Write(Message* m, const param_type& p); | |
788 static bool Read(const Message* m, void** iter, param_type* p); | |
789 static void Log(const param_type& p, std::string* l); | |
790 }; | |
791 | |
792 template<> | 705 template<> |
793 struct ParamTraits<ViewHostMsg_CreateWindow_Params> { | 706 struct ParamTraits<ViewHostMsg_CreateWindow_Params> { |
794 typedef ViewHostMsg_CreateWindow_Params param_type; | 707 typedef ViewHostMsg_CreateWindow_Params param_type; |
795 static void Write(Message* m, const param_type& p); | 708 static void Write(Message* m, const param_type& p); |
796 static bool Read(const Message* m, void** iter, param_type* p); | 709 static bool Read(const Message* m, void** iter, param_type* p); |
797 static void Log(const param_type& p, std::string* l); | 710 static void Log(const param_type& p, std::string* l); |
798 }; | 711 }; |
799 | 712 |
800 template<> | 713 template<> |
801 struct ParamTraits<ViewHostMsg_RunFileChooser_Params> { | 714 struct ParamTraits<ViewHostMsg_RunFileChooser_Params> { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
841 struct ParamTraits<ViewHostMsg_MalwareDOMDetails_Node> { | 754 struct ParamTraits<ViewHostMsg_MalwareDOMDetails_Node> { |
842 typedef ViewHostMsg_MalwareDOMDetails_Node param_type; | 755 typedef ViewHostMsg_MalwareDOMDetails_Node param_type; |
843 static void Write(Message* m, const param_type& p); | 756 static void Write(Message* m, const param_type& p); |
844 static bool Read(const Message* m, void** iter, param_type* p); | 757 static bool Read(const Message* m, void** iter, param_type* p); |
845 static void Log(const param_type& p, std::string* l); | 758 static void Log(const param_type& p, std::string* l); |
846 }; | 759 }; |
847 | 760 |
848 } // namespace IPC | 761 } // namespace IPC |
849 | 762 |
850 #endif // CHROME_COMMON_RENDER_MESSAGES_PARAMS_H_ | 763 #endif // CHROME_COMMON_RENDER_MESSAGES_PARAMS_H_ |
OLD | NEW |