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