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