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

Side by Side Diff: content/common/service_worker/service_worker_messages.h

Issue 246023007: Chromium-side plumbing for ServiceWorker -> Document postMessage (2/3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: message port threading fix Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "base/strings/string16.h" 7 #include "base/strings/string16.h"
8 #include "content/common/service_worker/service_worker_status_code.h" 8 #include "content/common/service_worker/service_worker_status_code.h"
9 #include "content/common/service_worker/service_worker_types.h" 9 #include "content/common/service_worker/service_worker_types.h"
10 #include "ipc/ipc_message_macros.h" 10 #include "ipc/ipc_message_macros.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 GURL /* scope */, 60 GURL /* scope */,
61 GURL /* script_url */) 61 GURL /* script_url */)
62 62
63 IPC_MESSAGE_CONTROL4(ServiceWorkerHostMsg_UnregisterServiceWorker, 63 IPC_MESSAGE_CONTROL4(ServiceWorkerHostMsg_UnregisterServiceWorker,
64 int /* thread_id */, 64 int /* thread_id */,
65 int /* request_id */, 65 int /* request_id */,
66 int /* provider_id */, 66 int /* provider_id */,
67 GURL /* scope (url pattern) */) 67 GURL /* scope (url pattern) */)
68 68
69 // Sends a 'message' event to a service worker (renderer->browser). 69 // Sends a 'message' event to a service worker (renderer->browser).
70 IPC_MESSAGE_CONTROL3(ServiceWorkerHostMsg_PostMessage, 70 IPC_MESSAGE_CONTROL3(ServiceWorkerHostMsg_PostMessageToWorker,
71 int64 /* version_id */, 71 int /* handle_id */,
72 base::string16 /* message */, 72 base::string16 /* message */,
73 std::vector<int> /* sent_message_port_ids */) 73 std::vector<int> /* sent_message_port_ids */)
74 74
75 // Informs the browser of a new ServiceWorkerProvider in the child process, 75 // Informs the browser of a new ServiceWorkerProvider in the child process,
76 // |provider_id| is unique within its child process. 76 // |provider_id| is unique within its child process.
77 IPC_MESSAGE_CONTROL1(ServiceWorkerHostMsg_ProviderCreated, 77 IPC_MESSAGE_CONTROL1(ServiceWorkerHostMsg_ProviderCreated,
78 int /* provider_id */) 78 int /* provider_id */)
79 79
80 // Informs the browser of a ServiceWorkerProvider being destroyed. 80 // Informs the browser of a ServiceWorkerProvider being destroyed.
81 IPC_MESSAGE_CONTROL1(ServiceWorkerHostMsg_ProviderDestroyed, 81 IPC_MESSAGE_CONTROL1(ServiceWorkerHostMsg_ProviderDestroyed,
(...skipping 27 matching lines...) Expand all
109 content::ServiceWorkerFetchEventResult, 109 content::ServiceWorkerFetchEventResult,
110 content::ServiceWorkerResponse) 110 content::ServiceWorkerResponse)
111 IPC_MESSAGE_ROUTED1(ServiceWorkerHostMsg_SyncEventFinished, 111 IPC_MESSAGE_ROUTED1(ServiceWorkerHostMsg_SyncEventFinished,
112 int /* request_id */) 112 int /* request_id */)
113 113
114 // Asks the browser to retrieve documents controlled by the sender 114 // Asks the browser to retrieve documents controlled by the sender
115 // ServiceWorker. 115 // ServiceWorker.
116 IPC_MESSAGE_ROUTED1(ServiceWorkerHostMsg_GetClientDocuments, 116 IPC_MESSAGE_ROUTED1(ServiceWorkerHostMsg_GetClientDocuments,
117 int /* request_id */) 117 int /* request_id */)
118 118
119 // Sends a 'message' event to a client document (renderer->browser).
120 IPC_MESSAGE_ROUTED3(ServiceWorkerHostMsg_PostMessageToDocument,
121 int /* client_id */,
122 base::string16 /* message */,
123 std::vector<int> /* sent_message_port_ids */)
124
119 //--------------------------------------------------------------------------- 125 //---------------------------------------------------------------------------
120 // Messages sent from the browser to the child process. 126 // Messages sent from the browser to the child process.
121 // 127 //
122 // NOTE: All ServiceWorkerMsg messages not sent via EmbeddedWorker must have 128 // NOTE: All ServiceWorkerMsg messages not sent via EmbeddedWorker must have
123 // a thread_id as their first field so that ServiceWorkerMessageFilter can 129 // a thread_id as their first field so that ServiceWorkerMessageFilter can
124 // extract it and dispatch the message to the correct ServiceWorkerDispatcher 130 // extract it and dispatch the message to the correct ServiceWorkerDispatcher
125 // on the correct thread. 131 // on the correct thread.
126 132
127 // Response to ServiceWorkerMsg_RegisterServiceWorker. 133 // Response to ServiceWorkerMsg_RegisterServiceWorker.
128 IPC_MESSAGE_CONTROL3(ServiceWorkerMsg_ServiceWorkerRegistered, 134 IPC_MESSAGE_CONTROL3(ServiceWorkerMsg_ServiceWorkerRegistered,
(...skipping 20 matching lines...) Expand all
149 int /* handle_id */, 155 int /* handle_id */,
150 blink::WebServiceWorkerState) 156 blink::WebServiceWorkerState)
151 157
152 // Tells the child process to set the current ServiceWorker for the given 158 // Tells the child process to set the current ServiceWorker for the given
153 // provider. 159 // provider.
154 IPC_MESSAGE_CONTROL3(ServiceWorkerMsg_SetCurrentServiceWorker, 160 IPC_MESSAGE_CONTROL3(ServiceWorkerMsg_SetCurrentServiceWorker,
155 int /* thread_id */, 161 int /* thread_id */,
156 int /* provider_id */, 162 int /* provider_id */,
157 content::ServiceWorkerObjectInfo) 163 content::ServiceWorkerObjectInfo)
158 164
165 // Sends a 'message' event to a client document (browser->renderer).
166 IPC_MESSAGE_CONTROL5(ServiceWorkerMsg_MessageToDocument,
167 int /* thread_id */,
168 int /* provider_id */,
169 base::string16 /* message */,
170 std::vector<int> /* sent_message_port_ids */,
171 std::vector<int> /* new_routing_ids */)
172
159 // Sent via EmbeddedWorker to dispatch events. 173 // Sent via EmbeddedWorker to dispatch events.
160 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_InstallEvent, 174 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_InstallEvent,
161 int /* request_id */, 175 int /* request_id */,
162 int /* active_version_id */) 176 int /* active_version_id */)
163 IPC_MESSAGE_CONTROL1(ServiceWorkerMsg_ActivateEvent, 177 IPC_MESSAGE_CONTROL1(ServiceWorkerMsg_ActivateEvent,
164 int /* request_id */) 178 int /* request_id */)
165 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_FetchEvent, 179 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_FetchEvent,
166 int /* request_id */, 180 int /* request_id */,
167 content::ServiceWorkerFetchRequest) 181 content::ServiceWorkerFetchRequest)
168 IPC_MESSAGE_CONTROL1(ServiceWorkerMsg_SyncEvent, 182 IPC_MESSAGE_CONTROL1(ServiceWorkerMsg_SyncEvent,
169 int /* request_id */) 183 int /* request_id */)
170 IPC_MESSAGE_CONTROL3(ServiceWorkerMsg_Message, 184 IPC_MESSAGE_CONTROL3(ServiceWorkerMsg_MessageToWorker,
171 base::string16 /* message */, 185 base::string16 /* message */,
172 std::vector<int> /* sent_message_port_ids */, 186 std::vector<int> /* sent_message_port_ids */,
173 std::vector<int> /* new_routing_ids */) 187 std::vector<int> /* new_routing_ids */)
174 188
175 // Sent via EmbeddedWorker as a response of GetClientDocuments. 189 // Sent via EmbeddedWorker as a response of GetClientDocuments.
176 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_DidGetClientDocuments, 190 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_DidGetClientDocuments,
177 int /* request_id */, 191 int /* request_id */,
178 std::vector<int> /* client_ids */) 192 std::vector<int> /* client_ids */)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698