Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / content / common / service_worker / embedded_worker_messages.h
index 5367e68..b31e63b 100644 (file)
 
 #define IPC_MESSAGE_START EmbeddedWorkerMsgStart
 
+// Parameters structure for EmbeddedWorkerMsg_StartWorker.
+IPC_STRUCT_BEGIN(EmbeddedWorkerMsg_StartWorker_Params)
+  IPC_STRUCT_MEMBER(int, embedded_worker_id)
+  IPC_STRUCT_MEMBER(int64, service_worker_version_id)
+  IPC_STRUCT_MEMBER(GURL, scope)
+  IPC_STRUCT_MEMBER(GURL, script_url)
+  IPC_STRUCT_MEMBER(int, worker_devtools_agent_route_id)
+IPC_STRUCT_END()
+
+// Parameters structure for EmbeddedWorkerHostMsg_ReportConsoleMessage.
+// The data members directly correspond to parameters of
+// WorkerMessagingProxy::reportConsoleMessage()
+IPC_STRUCT_BEGIN(EmbeddedWorkerHostMsg_ReportConsoleMessage_Params)
+  IPC_STRUCT_MEMBER(int, source_identifier)
+  IPC_STRUCT_MEMBER(int, message_level)
+  IPC_STRUCT_MEMBER(base::string16, message)
+  IPC_STRUCT_MEMBER(int, line_number)
+  IPC_STRUCT_MEMBER(GURL, source_url)
+IPC_STRUCT_END()
+
 // Browser -> Renderer message to create a new embedded worker context.
-IPC_MESSAGE_CONTROL3(EmbeddedWorkerMsg_StartWorker,
-                     int /* embedded_worker_id */,
-                     int64 /* service_worker_version_id */,
-                     GURL /* script_url */)
+IPC_MESSAGE_CONTROL1(EmbeddedWorkerMsg_StartWorker,
+                     EmbeddedWorkerMsg_StartWorker_Params /* params */)
 
 // Browser -> Renderer message to stop (terminate) the embedded worker.
 IPC_MESSAGE_CONTROL1(EmbeddedWorkerMsg_StopWorker,
                      int /* embedded_worker_id */)
 
+// Renderer -> Browser message to indicate that the worker has loadedd the
+// script.
+IPC_MESSAGE_CONTROL1(EmbeddedWorkerHostMsg_WorkerScriptLoaded,
+                     int /* embedded_worker_id */)
+
+// Renderer -> Browser message to indicate that the worker has failed to load
+// the script.
+IPC_MESSAGE_CONTROL1(EmbeddedWorkerHostMsg_WorkerScriptLoadFailed,
+                     int /* embedded_worker_id */)
+
 // Renderer -> Browser message to indicate that the worker is started.
 IPC_MESSAGE_CONTROL2(EmbeddedWorkerHostMsg_WorkerStarted,
                      int /* thread_id */,
@@ -35,12 +63,19 @@ IPC_MESSAGE_CONTROL2(EmbeddedWorkerHostMsg_WorkerStarted,
 IPC_MESSAGE_CONTROL1(EmbeddedWorkerHostMsg_WorkerStopped,
                      int /* embedded_worker_id */)
 
-// Renderer ->Browser message to send message.
-// |request_id| might be used for bi-directional messaging.
-IPC_MESSAGE_CONTROL3(EmbeddedWorkerHostMsg_SendMessageToBrowser,
+// Renderer -> Browser message to report an exception.
+IPC_MESSAGE_CONTROL5(EmbeddedWorkerHostMsg_ReportException,
                      int /* embedded_worker_id */,
-                     int /* request_id */,
-                     IPC::Message /* message */)
+                     base::string16 /* error_message */,
+                     int /* line_number */,
+                     int /* column_number */,
+                     GURL /* source_url */)
+
+// Renderer -> Browser message to report console message.
+IPC_MESSAGE_CONTROL2(
+    EmbeddedWorkerHostMsg_ReportConsoleMessage,
+    int /* embedded_worker_id */,
+    EmbeddedWorkerHostMsg_ReportConsoleMessage_Params /* params */)
 
 // ---------------------------------------------------------------------------
 // For EmbeddedWorkerContext related messages, which are directly sent from
@@ -51,9 +86,7 @@ IPC_MESSAGE_CONTROL3(EmbeddedWorkerHostMsg_SendMessageToBrowser,
 #define IPC_MESSAGE_START EmbeddedWorkerContextMsgStart
 
 // Browser -> Renderer message to send message.
-// |request_id| might be used for bi-directional messaging.
-IPC_MESSAGE_CONTROL4(EmbeddedWorkerContextMsg_SendMessageToWorker,
+IPC_MESSAGE_CONTROL3(EmbeddedWorkerContextMsg_MessageToWorker,
                      int /* thread_id */,
                      int /* embedded_worker_id */,
-                     int /* request_id */,
                      IPC::Message /* message */)