Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / content / common / service_worker / embedded_worker_messages.h
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
3 // found in the LICENSE file.
4
5 // Message definition file, included multiple times, hence no include guard.
6
7 #include <string>
8
9 #include "ipc/ipc_message.h"
10 #include "ipc/ipc_message_macros.h"
11 #include "ipc/ipc_param_traits.h"
12 #include "url/gurl.h"
13
14 #undef IPC_MESSAGE_EXPORT
15 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT
16
17 #define IPC_MESSAGE_START EmbeddedWorkerMsgStart
18
19 // Browser -> Renderer message to create a new embedded worker context.
20 IPC_MESSAGE_CONTROL3(EmbeddedWorkerMsg_StartWorker,
21                      int /* embedded_worker_id */,
22                      int64 /* service_worker_version_id */,
23                      GURL /* script_url */)
24
25 // Browser -> Renderer message to stop (terminate) the embedded worker.
26 IPC_MESSAGE_CONTROL1(EmbeddedWorkerMsg_StopWorker,
27                      int /* embedded_worker_id */)
28
29 // Renderer -> Browser message to indicate that the worker is started.
30 IPC_MESSAGE_CONTROL2(EmbeddedWorkerHostMsg_WorkerStarted,
31                      int /* thread_id */,
32                      int /* embedded_worker_id */)
33
34 // Renderer -> Browser message to indicate that the worker is stopped.
35 IPC_MESSAGE_CONTROL1(EmbeddedWorkerHostMsg_WorkerStopped,
36                      int /* embedded_worker_id */)
37
38 // Renderer ->Browser message to send message.
39 // |request_id| might be used for bi-directional messaging.
40 IPC_MESSAGE_CONTROL3(EmbeddedWorkerHostMsg_SendMessageToBrowser,
41                      int /* embedded_worker_id */,
42                      int /* request_id */,
43                      IPC::Message /* message */)
44
45 // ---------------------------------------------------------------------------
46 // For EmbeddedWorkerContext related messages, which are directly sent from
47 // browser to the worker thread in the child process. We use a new message class
48 // for this for easier cross-thread message dispatching.
49
50 #undef IPC_MESSAGE_START
51 #define IPC_MESSAGE_START EmbeddedWorkerContextMsgStart
52
53 // Browser -> Renderer message to send message.
54 // |request_id| might be used for bi-directional messaging.
55 IPC_MESSAGE_CONTROL4(EmbeddedWorkerContextMsg_SendMessageToWorker,
56                      int /* thread_id */,
57                      int /* embedded_worker_id */,
58                      int /* request_id */,
59                      IPC::Message /* message */)