1 // Copyright 2013 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. 4 5 // Message definition file, included multiple times, hence no include guard. 6 7 #include "base/strings/string16.h" 8 #include "ipc/ipc_message_macros.h" 9 #include "ipc/ipc_param_traits.h" 10 #include "third_party/WebKit/public/platform/WebServiceWorkerError.h" 11 #include "url/gurl.h" 12 13 #undef IPC_MESSAGE_EXPORT 14 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT 15 16 #define IPC_MESSAGE_START ServiceWorkerMsgStart 17 18 IPC_ENUM_TRAITS(blink::WebServiceWorkerError::ErrorType) 19 20 // Messages sent from the child process to the browser. 21 22 IPC_MESSAGE_CONTROL4(ServiceWorkerHostMsg_RegisterServiceWorker, 23 int32 /* thread_id */, 24 int32 /* request_id */, 25 GURL /* scope */, 26 GURL /* script_url */) 27 28 IPC_MESSAGE_CONTROL3(ServiceWorkerHostMsg_UnregisterServiceWorker, 29 int32 /* thread_id */, 30 int32 /* request_id */, 31 GURL /* scope (url pattern) */) 32 33 // Messages sent from the browser to the child process. 34 35 // Response to ServiceWorkerMsg_RegisterServiceWorker 36 IPC_MESSAGE_CONTROL3(ServiceWorkerMsg_ServiceWorkerRegistered, 37 int32 /* thread_id */, 38 int32 /* request_id */, 39 int64 /* service_worker_id */) 40 41 // Response to ServiceWorkerMsg_UnregisterServiceWorker 42 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_ServiceWorkerUnregistered, 43 int32 /* thread_id */, 44 int32 /* request_id */) 45 46 // Sent when any kind of registration error occurs during a 47 // RegisterServiceWorker / UnregisterServiceWorker handler above. 48 IPC_MESSAGE_CONTROL4(ServiceWorkerMsg_ServiceWorkerRegistrationError, 49 int32 /* thread_id */, 50 int32 /* request_id */, 51 blink::WebServiceWorkerError::ErrorType /* code */, 52 base::string16 /* message */) 53 54 // Informs the browser of a new ServiceWorkerProvider in the child process, 55 // |provider_id| is unique within its child process. 56 IPC_MESSAGE_CONTROL1(ServiceWorkerHostMsg_ProviderCreated, 57 int /* provider_id */) 58 59 // Informs the browser of a ServiceWorkerProvider being destroyed. 60 IPC_MESSAGE_CONTROL1(ServiceWorkerHostMsg_ProviderDestroyed, 61 int /* provider_id */) 62 63 // For EmbeddedWorker related messages ------------------------------------- 64 65 // Browser -> Renderer message to create a new embedded worker context. 66 IPC_MESSAGE_CONTROL3(ServiceWorkerMsg_StartWorker, 67 int /* embedded_worker_id */, 68 int64 /* service_worker_version_id */, 69 GURL /* script_url */) 70 71 // Browser -> Renderer message to terminate the embedded worker. 72 IPC_MESSAGE_CONTROL1(ServiceWorkerMsg_TerminateWorker, 73 int /* embedded_worker_id */) 74