OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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 <string> |
| 8 #include <vector> |
| 9 |
| 10 #include "base/strings/string16.h" |
| 11 #include "content/common/service_worker/service_worker_types.h" |
| 12 #include "ipc/ipc_message_macros.h" |
| 13 #include "ipc/ipc_param_traits.h" |
| 14 #include "third_party/WebKit/public/platform/WebServiceWorkerCacheError.h" |
| 15 #include "url/gurl.h" |
| 16 |
| 17 #undef IPC_MESSAGE_EXPORT |
| 18 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
| 19 |
| 20 #define IPC_MESSAGE_START CacheStorageMsgStart |
| 21 |
| 22 // TODO(jsbell): This depends on traits for content::ServiceWorkerResponse |
| 23 // which are defined in service_worker_messages.h - correct this implicit |
| 24 // cross-dependency. |
| 25 |
| 26 IPC_STRUCT_TRAITS_BEGIN(content::ServiceWorkerCacheQueryParams) |
| 27 IPC_STRUCT_TRAITS_MEMBER(ignore_search) |
| 28 IPC_STRUCT_TRAITS_MEMBER(ignore_method) |
| 29 IPC_STRUCT_TRAITS_MEMBER(ignore_vary) |
| 30 IPC_STRUCT_TRAITS_MEMBER(cache_name) |
| 31 IPC_STRUCT_TRAITS_END() |
| 32 |
| 33 IPC_ENUM_TRAITS_MAX_VALUE(content::ServiceWorkerCacheOperationType, |
| 34 content::SERVICE_WORKER_CACHE_OPERATION_TYPE_LAST) |
| 35 |
| 36 IPC_STRUCT_TRAITS_BEGIN(content::ServiceWorkerBatchOperation) |
| 37 IPC_STRUCT_TRAITS_MEMBER(operation_type) |
| 38 IPC_STRUCT_TRAITS_MEMBER(request) |
| 39 IPC_STRUCT_TRAITS_MEMBER(response) |
| 40 IPC_STRUCT_TRAITS_MEMBER(match_params) |
| 41 IPC_STRUCT_TRAITS_END() |
| 42 |
| 43 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebServiceWorkerCacheError, |
| 44 blink::WebServiceWorkerCacheErrorLast) |
| 45 |
| 46 //--------------------------------------------------------------------------- |
| 47 // Messages sent from the child process to the browser. |
| 48 |
| 49 // CacheStorage operations in the browser. |
| 50 IPC_MESSAGE_CONTROL4(ServiceWorkerHostMsg_CacheStorageHas, |
| 51 int /* thread_id */, |
| 52 int /* request_id */, |
| 53 GURL /* origin */, |
| 54 base::string16 /* fetch_store_name */) |
| 55 |
| 56 IPC_MESSAGE_CONTROL4(ServiceWorkerHostMsg_CacheStorageOpen, |
| 57 int /* thread_id */, |
| 58 int /* request_id */, |
| 59 GURL /* origin */, |
| 60 base::string16 /* fetch_store_name */) |
| 61 |
| 62 IPC_MESSAGE_CONTROL4(ServiceWorkerHostMsg_CacheStorageDelete, |
| 63 int /* thread_id */, |
| 64 int /* request_id */, |
| 65 GURL /* origin */, |
| 66 base::string16 /* fetch_store_name */) |
| 67 |
| 68 IPC_MESSAGE_CONTROL3(ServiceWorkerHostMsg_CacheStorageKeys, |
| 69 int /* thread_id */, |
| 70 int /* request_id */, |
| 71 GURL /* origin */) |
| 72 |
| 73 IPC_MESSAGE_CONTROL5(ServiceWorkerHostMsg_CacheStorageMatch, |
| 74 int /* thread_id */, |
| 75 int /* request_id */, |
| 76 GURL /* origin */, |
| 77 content::ServiceWorkerFetchRequest, |
| 78 content::ServiceWorkerCacheQueryParams) |
| 79 |
| 80 // Cache operations in the browser. |
| 81 IPC_MESSAGE_CONTROL5(ServiceWorkerHostMsg_CacheMatch, |
| 82 int /* thread_id */, |
| 83 int /* request_id */, |
| 84 int /* cache_id */, |
| 85 content::ServiceWorkerFetchRequest, |
| 86 content::ServiceWorkerCacheQueryParams) |
| 87 |
| 88 IPC_MESSAGE_CONTROL5(ServiceWorkerHostMsg_CacheMatchAll, |
| 89 int /* thread_id */, |
| 90 int /* request_id */, |
| 91 int /* cache_id */, |
| 92 content::ServiceWorkerFetchRequest, |
| 93 content::ServiceWorkerCacheQueryParams) |
| 94 |
| 95 IPC_MESSAGE_CONTROL5(ServiceWorkerHostMsg_CacheKeys, |
| 96 int /* thread_id */, |
| 97 int /* request_id */, |
| 98 int /* cache_id */, |
| 99 content::ServiceWorkerFetchRequest, |
| 100 content::ServiceWorkerCacheQueryParams) |
| 101 |
| 102 IPC_MESSAGE_CONTROL4(ServiceWorkerHostMsg_CacheBatch, |
| 103 int /* thread_id */, |
| 104 int /* request_id */, |
| 105 int /* cache_id */, |
| 106 std::vector<content::ServiceWorkerBatchOperation>) |
| 107 |
| 108 IPC_MESSAGE_CONTROL1(ServiceWorkerHostMsg_CacheClosed, |
| 109 int /* cache_id */) |
| 110 |
| 111 IPC_MESSAGE_CONTROL1(ServiceWorkerHostMsg_BlobDataHandled, |
| 112 std::string /* uuid */) |
| 113 |
| 114 //--------------------------------------------------------------------------- |
| 115 // Messages sent from the browser to the child process. |
| 116 // |
| 117 // All such messages must includes thread_id as the first int; it is read off |
| 118 // by CacheStorageMessageFilter::GetWorkerThreadIdForMessage to route delivery |
| 119 // to the appropriate thread. |
| 120 |
| 121 // Sent at successful completion of CacheStorage operations. |
| 122 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_CacheStorageHasSuccess, |
| 123 int /* thread_id */, |
| 124 int /* request_id */) |
| 125 IPC_MESSAGE_CONTROL3(ServiceWorkerMsg_CacheStorageOpenSuccess, |
| 126 int /* thread_id */, |
| 127 int /* request_id */, |
| 128 int /* fetch_store_id */) |
| 129 IPC_MESSAGE_CONTROL2(ServiceWorkerMsg_CacheStorageDeleteSuccess, |
| 130 int /* thread_id */, |
| 131 int /* request_id */) |
| 132 IPC_MESSAGE_CONTROL3(ServiceWorkerMsg_CacheStorageKeysSuccess, |
| 133 int /* thread_id */, |
| 134 int /* request_id */, |
| 135 std::vector<base::string16> /* keys */) |
| 136 IPC_MESSAGE_CONTROL3(ServiceWorkerMsg_CacheStorageMatchSuccess, |
| 137 int /* thread_id */, |
| 138 int /* request_id */, |
| 139 content::ServiceWorkerResponse) |
| 140 |
| 141 // Sent at erroneous completion of CacheStorage operations. |
| 142 IPC_MESSAGE_CONTROL3(ServiceWorkerMsg_CacheStorageHasError, |
| 143 int /* thread_id */, |
| 144 int /* request_id */, |
| 145 blink::WebServiceWorkerCacheError /* reason */) |
| 146 IPC_MESSAGE_CONTROL3(ServiceWorkerMsg_CacheStorageOpenError, |
| 147 int /* thread_id */, |
| 148 int /* request_id */, |
| 149 blink::WebServiceWorkerCacheError /* reason */) |
| 150 IPC_MESSAGE_CONTROL3(ServiceWorkerMsg_CacheStorageDeleteError, |
| 151 int /* thread_id */, |
| 152 int /* request_id */, |
| 153 blink::WebServiceWorkerCacheError /* reason */) |
| 154 IPC_MESSAGE_CONTROL3(ServiceWorkerMsg_CacheStorageKeysError, |
| 155 int /* thread_id */, |
| 156 int /* request_id */, |
| 157 blink::WebServiceWorkerCacheError /* reason */) |
| 158 IPC_MESSAGE_CONTROL3(ServiceWorkerMsg_CacheStorageMatchError, |
| 159 int /* thread_id */, |
| 160 int /* request_id */, |
| 161 blink::WebServiceWorkerCacheError) |
| 162 |
| 163 // Sent at successful completion of Cache operations. |
| 164 IPC_MESSAGE_CONTROL3(ServiceWorkerMsg_CacheMatchSuccess, |
| 165 int /* thread_id */, |
| 166 int /* request_id */, |
| 167 content::ServiceWorkerResponse) |
| 168 IPC_MESSAGE_CONTROL3(ServiceWorkerMsg_CacheMatchAllSuccess, |
| 169 int /* thread_id */, |
| 170 int /* request_id */, |
| 171 std::vector<content::ServiceWorkerResponse>) |
| 172 IPC_MESSAGE_CONTROL3(ServiceWorkerMsg_CacheKeysSuccess, |
| 173 int /* thread_id */, |
| 174 int /* request_id */, |
| 175 std::vector<content::ServiceWorkerFetchRequest>) |
| 176 IPC_MESSAGE_CONTROL3(ServiceWorkerMsg_CacheBatchSuccess, |
| 177 int /* thread_id */, |
| 178 int /* request_id */, |
| 179 std::vector<content::ServiceWorkerResponse>) |
| 180 |
| 181 // Sent at erroneous completion of CacheStorage operations. |
| 182 IPC_MESSAGE_CONTROL3(ServiceWorkerMsg_CacheMatchError, |
| 183 int /* thread_id */, |
| 184 int /* request_id */, |
| 185 blink::WebServiceWorkerCacheError) |
| 186 IPC_MESSAGE_CONTROL3(ServiceWorkerMsg_CacheMatchAllError, |
| 187 int /* thread_id */, |
| 188 int /* request_id */, |
| 189 blink::WebServiceWorkerCacheError) |
| 190 IPC_MESSAGE_CONTROL3(ServiceWorkerMsg_CacheKeysError, |
| 191 int /* thread_id */, |
| 192 int /* request_id */, |
| 193 blink::WebServiceWorkerCacheError) |
| 194 IPC_MESSAGE_CONTROL3(ServiceWorkerMsg_CacheBatchError, |
| 195 int /* thread_id */, |
| 196 int /* request_id */, |
| 197 blink::WebServiceWorkerCacheError) |
OLD | NEW |