Use UUID for ServiceWorker Client identifier (2/3, chromium)
[chromium-blink-merge.git] / content / common / service_worker / service_worker_messages.h
blob77b6bf950f4f4d36c099f28213f921fb3df121ec
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.
5 // Message definition file, included multiple times, hence no include guard.
7 #include <string>
8 #include <vector>
10 #include "base/strings/string16.h"
11 #include "content/common/service_worker/service_worker_client_info.h"
12 #include "content/common/service_worker/service_worker_status_code.h"
13 #include "content/common/service_worker/service_worker_types.h"
14 #include "content/public/common/message_port_types.h"
15 #include "content/public/common/navigator_connect_client.h"
16 #include "content/public/common/platform_notification_data.h"
17 #include "ipc/ipc_message_macros.h"
18 #include "ipc/ipc_param_traits.h"
19 #include "third_party/WebKit/public/platform/WebCircularGeofencingRegion.h"
20 #include "third_party/WebKit/public/platform/WebGeofencingEventType.h"
21 #include "third_party/WebKit/public/platform/WebServiceWorkerCacheError.h"
22 #include "third_party/WebKit/public/platform/WebServiceWorkerError.h"
23 #include "third_party/WebKit/public/platform/WebServiceWorkerEventResult.h"
24 #include "url/gurl.h"
26 #undef IPC_MESSAGE_EXPORT
27 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT
29 #define IPC_MESSAGE_START ServiceWorkerMsgStart
31 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebServiceWorkerError::ErrorType,
32 blink::WebServiceWorkerError::ErrorTypeLast)
34 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebServiceWorkerEventResult,
35 blink::WebServiceWorkerEventResultLast)
37 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebServiceWorkerState,
38 blink::WebServiceWorkerStateLast)
40 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebServiceWorkerResponseType,
41 blink::WebServiceWorkerResponseTypeLast)
43 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebServiceWorkerClientType,
44 blink::WebServiceWorkerClientTypeLast)
46 IPC_ENUM_TRAITS_MAX_VALUE(content::ServiceWorkerProviderType,
47 content::SERVICE_WORKER_PROVIDER_TYPE_LAST)
49 IPC_STRUCT_TRAITS_BEGIN(content::ServiceWorkerFetchRequest)
50 IPC_STRUCT_TRAITS_MEMBER(mode)
51 IPC_STRUCT_TRAITS_MEMBER(request_context_type)
52 IPC_STRUCT_TRAITS_MEMBER(frame_type)
53 IPC_STRUCT_TRAITS_MEMBER(url)
54 IPC_STRUCT_TRAITS_MEMBER(method)
55 IPC_STRUCT_TRAITS_MEMBER(headers)
56 IPC_STRUCT_TRAITS_MEMBER(blob_uuid)
57 IPC_STRUCT_TRAITS_MEMBER(blob_size)
58 IPC_STRUCT_TRAITS_MEMBER(referrer)
59 IPC_STRUCT_TRAITS_MEMBER(credentials_mode)
60 IPC_STRUCT_TRAITS_MEMBER(is_reload)
61 IPC_STRUCT_TRAITS_END()
63 IPC_ENUM_TRAITS_MAX_VALUE(content::ServiceWorkerFetchEventResult,
64 content::SERVICE_WORKER_FETCH_EVENT_LAST)
66 IPC_STRUCT_TRAITS_BEGIN(content::ServiceWorkerResponse)
67 IPC_STRUCT_TRAITS_MEMBER(url)
68 IPC_STRUCT_TRAITS_MEMBER(status_code)
69 IPC_STRUCT_TRAITS_MEMBER(status_text)
70 IPC_STRUCT_TRAITS_MEMBER(response_type)
71 IPC_STRUCT_TRAITS_MEMBER(headers)
72 IPC_STRUCT_TRAITS_MEMBER(blob_uuid)
73 IPC_STRUCT_TRAITS_MEMBER(blob_size)
74 IPC_STRUCT_TRAITS_MEMBER(stream_url)
75 IPC_STRUCT_TRAITS_END()
77 IPC_STRUCT_TRAITS_BEGIN(content::ServiceWorkerCacheQueryParams)
78 IPC_STRUCT_TRAITS_MEMBER(ignore_search)
79 IPC_STRUCT_TRAITS_MEMBER(ignore_method)
80 IPC_STRUCT_TRAITS_MEMBER(ignore_vary)
81 IPC_STRUCT_TRAITS_MEMBER(cache_name)
82 IPC_STRUCT_TRAITS_END()
84 IPC_ENUM_TRAITS_MAX_VALUE(content::ServiceWorkerCacheOperationType,
85 content::SERVICE_WORKER_CACHE_OPERATION_TYPE_LAST)
87 IPC_STRUCT_TRAITS_BEGIN(content::ServiceWorkerBatchOperation)
88 IPC_STRUCT_TRAITS_MEMBER(operation_type)
89 IPC_STRUCT_TRAITS_MEMBER(request)
90 IPC_STRUCT_TRAITS_MEMBER(response)
91 IPC_STRUCT_TRAITS_MEMBER(match_params)
92 IPC_STRUCT_TRAITS_END()
94 IPC_STRUCT_TRAITS_BEGIN(content::ServiceWorkerObjectInfo)
95 IPC_STRUCT_TRAITS_MEMBER(handle_id)
96 IPC_STRUCT_TRAITS_MEMBER(url)
97 IPC_STRUCT_TRAITS_MEMBER(state)
98 IPC_STRUCT_TRAITS_MEMBER(version_id)
99 IPC_STRUCT_TRAITS_END()
101 IPC_STRUCT_TRAITS_BEGIN(content::ServiceWorkerRegistrationObjectInfo)
102 IPC_STRUCT_TRAITS_MEMBER(handle_id)
103 IPC_STRUCT_TRAITS_MEMBER(scope)
104 IPC_STRUCT_TRAITS_MEMBER(registration_id)
105 IPC_STRUCT_TRAITS_END()
107 IPC_STRUCT_TRAITS_BEGIN(content::ServiceWorkerVersionAttributes)
108 IPC_STRUCT_TRAITS_MEMBER(installing)
109 IPC_STRUCT_TRAITS_MEMBER(waiting)
110 IPC_STRUCT_TRAITS_MEMBER(active)
111 IPC_STRUCT_TRAITS_END()
113 IPC_STRUCT_TRAITS_BEGIN(content::ServiceWorkerClientInfo)
114 IPC_STRUCT_TRAITS_MEMBER(client_uuid)
115 IPC_STRUCT_TRAITS_MEMBER(page_visibility_state)
116 IPC_STRUCT_TRAITS_MEMBER(is_focused)
117 IPC_STRUCT_TRAITS_MEMBER(url)
118 IPC_STRUCT_TRAITS_MEMBER(frame_type)
119 IPC_STRUCT_TRAITS_MEMBER(client_type)
120 IPC_STRUCT_TRAITS_END()
122 IPC_STRUCT_TRAITS_BEGIN(content::ServiceWorkerClientQueryOptions)
123 IPC_STRUCT_TRAITS_MEMBER(client_type)
124 IPC_STRUCT_TRAITS_MEMBER(include_uncontrolled)
125 IPC_STRUCT_TRAITS_END()
127 IPC_ENUM_TRAITS_MAX_VALUE(
128 blink::WebServiceWorkerCacheError,
129 blink::WebServiceWorkerCacheErrorLast)
131 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebGeofencingEventType,
132 blink::WebGeofencingEventTypeLast)
134 //---------------------------------------------------------------------------
135 // Messages sent from the child process to the browser.
137 IPC_MESSAGE_CONTROL5(ServiceWorkerHostMsg_RegisterServiceWorker,
138 int /* thread_id */,
139 int /* request_id */,
140 int /* provider_id */,
141 GURL /* scope */,
142 GURL /* script_url */)
144 IPC_MESSAGE_CONTROL4(ServiceWorkerHostMsg_UnregisterServiceWorker,
145 int /* thread_id */,
146 int /* request_id */,
147 int /* provider_id */,
148 GURL /* scope (url pattern) */)
150 IPC_MESSAGE_CONTROL4(ServiceWorkerHostMsg_GetRegistration,
151 int /* thread_id */,
152 int /* request_id */,
153 int /* provider_id */,
154 GURL /* document_url */)
156 IPC_MESSAGE_CONTROL3(ServiceWorkerHostMsg_GetRegistrationForReady,
157 int /* thread_id */,
158 int /* request_id */,
159 int /* provider_id */)
161 // Sends a 'message' event to a service worker (renderer->browser).
162 IPC_MESSAGE_CONTROL3(
163 ServiceWorkerHostMsg_PostMessageToWorker,
164 int /* handle_id */,
165 base::string16 /* message */,
166 std::vector<content::TransferredMessagePort> /* sent_message_ports */)
168 // Informs the browser of a new ServiceWorkerProvider in the child process,
169 // |provider_id| is unique within its child process.
170 // |render_frame_id| identifies the frame associated with the provider, it will
171 // it will be MSG_ROUTING_NONE if the context is a worker instead of a document.
172 // |provider_type| identifies whether this provider is for ServiceWorker
173 // controllees (documents and SharedWorkers) or for controllers
174 // (ServiceWorkers).
175 IPC_MESSAGE_CONTROL3(ServiceWorkerHostMsg_ProviderCreated,
176 int /* provider_id */,
177 int /* render_frame_id */,
178 content::ServiceWorkerProviderType /* provider_type */)
180 // Informs the browser of a ServiceWorkerProvider being destroyed.
181 IPC_MESSAGE_CONTROL1(ServiceWorkerHostMsg_ProviderDestroyed,
182 int /* provider_id */)
184 // Increments and decrements the ServiceWorker object's reference
185 // counting in the browser side. The ServiceWorker object is created
186 // with ref-count==1 initially.
187 IPC_MESSAGE_CONTROL1(ServiceWorkerHostMsg_IncrementServiceWorkerRefCount,
188 int /* handle_id */)
189 IPC_MESSAGE_CONTROL1(ServiceWorkerHostMsg_DecrementServiceWorkerRefCount,
190 int /* handle_id */)
192 // Increments and decrements the ServiceWorkerRegistration object's reference
193 // counting in the browser side. The registration object is created with
194 // ref-count==1 initially.
195 IPC_MESSAGE_CONTROL1(ServiceWorkerHostMsg_IncrementRegistrationRefCount,
196 int /* registration_handle_id */)
197 IPC_MESSAGE_CONTROL1(ServiceWorkerHostMsg_DecrementRegistrationRefCount,
198 int /* registration_handle_id */)
200 // Tells the browser to terminate a service worker. Used in layout tests to
201 // verify behavior when a service worker isn't running.
202 IPC_MESSAGE_CONTROL1(ServiceWorkerHostMsg_TerminateWorker,
203 int /* handle_id */)
205 // Informs the browser that |provider_id| is associated
206 // with a service worker script running context and
207 // |version_id| identifies which ServiceWorkerVersion.
208 IPC_MESSAGE_CONTROL2(ServiceWorkerHostMsg_SetVersionId,
209 int /* provider_id */,
210 int64 /* version_id */)
212 // Informs the browser that event handling has finished.
213 // Routed to the target ServiceWorkerVersion.
214 IPC_MESSAGE_ROUTED2(ServiceWorkerHostMsg_InstallEventFinished,
215 int /* request_id */,
216 blink::WebServiceWorkerEventResult)
217 IPC_MESSAGE_ROUTED2(ServiceWorkerHostMsg_ActivateEventFinished,
218 int /* request_id */,
219 blink::WebServiceWorkerEventResult)
220 IPC_MESSAGE_ROUTED3(ServiceWorkerHostMsg_FetchEventFinished,
221 int /* request_id */,
222 content::ServiceWorkerFetchEventResult,
223 content::ServiceWorkerResponse)
224 IPC_MESSAGE_ROUTED1(ServiceWorkerHostMsg_SyncEventFinished,
225 int /* request_id */)
226 IPC_MESSAGE_ROUTED1(ServiceWorkerHostMsg_NotificationClickEventFinished,
227 int /* request_id */)
228 IPC_MESSAGE_ROUTED2(ServiceWorkerHostMsg_PushEventFinished,
229 int /* request_id */,
230 blink::WebServiceWorkerEventResult)
231 IPC_MESSAGE_ROUTED1(ServiceWorkerHostMsg_GeofencingEventFinished,
232 int /* request_id */)
233 IPC_MESSAGE_ROUTED2(ServiceWorkerHostMsg_CrossOriginConnectEventFinished,
234 int /* request_id */,
235 bool /* accept_connection */)
237 // Responds to a Ping from the browser.
238 // Routed to the target ServiceWorkerVersion.
239 IPC_MESSAGE_ROUTED0(ServiceWorkerHostMsg_Pong)
241 // Asks the browser to retrieve clients of the sender ServiceWorker.
242 IPC_MESSAGE_ROUTED2(ServiceWorkerHostMsg_GetClients,
243 int /* request_id */,
244 content::ServiceWorkerClientQueryOptions)
246 // Sends a 'message' event to a client (renderer->browser).
247 IPC_MESSAGE_ROUTED3(
248 ServiceWorkerHostMsg_PostMessageToClient,
249 std::string /* uuid */,
250 base::string16 /* message */,
251 std::vector<content::TransferredMessagePort> /* sent_message_ports */)
253 // ServiceWorker -> Browser message to request that the ServiceWorkerStorage
254 // cache |data| associated with |url|.
255 IPC_MESSAGE_ROUTED2(ServiceWorkerHostMsg_SetCachedMetadata,
256 GURL /* url */,
257 std::vector<char> /* data */)
259 // ServiceWorker -> Browser message to request that the ServiceWorkerStorage
260 // clear the cache associated with |url|.
261 IPC_MESSAGE_ROUTED1(ServiceWorkerHostMsg_ClearCachedMetadata, GURL /* url */)
263 // Ask the browser to open a tab/window (renderer->browser).
264 IPC_MESSAGE_ROUTED2(ServiceWorkerHostMsg_OpenWindow,
265 int /* request_id */,
266 GURL /* url */)
268 // Ask the browser to focus a client (renderer->browser).
269 IPC_MESSAGE_ROUTED2(ServiceWorkerHostMsg_FocusClient,
270 int /* request_id */,
271 std::string /* uuid */)
273 // Asks the browser to force this worker to become activated.
274 IPC_MESSAGE_ROUTED1(ServiceWorkerHostMsg_SkipWaiting,
275 int /* request_id */)
277 // Asks the browser to have this worker take control of pages that match
278 // its scope.
279 IPC_MESSAGE_ROUTED1(ServiceWorkerHostMsg_ClaimClients,
280 int /* request_id */)
282 // CacheStorage operations in the browser.
283 IPC_MESSAGE_ROUTED2(ServiceWorkerHostMsg_CacheStorageHas,
284 int /* request_id */,
285 base::string16 /* fetch_store_name */)
287 IPC_MESSAGE_ROUTED2(ServiceWorkerHostMsg_CacheStorageOpen,
288 int /* request_id */,
289 base::string16 /* fetch_store_name */)
291 IPC_MESSAGE_ROUTED2(ServiceWorkerHostMsg_CacheStorageDelete,
292 int /* request_id */,
293 base::string16 /* fetch_store_name */)
295 IPC_MESSAGE_ROUTED1(ServiceWorkerHostMsg_CacheStorageKeys,
296 int /* request_id */)
298 IPC_MESSAGE_ROUTED3(ServiceWorkerHostMsg_CacheStorageMatch,
299 int /* request_id */,
300 content::ServiceWorkerFetchRequest,
301 content::ServiceWorkerCacheQueryParams)
303 // Cache operations in the browser.
304 IPC_MESSAGE_ROUTED4(ServiceWorkerHostMsg_CacheMatch,
305 int /* request_id */,
306 int /* cache_id */,
307 content::ServiceWorkerFetchRequest,
308 content::ServiceWorkerCacheQueryParams)
310 IPC_MESSAGE_ROUTED4(ServiceWorkerHostMsg_CacheMatchAll,
311 int /* request_id */,
312 int /* cache_id */,
313 content::ServiceWorkerFetchRequest,
314 content::ServiceWorkerCacheQueryParams)
316 IPC_MESSAGE_ROUTED4(ServiceWorkerHostMsg_CacheKeys,
317 int /* request_id */,
318 int /* cache_id */,
319 content::ServiceWorkerFetchRequest,
320 content::ServiceWorkerCacheQueryParams)
322 IPC_MESSAGE_ROUTED3(ServiceWorkerHostMsg_CacheBatch,
323 int /* request_id */,
324 int /* cache_id */,
325 std::vector<content::ServiceWorkerBatchOperation>)
327 IPC_MESSAGE_ROUTED1(ServiceWorkerHostMsg_CacheClosed,
328 int /* cache_id */)
330 IPC_MESSAGE_ROUTED1(ServiceWorkerHostMsg_BlobDataHandled,
331 std::string /* uuid */)
333 //---------------------------------------------------------------------------
334 // Messages sent from the browser to the child process.
336 // NOTE: All ServiceWorkerMsg messages not sent via EmbeddedWorker must have
337 // a thread_id as their first field so that ServiceWorkerMessageFilter can
338 // extract it and dispatch the message to the correct ServiceWorkerDispatcher
339 // on the correct thread.
341 // Informs the child process of the registration associated with the service
342 // worker.
343 IPC_MESSAGE_CONTROL4(ServiceWorkerMsg_AssociateRegistrationWithServiceWorker,
344 int /* thread_id*/,
345 int /* provider_id */,
346 content::ServiceWorkerRegistrationObjectInfo,
347 content::ServiceWorkerVersionAttributes)
349 // Informs the child process that the given provider gets associated or
350 // disassociated with the registration.
351 IPC_MESSAGE_CONTROL4(ServiceWorkerMsg_AssociateRegistration,
352 int /* thread_id */,
353 int /* provider_id */,
354 content::ServiceWorkerRegistrationObjectInfo,
355 content::ServiceWorkerVersionAttributes)
356 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_DisassociateRegistration,
357 int /* thread_id */,
358 int /* provider_id */)
360 // Response to ServiceWorkerHostMsg_RegisterServiceWorker.
361 IPC_MESSAGE_CONTROL4(ServiceWorkerMsg_ServiceWorkerRegistered,
362 int /* thread_id */,
363 int /* request_id */,
364 content::ServiceWorkerRegistrationObjectInfo,
365 content::ServiceWorkerVersionAttributes)
367 // Response to ServiceWorkerHostMsg_UnregisterServiceWorker.
368 IPC_MESSAGE_CONTROL3(ServiceWorkerMsg_ServiceWorkerUnregistered,
369 int /* thread_id */,
370 int /* request_id */,
371 bool /* is_success */)
373 // Response to ServiceWorkerHostMsg_GetRegistration.
374 IPC_MESSAGE_CONTROL4(ServiceWorkerMsg_DidGetRegistration,
375 int /* thread_id */,
376 int /* request_id */,
377 content::ServiceWorkerRegistrationObjectInfo,
378 content::ServiceWorkerVersionAttributes)
380 // Response to ServiceWorkerHostMsg_GetRegistrationForReady.
381 IPC_MESSAGE_CONTROL4(ServiceWorkerMsg_DidGetRegistrationForReady,
382 int /* thread_id */,
383 int /* request_id */,
384 content::ServiceWorkerRegistrationObjectInfo,
385 content::ServiceWorkerVersionAttributes)
387 // Sent when any kind of registration error occurs during a
388 // RegisterServiceWorker handler above.
389 IPC_MESSAGE_CONTROL4(ServiceWorkerMsg_ServiceWorkerRegistrationError,
390 int /* thread_id */,
391 int /* request_id */,
392 blink::WebServiceWorkerError::ErrorType /* code */,
393 base::string16 /* message */)
395 // Sent when any kind of registration error occurs during a
396 // UnregisterServiceWorker handler above.
397 IPC_MESSAGE_CONTROL4(ServiceWorkerMsg_ServiceWorkerUnregistrationError,
398 int /* thread_id */,
399 int /* request_id */,
400 blink::WebServiceWorkerError::ErrorType /* code */,
401 base::string16 /* message */)
403 // Sent when any kind of registration error occurs during a
404 // GetRegistration handler above.
405 IPC_MESSAGE_CONTROL4(ServiceWorkerMsg_ServiceWorkerGetRegistrationError,
406 int /* thread_id */,
407 int /* request_id */,
408 blink::WebServiceWorkerError::ErrorType /* code */,
409 base::string16 /* message */)
411 // Informs the child process that the ServiceWorker's state has changed.
412 IPC_MESSAGE_CONTROL3(ServiceWorkerMsg_ServiceWorkerStateChanged,
413 int /* thread_id */,
414 int /* handle_id */,
415 blink::WebServiceWorkerState)
417 // Tells the child process to set service workers for the given provider.
418 IPC_MESSAGE_CONTROL5(ServiceWorkerMsg_SetVersionAttributes,
419 int /* thread_id */,
420 int /* provider_id */,
421 int /* registration_handle_id */,
422 int /* changed_mask */,
423 content::ServiceWorkerVersionAttributes)
425 // Informs the child process that new ServiceWorker enters the installation
426 // phase.
427 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_UpdateFound,
428 int /* thread_id */,
429 int /* registration_handle_id */)
431 // Tells the child process to set the controller ServiceWorker for the given
432 // provider.
433 IPC_MESSAGE_CONTROL4(ServiceWorkerMsg_SetControllerServiceWorker,
434 int /* thread_id */,
435 int /* provider_id */,
436 content::ServiceWorkerObjectInfo,
437 bool /* should_notify_controllerchange */)
439 // Sends a 'message' event to a client document (browser->renderer).
440 IPC_MESSAGE_CONTROL5(
441 ServiceWorkerMsg_MessageToDocument,
442 int /* thread_id */,
443 int /* provider_id */,
444 base::string16 /* message */,
445 std::vector<content::TransferredMessagePort> /* sent_message_ports */,
446 std::vector<int> /* new_routing_ids */)
448 // Sent via EmbeddedWorker to dispatch events.
449 IPC_MESSAGE_CONTROL1(ServiceWorkerMsg_InstallEvent,
450 int /* request_id */)
451 IPC_MESSAGE_CONTROL1(ServiceWorkerMsg_ActivateEvent,
452 int /* request_id */)
453 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_FetchEvent,
454 int /* request_id */,
455 content::ServiceWorkerFetchRequest)
456 IPC_MESSAGE_CONTROL1(ServiceWorkerMsg_SyncEvent,
457 int /* request_id */)
458 IPC_MESSAGE_CONTROL3(ServiceWorkerMsg_NotificationClickEvent,
459 int /* request_id */,
460 std::string /* notification_id */,
461 content::PlatformNotificationData /* notification_data */)
462 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_PushEvent,
463 int /* request_id */,
464 std::string /* data */)
465 IPC_MESSAGE_CONTROL4(ServiceWorkerMsg_GeofencingEvent,
466 int /* request_id */,
467 blink::WebGeofencingEventType /* event_type */,
468 std::string /* region_id */,
469 blink::WebCircularGeofencingRegion /* region */)
470 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_CrossOriginConnectEvent,
471 int /* request_id */,
472 content::NavigatorConnectClient /* client */)
473 IPC_MESSAGE_CONTROL3(
474 ServiceWorkerMsg_MessageToWorker,
475 base::string16 /* message */,
476 std::vector<content::TransferredMessagePort> /* sent_message_ports */,
477 std::vector<int> /* new_routing_ids */)
478 IPC_MESSAGE_CONTROL4(
479 ServiceWorkerMsg_CrossOriginMessageToWorker,
480 content::NavigatorConnectClient /* client */,
481 base::string16 /* message */,
482 std::vector<content::TransferredMessagePort> /* sent_message_ports */,
483 std::vector<int> /* new_routing_ids */)
484 IPC_MESSAGE_CONTROL1(ServiceWorkerMsg_DidSkipWaiting,
485 int /* request_id */)
486 IPC_MESSAGE_CONTROL1(ServiceWorkerMsg_DidClaimClients,
487 int /* request_id */)
488 IPC_MESSAGE_CONTROL3(ServiceWorkerMsg_ClaimClientsError,
489 int /* request_id */,
490 blink::WebServiceWorkerError::ErrorType /* code */,
491 base::string16 /* message */)
493 // Sent via EmbeddedWorker to Ping the worker, expecting a Pong in response.
494 IPC_MESSAGE_CONTROL0(ServiceWorkerMsg_Ping)
496 // Sent via EmbeddedWorker as a response of GetClients.
497 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_DidGetClients,
498 int /* request_id */,
499 std::vector<content::ServiceWorkerClientInfo>)
501 // Sent via EmbeddedWorker as a response of OpenWindow.
502 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_OpenWindowResponse,
503 int /* request_id */,
504 content::ServiceWorkerClientInfo /* client */)
506 // Sent via EmbeddedWorker as an error response of OpenWindow.
507 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_OpenWindowError,
508 int /* request_id */,
509 std::string /* message */ )
511 // Sent via EmbeddedWorker as a response of FocusClient.
512 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_FocusClientResponse,
513 int /* request_id */,
514 content::ServiceWorkerClientInfo /* client */)
516 // Sent via EmbeddedWorker at successful completion of CacheStorage operations.
517 IPC_MESSAGE_CONTROL1(ServiceWorkerMsg_CacheStorageHasSuccess,
518 int /* request_id */)
519 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_CacheStorageOpenSuccess,
520 int /* request_id */,
521 int /* fetch_store_id */)
522 IPC_MESSAGE_CONTROL1(ServiceWorkerMsg_CacheStorageDeleteSuccess,
523 int /* request_id */)
524 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_CacheStorageKeysSuccess,
525 int /* request_id */,
526 std::vector<base::string16> /* keys */)
527 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_CacheStorageMatchSuccess,
528 int /* request_id */,
529 content::ServiceWorkerResponse)
531 // Sent via EmbeddedWorker at erroneous completion of CacheStorage operations.
532 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_CacheStorageHasError,
533 int /* request_id */,
534 blink::WebServiceWorkerCacheError /* reason */)
535 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_CacheStorageOpenError,
536 int /* request_id */,
537 blink::WebServiceWorkerCacheError /* reason */)
538 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_CacheStorageDeleteError,
539 int /* request_id */,
540 blink::WebServiceWorkerCacheError /* reason */)
541 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_CacheStorageKeysError,
542 int /* request_id */,
543 blink::WebServiceWorkerCacheError /* reason */)
544 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_CacheStorageMatchError,
545 int /* request_id */,
546 blink::WebServiceWorkerCacheError)
548 // Sent via EmbeddedWorker at successful completion of Cache operations.
549 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_CacheMatchSuccess,
550 int /* request_id */,
551 content::ServiceWorkerResponse)
552 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_CacheMatchAllSuccess,
553 int /* request_id */,
554 std::vector<content::ServiceWorkerResponse>)
555 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_CacheKeysSuccess,
556 int /* request_id */,
557 std::vector<content::ServiceWorkerFetchRequest>)
558 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_CacheBatchSuccess,
559 int /* request_id */,
560 std::vector<content::ServiceWorkerResponse>)
562 // Sent via EmbeddedWorker at erroneous completion of CacheStorage operations.
563 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_CacheMatchError,
564 int /* request_id */,
565 blink::WebServiceWorkerCacheError)
566 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_CacheMatchAllError,
567 int /* request_id */,
568 blink::WebServiceWorkerCacheError)
569 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_CacheKeysError,
570 int /* request_id */,
571 blink::WebServiceWorkerCacheError)
572 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_CacheBatchError,
573 int /* request_id */,
574 blink::WebServiceWorkerCacheError)