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

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: 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 side-by-side diff with in-line comments
Download patch
Index: extensions/common/extension_messages.h
diff --git a/extensions/common/extension_messages.h b/extensions/common/extension_messages.h
index 904c2f98b42ee2e154b2971bd3c5e0ebeeb8f0cf..e588bb4397e1217a98c5a51f24199ee436cdaadd 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.
@@ -571,6 +579,12 @@ IPC_MESSAGE_ROUTED2(ExtensionMsg_DispatchOnDisconnect,
IPC_MESSAGE_CONTROL1(ExtensionMsg_SetChannel,
int /* channel */)
+// Informs the renderer whether extension APIs should be enabled in extension
+// service worker contexts.
+IPC_MESSAGE_CONTROL1(
+ ExtensionMsg_SetExtensionAPIEnabledInExtensionServiceWorkers,
+ 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.
+
// Notify the renderer that its window has closed.
IPC_MESSAGE_ROUTED0(ExtensionMsg_AppWindowClosed)
@@ -831,3 +845,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 */)

Powered by Google App Engine
This is Rietveld 408576698