OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // IPC messages for extensions. | 5 // IPC messages for extensions. |
6 // Multiply-included message file, hence no include guard. | 6 // Multiply-included message file, hence no include guard. |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include <string> | 10 #include <string> |
9 #include <vector> | 11 #include <vector> |
10 | 12 |
11 #include "base/memory/shared_memory.h" | 13 #include "base/memory/shared_memory.h" |
12 #include "base/values.h" | 14 #include "base/values.h" |
13 #include "content/public/common/common_param_traits.h" | 15 #include "content/public/common/common_param_traits.h" |
14 #include "content/public/common/socket_permission_request.h" | 16 #include "content/public/common/socket_permission_request.h" |
15 #include "extensions/common/api/messaging/message.h" | 17 #include "extensions/common/api/messaging/message.h" |
16 #include "extensions/common/draggable_region.h" | 18 #include "extensions/common/draggable_region.h" |
17 #include "extensions/common/extension.h" | 19 #include "extensions/common/extension.h" |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 // The browser's response to the ExtensionMsg_WakeEventPage IPC. | 512 // The browser's response to the ExtensionMsg_WakeEventPage IPC. |
511 IPC_MESSAGE_CONTROL2(ExtensionMsg_WakeEventPageResponse, | 513 IPC_MESSAGE_CONTROL2(ExtensionMsg_WakeEventPageResponse, |
512 int /* request_id */, | 514 int /* request_id */, |
513 bool /* success */) | 515 bool /* success */) |
514 | 516 |
515 // Ask the lazy background page if it is ready to be suspended. This is sent | 517 // Ask the lazy background page if it is ready to be suspended. This is sent |
516 // when the page is considered idle. The renderer will reply with the same | 518 // when the page is considered idle. The renderer will reply with the same |
517 // sequence_id so that we can tell which message it is responding to. | 519 // sequence_id so that we can tell which message it is responding to. |
518 IPC_MESSAGE_CONTROL2(ExtensionMsg_ShouldSuspend, | 520 IPC_MESSAGE_CONTROL2(ExtensionMsg_ShouldSuspend, |
519 std::string /* extension_id */, | 521 std::string /* extension_id */, |
520 uint64 /* sequence_id */) | 522 uint64_t /* sequence_id */) |
521 | 523 |
522 // If we complete a round of ShouldSuspend->ShouldSuspendAck messages without | 524 // If we complete a round of ShouldSuspend->ShouldSuspendAck messages without |
523 // the lazy background page becoming active again, we are ready to unload. This | 525 // the lazy background page becoming active again, we are ready to unload. This |
524 // message tells the page to dispatch the suspend event. | 526 // message tells the page to dispatch the suspend event. |
525 IPC_MESSAGE_CONTROL1(ExtensionMsg_Suspend, | 527 IPC_MESSAGE_CONTROL1(ExtensionMsg_Suspend, |
526 std::string /* extension_id */) | 528 std::string /* extension_id */) |
527 | 529 |
528 // The browser changed its mind about suspending this extension. | 530 // The browser changed its mind about suspending this extension. |
529 IPC_MESSAGE_CONTROL1(ExtensionMsg_CancelSuspend, | 531 IPC_MESSAGE_CONTROL1(ExtensionMsg_CancelSuspend, |
530 std::string /* extension_id */) | 532 std::string /* extension_id */) |
531 | 533 |
532 // Response to the renderer for ExtensionHostMsg_GetAppInstallState. | 534 // Response to the renderer for ExtensionHostMsg_GetAppInstallState. |
533 IPC_MESSAGE_ROUTED2(ExtensionMsg_GetAppInstallStateResponse, | 535 IPC_MESSAGE_ROUTED2(ExtensionMsg_GetAppInstallStateResponse, |
534 std::string /* state */, | 536 std::string /* state */, |
535 int32 /* callback_id */) | 537 int32_t /* callback_id */) |
536 | 538 |
537 // Dispatch the Port.onConnect event for message channels. | 539 // Dispatch the Port.onConnect event for message channels. |
538 IPC_MESSAGE_ROUTED5(ExtensionMsg_DispatchOnConnect, | 540 IPC_MESSAGE_ROUTED5(ExtensionMsg_DispatchOnConnect, |
539 int /* target_port_id */, | 541 int /* target_port_id */, |
540 std::string /* channel_name */, | 542 std::string /* channel_name */, |
541 ExtensionMsg_TabConnectionInfo /* source */, | 543 ExtensionMsg_TabConnectionInfo /* source */, |
542 ExtensionMsg_ExternalConnectionInfo, | 544 ExtensionMsg_ExternalConnectionInfo, |
543 std::string /* tls_channel_id */) | 545 std::string /* tls_channel_id */) |
544 | 546 |
545 // Deliver a message sent with ExtensionHostMsg_PostMessage. | 547 // Deliver a message sent with ExtensionHostMsg_PostMessage. |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 GURL /* url of the _topmost_ frame */) | 694 GURL /* url of the _topmost_ frame */) |
693 | 695 |
694 // Sent from the renderer to the browser to request permission for a script | 696 // Sent from the renderer to the browser to request permission for a script |
695 // injection. | 697 // injection. |
696 // If request id is -1, this signals that the request has already ran, and this | 698 // If request id is -1, this signals that the request has already ran, and this |
697 // merely serves as a notification. This happens when the feature to disable | 699 // merely serves as a notification. This happens when the feature to disable |
698 // scripts running without user consent is not enabled. | 700 // scripts running without user consent is not enabled. |
699 IPC_MESSAGE_ROUTED3(ExtensionHostMsg_RequestScriptInjectionPermission, | 701 IPC_MESSAGE_ROUTED3(ExtensionHostMsg_RequestScriptInjectionPermission, |
700 std::string /* extension id */, | 702 std::string /* extension id */, |
701 extensions::UserScript::InjectionType /* script type */, | 703 extensions::UserScript::InjectionType /* script type */, |
702 int64 /* request id */) | 704 int64_t /* request id */) |
703 | 705 |
704 // Sent from the browser to the renderer in reply to a | 706 // Sent from the browser to the renderer in reply to a |
705 // RequestScriptInjectionPermission message, granting permission for a script | 707 // RequestScriptInjectionPermission message, granting permission for a script |
706 // script to run. | 708 // script to run. |
707 IPC_MESSAGE_ROUTED1(ExtensionMsg_PermitScriptInjection, | 709 IPC_MESSAGE_ROUTED1(ExtensionMsg_PermitScriptInjection, |
708 int64 /* request id */) | 710 int64_t /* request id */) |
709 | 711 |
710 // Sent by the renderer when a web page is checking if its app is installed. | 712 // Sent by the renderer when a web page is checking if its app is installed. |
711 IPC_MESSAGE_ROUTED3(ExtensionHostMsg_GetAppInstallState, | 713 IPC_MESSAGE_ROUTED3(ExtensionHostMsg_GetAppInstallState, |
712 GURL /* requestor_url */, | 714 GURL /* requestor_url */, |
713 int32 /* return_route_id */, | 715 int32_t /* return_route_id */, |
714 int32 /* callback_id */) | 716 int32_t /* callback_id */) |
715 | 717 |
716 // Optional Ack message sent to the browser to notify that the response to a | 718 // Optional Ack message sent to the browser to notify that the response to a |
717 // function has been processed. | 719 // function has been processed. |
718 IPC_MESSAGE_ROUTED1(ExtensionHostMsg_ResponseAck, | 720 IPC_MESSAGE_ROUTED1(ExtensionHostMsg_ResponseAck, |
719 int /* request_id */) | 721 int /* request_id */) |
720 | 722 |
721 // Response to ExtensionMsg_ShouldSuspend. | 723 // Response to ExtensionMsg_ShouldSuspend. |
722 IPC_MESSAGE_CONTROL2(ExtensionHostMsg_ShouldSuspendAck, | 724 IPC_MESSAGE_CONTROL2(ExtensionHostMsg_ShouldSuspendAck, |
723 std::string /* extension_id */, | 725 std::string /* extension_id */, |
724 uint64 /* sequence_id */) | 726 uint64_t /* sequence_id */) |
725 | 727 |
726 // Response to ExtensionMsg_Suspend, after we dispatch the suspend event. | 728 // Response to ExtensionMsg_Suspend, after we dispatch the suspend event. |
727 IPC_MESSAGE_CONTROL1(ExtensionHostMsg_SuspendAck, | 729 IPC_MESSAGE_CONTROL1(ExtensionHostMsg_SuspendAck, |
728 std::string /* extension_id */) | 730 std::string /* extension_id */) |
729 | 731 |
730 // Informs the browser to increment the keepalive count for the lazy background | 732 // Informs the browser to increment the keepalive count for the lazy background |
731 // page, keeping it alive. | 733 // page, keeping it alive. |
732 IPC_MESSAGE_ROUTED0(ExtensionHostMsg_IncrementLazyKeepaliveCount) | 734 IPC_MESSAGE_ROUTED0(ExtensionHostMsg_IncrementLazyKeepaliveCount) |
733 | 735 |
734 // Informs the browser there is one less thing keeping the lazy background page | 736 // Informs the browser there is one less thing keeping the lazy background page |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 IPC_MESSAGE_CONTROL2(ExtensionHostMsg_WakeEventPage, | 786 IPC_MESSAGE_CONTROL2(ExtensionHostMsg_WakeEventPage, |
785 int /* request_id */, | 787 int /* request_id */, |
786 std::string /* extension_id */) | 788 std::string /* extension_id */) |
787 | 789 |
788 // Tells listeners that a detailed message was reported to the console by | 790 // Tells listeners that a detailed message was reported to the console by |
789 // WebKit. | 791 // WebKit. |
790 IPC_MESSAGE_ROUTED4(ExtensionHostMsg_DetailedConsoleMessageAdded, | 792 IPC_MESSAGE_ROUTED4(ExtensionHostMsg_DetailedConsoleMessageAdded, |
791 base::string16 /* message */, | 793 base::string16 /* message */, |
792 base::string16 /* source */, | 794 base::string16 /* source */, |
793 extensions::StackTrace /* stack trace */, | 795 extensions::StackTrace /* stack trace */, |
794 int32 /* severity level */) | 796 int32_t /* severity level */) |
795 | 797 |
796 // Sent when a query selector request is made from the automation API. | 798 // Sent when a query selector request is made from the automation API. |
797 // acc_obj_id is the accessibility tree ID of the starting element. | 799 // acc_obj_id is the accessibility tree ID of the starting element. |
798 IPC_MESSAGE_ROUTED3(ExtensionMsg_AutomationQuerySelector, | 800 IPC_MESSAGE_ROUTED3(ExtensionMsg_AutomationQuerySelector, |
799 int /* request_id */, | 801 int /* request_id */, |
800 int /* acc_obj_id */, | 802 int /* acc_obj_id */, |
801 base::string16 /* selector */) | 803 base::string16 /* selector */) |
802 | 804 |
803 // Result of a query selector request. | 805 // Result of a query selector request. |
804 // result_acc_obj_id is the accessibility tree ID of the result element; 0 | 806 // result_acc_obj_id is the accessibility tree ID of the result element; 0 |
805 // indicates no result. | 807 // indicates no result. |
806 IPC_MESSAGE_ROUTED3(ExtensionHostMsg_AutomationQuerySelector_Result, | 808 IPC_MESSAGE_ROUTED3(ExtensionHostMsg_AutomationQuerySelector_Result, |
807 int /* request_id */, | 809 int /* request_id */, |
808 ExtensionHostMsg_AutomationQuerySelector_Error /* error */, | 810 ExtensionHostMsg_AutomationQuerySelector_Error /* error */, |
809 int /* result_acc_obj_id */) | 811 int /* result_acc_obj_id */) |
OLD | NEW |