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

Side by Side Diff: extensions/common/extension_messages.h

Issue 1880933002: Begin to enable extension APIs in Extension Service Worker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments -> round 1 Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 IPC_STRUCT_MEMBER(int, source_tab_id) 99 IPC_STRUCT_MEMBER(int, source_tab_id)
100 100
101 // Unique request id to match requests and responses. 101 // Unique request id to match requests and responses.
102 IPC_STRUCT_MEMBER(int, request_id) 102 IPC_STRUCT_MEMBER(int, request_id)
103 103
104 // True if request has a callback specified. 104 // True if request has a callback specified.
105 IPC_STRUCT_MEMBER(bool, has_callback) 105 IPC_STRUCT_MEMBER(bool, has_callback)
106 106
107 // True if request is executed in response to an explicit user gesture. 107 // True if request is executed in response to an explicit user gesture.
108 IPC_STRUCT_MEMBER(bool, user_gesture) 108 IPC_STRUCT_MEMBER(bool, user_gesture)
109
110 // If this API call is for a service worker, then this is the worker thread
111 // id. Otherwise, this is -1.
112 IPC_STRUCT_MEMBER(int, worker_thread_id)
113
114 // If this API call is for a service worker, then this is the embedded
115 // worker id. Otherwise, this is -1.
116 IPC_STRUCT_MEMBER(int, embedded_worker_id)
109 IPC_STRUCT_END() 117 IPC_STRUCT_END()
110 118
111 // Allows an extension to execute code in a tab. 119 // Allows an extension to execute code in a tab.
112 IPC_STRUCT_BEGIN(ExtensionMsg_ExecuteCode_Params) 120 IPC_STRUCT_BEGIN(ExtensionMsg_ExecuteCode_Params)
113 // The extension API request id, for responding. 121 // The extension API request id, for responding.
114 IPC_STRUCT_MEMBER(int, request_id) 122 IPC_STRUCT_MEMBER(int, request_id)
115 123
116 // The ID of the requesting injection host. 124 // The ID of the requesting injection host.
117 IPC_STRUCT_MEMBER(HostID, host_id) 125 IPC_STRUCT_MEMBER(HostID, host_id)
118 126
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 572
565 // Dispatch the Port.onDisconnect event for message channels. 573 // Dispatch the Port.onDisconnect event for message channels.
566 IPC_MESSAGE_ROUTED2(ExtensionMsg_DispatchOnDisconnect, 574 IPC_MESSAGE_ROUTED2(ExtensionMsg_DispatchOnDisconnect,
567 int /* port_id */, 575 int /* port_id */,
568 std::string /* error_message */) 576 std::string /* error_message */)
569 577
570 // Informs the renderer what channel (dev, beta, stable, etc) is running. 578 // Informs the renderer what channel (dev, beta, stable, etc) is running.
571 IPC_MESSAGE_CONTROL1(ExtensionMsg_SetChannel, 579 IPC_MESSAGE_CONTROL1(ExtensionMsg_SetChannel,
572 int /* channel */) 580 int /* channel */)
573 581
582 // Informs the renderer whether extension APIs should be enabled in extension
583 // service worker contexts.
584 IPC_MESSAGE_CONTROL1(
585 ExtensionMsg_SetExtensionAPIEnabledInExtensionServiceWorkers,
586 bool /* enabled */)
Devlin 2016/04/14 22:34:52 Maybe we should just enable this on trunk. For on
lazyboy 2016/04/15 00:57:47 OK, moved the feature thing to ExtensionsClient.
587
574 // Notify the renderer that its window has closed. 588 // Notify the renderer that its window has closed.
575 IPC_MESSAGE_ROUTED0(ExtensionMsg_AppWindowClosed) 589 IPC_MESSAGE_ROUTED0(ExtensionMsg_AppWindowClosed)
576 590
577 // Notify the renderer that an extension wants notifications when certain 591 // Notify the renderer that an extension wants notifications when certain
578 // searches match the active page. This message replaces the old set of 592 // searches match the active page. This message replaces the old set of
579 // searches, and triggers ExtensionHostMsg_OnWatchedPageChange messages from 593 // searches, and triggers ExtensionHostMsg_OnWatchedPageChange messages from
580 // each tab to keep the browser updated about changes. 594 // each tab to keep the browser updated about changes.
581 IPC_MESSAGE_CONTROL1(ExtensionMsg_WatchPages, 595 IPC_MESSAGE_CONTROL1(ExtensionMsg_WatchPages,
582 std::vector<std::string> /* CSS selectors */) 596 std::vector<std::string> /* CSS selectors */)
583 597
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
824 int /* acc_obj_id */, 838 int /* acc_obj_id */,
825 base::string16 /* selector */) 839 base::string16 /* selector */)
826 840
827 // Result of a query selector request. 841 // Result of a query selector request.
828 // result_acc_obj_id is the accessibility tree ID of the result element; 0 842 // result_acc_obj_id is the accessibility tree ID of the result element; 0
829 // indicates no result. 843 // indicates no result.
830 IPC_MESSAGE_ROUTED3(ExtensionHostMsg_AutomationQuerySelector_Result, 844 IPC_MESSAGE_ROUTED3(ExtensionHostMsg_AutomationQuerySelector_Result,
831 int /* request_id */, 845 int /* request_id */,
832 ExtensionHostMsg_AutomationQuerySelector_Error /* error */, 846 ExtensionHostMsg_AutomationQuerySelector_Error /* error */,
833 int /* result_acc_obj_id */) 847 int /* result_acc_obj_id */)
848
849 // Messages related to Extension Service Worker.
850 #undef IPC_MESSAGE_START
851 #define IPC_MESSAGE_START ExtensionWorkerMsgStart
852 // A service worker thread sends this message when an extension service worker
853 // starts an API request. The browser will always respond with a
854 // ExtensionMsg_ResponseWorker.
855 IPC_MESSAGE_CONTROL1(ExtensionHostMsg_RequestWorker,
856 ExtensionHostMsg_Request_Params)
857
858 // The browser sends this message in response to all service worker extension
859 // api calls. The response data (if any) is one of the base::Value subclasses,
860 // wrapped as the first element in a ListValue.
861 IPC_MESSAGE_CONTROL5(ExtensionMsg_ResponseWorker,
862 int /* thread_id */,
863 int /* request_id */,
864 bool /* success */,
865 base::ListValue /* response wrapper (see comment above) */,
866 std::string /* error */)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698