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

Unified 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: sync @tott Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/browser/extension_web_contents_observer.cc ('k') | extensions/common/extensions_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/extension_messages.h
diff --git a/extensions/common/extension_messages.h b/extensions/common/extension_messages.h
index bd48626c3e630750bfbfbfd7e36ae4a7d565e330..fe06a71ccdf0527a1893f05b8a2c1751300e592f 100644
--- a/extensions/common/extension_messages.h
+++ b/extensions/common/extension_messages.h
@@ -106,6 +106,14 @@ IPC_STRUCT_BEGIN(ExtensionHostMsg_Request_Params)
// True if request is executed in response to an explicit user gesture.
IPC_STRUCT_MEMBER(bool, user_gesture)
+
+ // If this API call is for a service worker, then this is the worker thread
+ // id. Otherwise, this is -1.
+ IPC_STRUCT_MEMBER(int, worker_thread_id)
+
+ // If this API call is for a service worker, then this is the embedded
+ // worker id. Otherwise, this is -1.
+ IPC_STRUCT_MEMBER(int, embedded_worker_id)
IPC_STRUCT_END()
// Allows an extension to execute code in a tab.
@@ -838,3 +846,22 @@ IPC_MESSAGE_ROUTED3(ExtensionHostMsg_AutomationQuerySelector_Result,
int /* request_id */,
ExtensionHostMsg_AutomationQuerySelector_Error /* error */,
int /* result_acc_obj_id */)
+
+// Messages related to Extension Service Worker.
+#undef IPC_MESSAGE_START
+#define IPC_MESSAGE_START ExtensionWorkerMsgStart
+// A service worker thread sends this message when an extension service worker
+// starts an API request. The browser will always respond with a
+// ExtensionMsg_ResponseWorker.
+IPC_MESSAGE_CONTROL1(ExtensionHostMsg_RequestWorker,
+ ExtensionHostMsg_Request_Params)
+
+// The browser sends this message in response to all service worker extension
+// api calls. The response data (if any) is one of the base::Value subclasses,
+// wrapped as the first element in a ListValue.
+IPC_MESSAGE_CONTROL5(ExtensionMsg_ResponseWorker,
+ int /* thread_id */,
+ int /* request_id */,
+ bool /* success */,
+ base::ListValue /* response wrapper (see comment above) */,
+ std::string /* error */)
« no previous file with comments | « extensions/browser/extension_web_contents_observer.cc ('k') | extensions/common/extensions_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698