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

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

Powered by Google App Engine
This is Rietveld 408576698