| 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 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| 11 #include "content/common/service_worker/service_worker_client_info.h" | 11 #include "content/common/service_worker/service_worker_client_info.h" |
| 12 #include "content/common/service_worker/service_worker_status_code.h" | 12 #include "content/common/service_worker/service_worker_status_code.h" |
| 13 #include "content/common/service_worker/service_worker_types.h" | 13 #include "content/common/service_worker/service_worker_types.h" |
| 14 #include "content/public/common/message_port_types.h" |
| 14 #include "content/public/common/navigator_connect_client.h" | 15 #include "content/public/common/navigator_connect_client.h" |
| 15 #include "content/public/common/platform_notification_data.h" | 16 #include "content/public/common/platform_notification_data.h" |
| 16 #include "ipc/ipc_message_macros.h" | 17 #include "ipc/ipc_message_macros.h" |
| 17 #include "ipc/ipc_param_traits.h" | 18 #include "ipc/ipc_param_traits.h" |
| 18 #include "third_party/WebKit/public/platform/WebCircularGeofencingRegion.h" | 19 #include "third_party/WebKit/public/platform/WebCircularGeofencingRegion.h" |
| 19 #include "third_party/WebKit/public/platform/WebGeofencingEventType.h" | 20 #include "third_party/WebKit/public/platform/WebGeofencingEventType.h" |
| 20 #include "third_party/WebKit/public/platform/WebServiceWorkerCacheError.h" | 21 #include "third_party/WebKit/public/platform/WebServiceWorkerCacheError.h" |
| 21 #include "third_party/WebKit/public/platform/WebServiceWorkerError.h" | 22 #include "third_party/WebKit/public/platform/WebServiceWorkerError.h" |
| 22 #include "third_party/WebKit/public/platform/WebServiceWorkerEventResult.h" | 23 #include "third_party/WebKit/public/platform/WebServiceWorkerEventResult.h" |
| 23 #include "url/gurl.h" | 24 #include "url/gurl.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 int /* provider_id */, | 139 int /* provider_id */, |
| 139 GURL /* scope (url pattern) */) | 140 GURL /* scope (url pattern) */) |
| 140 | 141 |
| 141 IPC_MESSAGE_CONTROL4(ServiceWorkerHostMsg_GetRegistration, | 142 IPC_MESSAGE_CONTROL4(ServiceWorkerHostMsg_GetRegistration, |
| 142 int /* thread_id */, | 143 int /* thread_id */, |
| 143 int /* request_id */, | 144 int /* request_id */, |
| 144 int /* provider_id */, | 145 int /* provider_id */, |
| 145 GURL /* document_url */) | 146 GURL /* document_url */) |
| 146 | 147 |
| 147 // Sends a 'message' event to a service worker (renderer->browser). | 148 // Sends a 'message' event to a service worker (renderer->browser). |
| 148 IPC_MESSAGE_CONTROL3(ServiceWorkerHostMsg_PostMessageToWorker, | 149 IPC_MESSAGE_CONTROL3( |
| 149 int /* handle_id */, | 150 ServiceWorkerHostMsg_PostMessageToWorker, |
| 150 base::string16 /* message */, | 151 int /* handle_id */, |
| 151 std::vector<int> /* sent_message_port_ids */) | 152 base::string16 /* message */, |
| 153 std::vector<content::TransferredMessagePort> /* sent_message_ports */) |
| 152 | 154 |
| 153 // Informs the browser of a new ServiceWorkerProvider in the child process, | 155 // Informs the browser of a new ServiceWorkerProvider in the child process, |
| 154 // |provider_id| is unique within its child process. | 156 // |provider_id| is unique within its child process. |
| 155 // |render_frame_id| identifies the frame associated with the provider, it will | 157 // |render_frame_id| identifies the frame associated with the provider, it will |
| 156 // it will be MSG_ROUTING_NONE if the context is a worker instead of a document. | 158 // it will be MSG_ROUTING_NONE if the context is a worker instead of a document. |
| 157 // |provider_type| identifies whether this provider is for ServiceWorker | 159 // |provider_type| identifies whether this provider is for ServiceWorker |
| 158 // controllees (documents and SharedWorkers) or for controllers | 160 // controllees (documents and SharedWorkers) or for controllers |
| 159 // (ServiceWorkers). | 161 // (ServiceWorkers). |
| 160 IPC_MESSAGE_CONTROL3(ServiceWorkerHostMsg_ProviderCreated, | 162 IPC_MESSAGE_CONTROL3(ServiceWorkerHostMsg_ProviderCreated, |
| 161 int /* provider_id */, | 163 int /* provider_id */, |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 // Responds to a Ping from the browser. | 224 // Responds to a Ping from the browser. |
| 223 // Routed to the target ServiceWorkerVersion. | 225 // Routed to the target ServiceWorkerVersion. |
| 224 IPC_MESSAGE_ROUTED0(ServiceWorkerHostMsg_Pong) | 226 IPC_MESSAGE_ROUTED0(ServiceWorkerHostMsg_Pong) |
| 225 | 227 |
| 226 // Asks the browser to retrieve documents controlled by the sender | 228 // Asks the browser to retrieve documents controlled by the sender |
| 227 // ServiceWorker. | 229 // ServiceWorker. |
| 228 IPC_MESSAGE_ROUTED1(ServiceWorkerHostMsg_GetClientDocuments, | 230 IPC_MESSAGE_ROUTED1(ServiceWorkerHostMsg_GetClientDocuments, |
| 229 int /* request_id */) | 231 int /* request_id */) |
| 230 | 232 |
| 231 // Sends a 'message' event to a client document (renderer->browser). | 233 // Sends a 'message' event to a client document (renderer->browser). |
| 232 IPC_MESSAGE_ROUTED3(ServiceWorkerHostMsg_PostMessageToDocument, | 234 IPC_MESSAGE_ROUTED3( |
| 233 int /* client_id */, | 235 ServiceWorkerHostMsg_PostMessageToDocument, |
| 234 base::string16 /* message */, | 236 int /* client_id */, |
| 235 std::vector<int> /* sent_message_port_ids */) | 237 base::string16 /* message */, |
| 238 std::vector<content::TransferredMessagePort> /* sent_message_ports */) |
| 236 | 239 |
| 237 // ServiceWorker -> Browser message to request that the ServiceWorkerStorage | 240 // ServiceWorker -> Browser message to request that the ServiceWorkerStorage |
| 238 // cache |data| associated with |url|. | 241 // cache |data| associated with |url|. |
| 239 IPC_MESSAGE_ROUTED2(ServiceWorkerHostMsg_SetCachedMetadata, | 242 IPC_MESSAGE_ROUTED2(ServiceWorkerHostMsg_SetCachedMetadata, |
| 240 GURL /* url */, | 243 GURL /* url */, |
| 241 std::vector<char> /* data */) | 244 std::vector<char> /* data */) |
| 242 | 245 |
| 243 // ServiceWorker -> Browser message to request that the ServiceWorkerStorage | 246 // ServiceWorker -> Browser message to request that the ServiceWorkerStorage |
| 244 // clear the cache associated with |url|. | 247 // clear the cache associated with |url|. |
| 245 IPC_MESSAGE_ROUTED1(ServiceWorkerHostMsg_ClearCachedMetadata, GURL /* url */) | 248 IPC_MESSAGE_ROUTED1(ServiceWorkerHostMsg_ClearCachedMetadata, GURL /* url */) |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 | 410 |
| 408 // Tells the child process to set the controller ServiceWorker for the given | 411 // Tells the child process to set the controller ServiceWorker for the given |
| 409 // provider. | 412 // provider. |
| 410 IPC_MESSAGE_CONTROL4(ServiceWorkerMsg_SetControllerServiceWorker, | 413 IPC_MESSAGE_CONTROL4(ServiceWorkerMsg_SetControllerServiceWorker, |
| 411 int /* thread_id */, | 414 int /* thread_id */, |
| 412 int /* provider_id */, | 415 int /* provider_id */, |
| 413 content::ServiceWorkerObjectInfo, | 416 content::ServiceWorkerObjectInfo, |
| 414 bool /* should_notify_controllerchange */) | 417 bool /* should_notify_controllerchange */) |
| 415 | 418 |
| 416 // Sends a 'message' event to a client document (browser->renderer). | 419 // Sends a 'message' event to a client document (browser->renderer). |
| 417 IPC_MESSAGE_CONTROL5(ServiceWorkerMsg_MessageToDocument, | 420 IPC_MESSAGE_CONTROL5( |
| 418 int /* thread_id */, | 421 ServiceWorkerMsg_MessageToDocument, |
| 419 int /* provider_id */, | 422 int /* thread_id */, |
| 420 base::string16 /* message */, | 423 int /* provider_id */, |
| 421 std::vector<int> /* sent_message_port_ids */, | 424 base::string16 /* message */, |
| 422 std::vector<int> /* new_routing_ids */) | 425 std::vector<content::TransferredMessagePort> /* sent_message_ports */, |
| 426 std::vector<int> /* new_routing_ids */) |
| 423 | 427 |
| 424 // Sent via EmbeddedWorker to dispatch events. | 428 // Sent via EmbeddedWorker to dispatch events. |
| 425 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_InstallEvent, | 429 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_InstallEvent, |
| 426 int /* request_id */, | 430 int /* request_id */, |
| 427 int /* active_version_id */) | 431 int /* active_version_id */) |
| 428 IPC_MESSAGE_CONTROL1(ServiceWorkerMsg_ActivateEvent, | 432 IPC_MESSAGE_CONTROL1(ServiceWorkerMsg_ActivateEvent, |
| 429 int /* request_id */) | 433 int /* request_id */) |
| 430 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_FetchEvent, | 434 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_FetchEvent, |
| 431 int /* request_id */, | 435 int /* request_id */, |
| 432 content::ServiceWorkerFetchRequest) | 436 content::ServiceWorkerFetchRequest) |
| 433 IPC_MESSAGE_CONTROL1(ServiceWorkerMsg_SyncEvent, | 437 IPC_MESSAGE_CONTROL1(ServiceWorkerMsg_SyncEvent, |
| 434 int /* request_id */) | 438 int /* request_id */) |
| 435 IPC_MESSAGE_CONTROL3(ServiceWorkerMsg_NotificationClickEvent, | 439 IPC_MESSAGE_CONTROL3(ServiceWorkerMsg_NotificationClickEvent, |
| 436 int /* request_id */, | 440 int /* request_id */, |
| 437 std::string /* notification_id */, | 441 std::string /* notification_id */, |
| 438 content::PlatformNotificationData /* notification_data */) | 442 content::PlatformNotificationData /* notification_data */) |
| 439 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_PushEvent, | 443 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_PushEvent, |
| 440 int /* request_id */, | 444 int /* request_id */, |
| 441 std::string /* data */) | 445 std::string /* data */) |
| 442 IPC_MESSAGE_CONTROL4(ServiceWorkerMsg_GeofencingEvent, | 446 IPC_MESSAGE_CONTROL4(ServiceWorkerMsg_GeofencingEvent, |
| 443 int /* request_id */, | 447 int /* request_id */, |
| 444 blink::WebGeofencingEventType /* event_type */, | 448 blink::WebGeofencingEventType /* event_type */, |
| 445 std::string /* region_id */, | 449 std::string /* region_id */, |
| 446 blink::WebCircularGeofencingRegion /* region */) | 450 blink::WebCircularGeofencingRegion /* region */) |
| 447 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_CrossOriginConnectEvent, | 451 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_CrossOriginConnectEvent, |
| 448 int /* request_id */, | 452 int /* request_id */, |
| 449 content::NavigatorConnectClient /* client */) | 453 content::NavigatorConnectClient /* client */) |
| 450 IPC_MESSAGE_CONTROL3(ServiceWorkerMsg_MessageToWorker, | 454 IPC_MESSAGE_CONTROL3( |
| 451 base::string16 /* message */, | 455 ServiceWorkerMsg_MessageToWorker, |
| 452 std::vector<int> /* sent_message_port_ids */, | 456 base::string16 /* message */, |
| 453 std::vector<int> /* new_routing_ids */) | 457 std::vector<content::TransferredMessagePort> /* sent_message_ports */, |
| 454 IPC_MESSAGE_CONTROL4(ServiceWorkerMsg_CrossOriginMessageToWorker, | 458 std::vector<int> /* new_routing_ids */) |
| 455 content::NavigatorConnectClient /* client */, | 459 IPC_MESSAGE_CONTROL4( |
| 456 base::string16 /* message */, | 460 ServiceWorkerMsg_CrossOriginMessageToWorker, |
| 457 std::vector<int> /* sent_message_port_ids */, | 461 content::NavigatorConnectClient /* client */, |
| 458 std::vector<int> /* new_routing_ids */) | 462 base::string16 /* message */, |
| 463 std::vector<content::TransferredMessagePort> /* sent_message_ports */, |
| 464 std::vector<int> /* new_routing_ids */) |
| 459 IPC_MESSAGE_CONTROL1(ServiceWorkerMsg_DidSkipWaiting, | 465 IPC_MESSAGE_CONTROL1(ServiceWorkerMsg_DidSkipWaiting, |
| 460 int /* request_id */) | 466 int /* request_id */) |
| 461 IPC_MESSAGE_CONTROL1(ServiceWorkerMsg_DidClaimClients, | 467 IPC_MESSAGE_CONTROL1(ServiceWorkerMsg_DidClaimClients, |
| 462 int /* request_id */) | 468 int /* request_id */) |
| 463 IPC_MESSAGE_CONTROL3(ServiceWorkerMsg_ClaimClientsError, | 469 IPC_MESSAGE_CONTROL3(ServiceWorkerMsg_ClaimClientsError, |
| 464 int /* request_id */, | 470 int /* request_id */, |
| 465 blink::WebServiceWorkerError::ErrorType /* code */, | 471 blink::WebServiceWorkerError::ErrorType /* code */, |
| 466 base::string16 /* message */) | 472 base::string16 /* message */) |
| 467 | 473 |
| 468 // Sent via EmbeddedWorker to Ping the worker, expecting a Pong in response. | 474 // Sent via EmbeddedWorker to Ping the worker, expecting a Pong in response. |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 blink::WebServiceWorkerCacheError) | 545 blink::WebServiceWorkerCacheError) |
| 540 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_CacheMatchAllError, | 546 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_CacheMatchAllError, |
| 541 int /* request_id */, | 547 int /* request_id */, |
| 542 blink::WebServiceWorkerCacheError) | 548 blink::WebServiceWorkerCacheError) |
| 543 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_CacheKeysError, | 549 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_CacheKeysError, |
| 544 int /* request_id */, | 550 int /* request_id */, |
| 545 blink::WebServiceWorkerCacheError) | 551 blink::WebServiceWorkerCacheError) |
| 546 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_CacheBatchError, | 552 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_CacheBatchError, |
| 547 int /* request_id */, | 553 int /* request_id */, |
| 548 blink::WebServiceWorkerCacheError) | 554 blink::WebServiceWorkerCacheError) |
| OLD | NEW |