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

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

Issue 1632113004: ServiceWorker: Add initial implementation of ExtendableMessageEvent behind a flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 10 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
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 <stdint.h> 7 #include <stdint.h>
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 IPC_MESSAGE_CONTROL3(ServiceWorkerHostMsg_GetRegistrations, 170 IPC_MESSAGE_CONTROL3(ServiceWorkerHostMsg_GetRegistrations,
171 int /* thread_id */, 171 int /* thread_id */,
172 int /* request_id */, 172 int /* request_id */,
173 int /* provider_id */) 173 int /* provider_id */)
174 174
175 IPC_MESSAGE_CONTROL3(ServiceWorkerHostMsg_GetRegistrationForReady, 175 IPC_MESSAGE_CONTROL3(ServiceWorkerHostMsg_GetRegistrationForReady,
176 int /* thread_id */, 176 int /* thread_id */,
177 int /* request_id */, 177 int /* request_id */,
178 int /* provider_id */) 178 int /* provider_id */)
179 179
180 // Sends a 'message' event to a service worker (renderer->browser). 180 // Sends ExtendableMessageEvent to a service worker (renderer->browser).
181 IPC_MESSAGE_CONTROL3( 181 IPC_MESSAGE_CONTROL3(
182 ServiceWorkerHostMsg_PostMessageToWorker, 182 ServiceWorkerHostMsg_PostMessageToWorker,
183 int /* handle_id */, 183 int /* handle_id */,
184 base::string16 /* message */, 184 base::string16 /* message */,
185 std::vector<content::TransferredMessagePort> /* sent_message_ports */) 185 std::vector<content::TransferredMessagePort> /* sent_message_ports */)
186 186
187 // Sends MessageEvent to a service worker (renderer->browser).
188 // TODO(nhiroki): Remove this after ExtendableMessageEvent is enabled by
189 // default (crbug.com/543198).
190 IPC_MESSAGE_CONTROL3(
191 ServiceWorkerHostMsg_DeprecatedPostMessageToWorker,
192 int /* handle_id */,
193 base::string16 /* message */,
194 std::vector<content::TransferredMessagePort> /* sent_message_ports */)
195
187 // Informs the browser of a new ServiceWorkerProvider in the child process, 196 // Informs the browser of a new ServiceWorkerProvider in the child process,
188 // |provider_id| is unique within its child process. When this provider is 197 // |provider_id| is unique within its child process. When this provider is
189 // created for a document, |route_id| is the frame ID of it. When this provider 198 // created for a document, |route_id| is the frame ID of it. When this provider
190 // is created for a Shared Worker, |route_id| is the Shared Worker route ID. 199 // is created for a Shared Worker, |route_id| is the Shared Worker route ID.
191 // When this provider is created for a Service Worker, |route_id| is 200 // When this provider is created for a Service Worker, |route_id| is
192 // MSG_ROUTING_NONE. |provider_type| identifies whether this provider is for 201 // MSG_ROUTING_NONE. |provider_type| identifies whether this provider is for
193 // Service Worker controllees (documents and Shared Workers) or for controllers 202 // Service Worker controllees (documents and Shared Workers) or for controllers
194 // (Service Workers). 203 // (Service Workers).
195 IPC_MESSAGE_CONTROL3(ServiceWorkerHostMsg_ProviderCreated, 204 IPC_MESSAGE_CONTROL3(ServiceWorkerHostMsg_ProviderCreated,
196 int /* provider_id */, 205 int /* provider_id */,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 int64_t /* version_id */) 239 int64_t /* version_id */)
231 240
232 // Informs the browser that event handling has finished. 241 // Informs the browser that event handling has finished.
233 // Routed to the target ServiceWorkerVersion. 242 // Routed to the target ServiceWorkerVersion.
234 IPC_MESSAGE_ROUTED2(ServiceWorkerHostMsg_InstallEventFinished, 243 IPC_MESSAGE_ROUTED2(ServiceWorkerHostMsg_InstallEventFinished,
235 int /* request_id */, 244 int /* request_id */,
236 blink::WebServiceWorkerEventResult) 245 blink::WebServiceWorkerEventResult)
237 IPC_MESSAGE_ROUTED2(ServiceWorkerHostMsg_ActivateEventFinished, 246 IPC_MESSAGE_ROUTED2(ServiceWorkerHostMsg_ActivateEventFinished,
238 int /* request_id */, 247 int /* request_id */,
239 blink::WebServiceWorkerEventResult) 248 blink::WebServiceWorkerEventResult)
249 IPC_MESSAGE_ROUTED2(ServiceWorkerHostMsg_ExtendableMessageEventFinished,
250 int /* request_id */,
251 blink::WebServiceWorkerEventResult)
240 IPC_MESSAGE_ROUTED3(ServiceWorkerHostMsg_FetchEventFinished, 252 IPC_MESSAGE_ROUTED3(ServiceWorkerHostMsg_FetchEventFinished,
241 int /* request_id */, 253 int /* request_id */,
242 content::ServiceWorkerFetchEventResult, 254 content::ServiceWorkerFetchEventResult,
243 content::ServiceWorkerResponse) 255 content::ServiceWorkerResponse)
244 IPC_MESSAGE_ROUTED2(ServiceWorkerHostMsg_NotificationClickEventFinished, 256 IPC_MESSAGE_ROUTED2(ServiceWorkerHostMsg_NotificationClickEventFinished,
245 int /* request_id */, 257 int /* request_id */,
246 blink::WebServiceWorkerEventResult) 258 blink::WebServiceWorkerEventResult)
247 IPC_MESSAGE_ROUTED2(ServiceWorkerHostMsg_PushEventFinished, 259 IPC_MESSAGE_ROUTED2(ServiceWorkerHostMsg_PushEventFinished,
248 int /* request_id */, 260 int /* request_id */,
249 blink::WebServiceWorkerEventResult) 261 blink::WebServiceWorkerEventResult)
250 IPC_MESSAGE_ROUTED2(ServiceWorkerHostMsg_GeofencingEventFinished, 262 IPC_MESSAGE_ROUTED2(ServiceWorkerHostMsg_GeofencingEventFinished,
251 int /* request_id */, 263 int /* request_id */,
252 blink::WebServiceWorkerEventResult) 264 blink::WebServiceWorkerEventResult)
253 265
254 // Responds to a Ping from the browser. 266 // Responds to a Ping from the browser.
255 // Routed to the target ServiceWorkerVersion. 267 // Routed to the target ServiceWorkerVersion.
256 IPC_MESSAGE_ROUTED0(ServiceWorkerHostMsg_Pong) 268 IPC_MESSAGE_ROUTED0(ServiceWorkerHostMsg_Pong)
257 269
258 // Asks the browser to retrieve clients of the sender ServiceWorker. 270 // Asks the browser to retrieve clients of the sender ServiceWorker.
259 IPC_MESSAGE_ROUTED2(ServiceWorkerHostMsg_GetClients, 271 IPC_MESSAGE_ROUTED2(ServiceWorkerHostMsg_GetClients,
260 int /* request_id */, 272 int /* request_id */,
261 content::ServiceWorkerClientQueryOptions) 273 content::ServiceWorkerClientQueryOptions)
262 274
263 // Sends a 'message' event to a client (renderer->browser). 275 // Sends MessageEvent to a client (renderer->browser).
264 IPC_MESSAGE_ROUTED3( 276 IPC_MESSAGE_ROUTED3(
265 ServiceWorkerHostMsg_PostMessageToClient, 277 ServiceWorkerHostMsg_PostMessageToClient,
266 std::string /* uuid */, 278 std::string /* uuid */,
267 base::string16 /* message */, 279 base::string16 /* message */,
268 std::vector<content::TransferredMessagePort> /* sent_message_ports */) 280 std::vector<content::TransferredMessagePort> /* sent_message_ports */)
269 281
270 // ServiceWorker -> Browser message to request that the ServiceWorkerStorage 282 // ServiceWorker -> Browser message to request that the ServiceWorkerStorage
271 // cache |data| associated with |url|. 283 // cache |data| associated with |url|.
272 IPC_MESSAGE_ROUTED2(ServiceWorkerHostMsg_SetCachedMetadata, 284 IPC_MESSAGE_ROUTED2(ServiceWorkerHostMsg_SetCachedMetadata,
273 GURL /* url */, 285 GURL /* url */,
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 int /* registration_handle_id */) 437 int /* registration_handle_id */)
426 438
427 // Tells the child process to set the controller ServiceWorker for the given 439 // Tells the child process to set the controller ServiceWorker for the given
428 // provider. 440 // provider.
429 IPC_MESSAGE_CONTROL4(ServiceWorkerMsg_SetControllerServiceWorker, 441 IPC_MESSAGE_CONTROL4(ServiceWorkerMsg_SetControllerServiceWorker,
430 int /* thread_id */, 442 int /* thread_id */,
431 int /* provider_id */, 443 int /* provider_id */,
432 content::ServiceWorkerObjectInfo, 444 content::ServiceWorkerObjectInfo,
433 bool /* should_notify_controllerchange */) 445 bool /* should_notify_controllerchange */)
434 446
435 // Sends a 'message' event to a client document (browser->renderer). 447 // Sends MessageEvent to a client document (browser->renderer).
436 IPC_MESSAGE_CONTROL1(ServiceWorkerMsg_MessageToDocument, 448 IPC_MESSAGE_CONTROL1(ServiceWorkerMsg_MessageToDocument,
437 ServiceWorkerMsg_MessageToDocument_Params) 449 ServiceWorkerMsg_MessageToDocument_Params)
438 450
439 // Sent via EmbeddedWorker to dispatch events. 451 // Sent via EmbeddedWorker to dispatch events.
440 IPC_MESSAGE_CONTROL1(ServiceWorkerMsg_InstallEvent, 452 IPC_MESSAGE_CONTROL1(ServiceWorkerMsg_InstallEvent,
441 int /* request_id */) 453 int /* request_id */)
442 IPC_MESSAGE_CONTROL1(ServiceWorkerMsg_ActivateEvent, 454 IPC_MESSAGE_CONTROL1(ServiceWorkerMsg_ActivateEvent,
443 int /* request_id */) 455 int /* request_id */)
456 IPC_MESSAGE_CONTROL4(
457 ServiceWorkerMsg_ExtendableMessageEvent,
458 int /* request_id */,
459 base::string16 /* message */,
460 std::vector<content::TransferredMessagePort> /* sent_message_ports */,
461 std::vector<int> /* new_routing_ids */)
444 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_FetchEvent, 462 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_FetchEvent,
445 int /* request_id */, 463 int /* request_id */,
446 content::ServiceWorkerFetchRequest) 464 content::ServiceWorkerFetchRequest)
447 IPC_MESSAGE_CONTROL4(ServiceWorkerMsg_NotificationClickEvent, 465 IPC_MESSAGE_CONTROL4(ServiceWorkerMsg_NotificationClickEvent,
448 int /* request_id */, 466 int /* request_id */,
449 int64_t /* persistent_notification_id */, 467 int64_t /* persistent_notification_id */,
450 content::PlatformNotificationData /* notification_data */, 468 content::PlatformNotificationData /* notification_data */,
451 int /* action_index */) 469 int /* action_index */)
452 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_PushEvent, 470 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_PushEvent,
453 int /* request_id */, 471 int /* request_id */,
454 content::PushEventPayload /* data */) 472 content::PushEventPayload /* data */)
455 IPC_MESSAGE_CONTROL4(ServiceWorkerMsg_GeofencingEvent, 473 IPC_MESSAGE_CONTROL4(ServiceWorkerMsg_GeofencingEvent,
456 int /* request_id */, 474 int /* request_id */,
457 blink::WebGeofencingEventType /* event_type */, 475 blink::WebGeofencingEventType /* event_type */,
458 std::string /* region_id */, 476 std::string /* region_id */,
459 blink::WebCircularGeofencingRegion /* region */) 477 blink::WebCircularGeofencingRegion /* region */)
478
479 // TODO(nhiroki): Remove this after ExtendableMessageEvent is enabled by
480 // default (crbug.com/543198).
460 IPC_MESSAGE_CONTROL3( 481 IPC_MESSAGE_CONTROL3(
461 ServiceWorkerMsg_MessageToWorker, 482 ServiceWorkerMsg_MessageToWorker,
462 base::string16 /* message */, 483 base::string16 /* message */,
463 std::vector<content::TransferredMessagePort> /* sent_message_ports */, 484 std::vector<content::TransferredMessagePort> /* sent_message_ports */,
464 std::vector<int> /* new_routing_ids */) 485 std::vector<int> /* new_routing_ids */)
486
465 IPC_MESSAGE_CONTROL4( 487 IPC_MESSAGE_CONTROL4(
466 ServiceWorkerMsg_CrossOriginMessageToWorker, 488 ServiceWorkerMsg_CrossOriginMessageToWorker,
467 content::NavigatorConnectClient /* client */, 489 content::NavigatorConnectClient /* client */,
468 base::string16 /* message */, 490 base::string16 /* message */,
469 std::vector<content::TransferredMessagePort> /* sent_message_ports */, 491 std::vector<content::TransferredMessagePort> /* sent_message_ports */,
470 std::vector<int> /* new_routing_ids */) 492 std::vector<int> /* new_routing_ids */)
471 IPC_MESSAGE_CONTROL1(ServiceWorkerMsg_DidSkipWaiting, 493 IPC_MESSAGE_CONTROL1(ServiceWorkerMsg_DidSkipWaiting,
472 int /* request_id */) 494 int /* request_id */)
473 IPC_MESSAGE_CONTROL1(ServiceWorkerMsg_DidClaimClients, 495 IPC_MESSAGE_CONTROL1(ServiceWorkerMsg_DidClaimClients,
474 int /* request_id */) 496 int /* request_id */)
(...skipping 27 matching lines...) Expand all
502 524
503 // Sent via EmbeddedWorker as a response of NavigateClient. 525 // Sent via EmbeddedWorker as a response of NavigateClient.
504 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_NavigateClientResponse, 526 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_NavigateClientResponse,
505 int /* request_id */, 527 int /* request_id */,
506 content::ServiceWorkerClientInfo /* client */) 528 content::ServiceWorkerClientInfo /* client */)
507 529
508 // Sent via EmbeddedWorker as an error response of NavigateClient. 530 // Sent via EmbeddedWorker as an error response of NavigateClient.
509 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_NavigateClientError, 531 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_NavigateClientError,
510 int /* request_id */, 532 int /* request_id */,
511 GURL /* url */) 533 GURL /* url */)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698