| 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 #ifndef CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_DISPATCHER_HOST_H_ |
| 6 #define CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_DISPATCHER_HOST_H_ | 6 #define CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_DISPATCHER_HOST_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <list> | 10 #include <list> |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 int thread_id, | 111 int thread_id, |
| 112 int request_id, | 112 int request_id, |
| 113 CacheStorageError error, | 113 CacheStorageError error, |
| 114 std::unique_ptr<ServiceWorkerResponse> response, | 114 std::unique_ptr<ServiceWorkerResponse> response, |
| 115 std::unique_ptr<storage::BlobDataHandle> blob_data_handle); | 115 std::unique_ptr<storage::BlobDataHandle> blob_data_handle); |
| 116 | 116 |
| 117 // Cache callbacks. | 117 // Cache callbacks. |
| 118 void OnCacheMatchCallback( | 118 void OnCacheMatchCallback( |
| 119 int thread_id, | 119 int thread_id, |
| 120 int request_id, | 120 int request_id, |
| 121 scoped_refptr<CacheStorageCache> cache, | 121 CacheID cache_id, |
| 122 CacheStorageError error, | 122 CacheStorageError error, |
| 123 std::unique_ptr<ServiceWorkerResponse> response, | 123 std::unique_ptr<ServiceWorkerResponse> response, |
| 124 std::unique_ptr<storage::BlobDataHandle> blob_data_handle); | 124 std::unique_ptr<storage::BlobDataHandle> blob_data_handle); |
| 125 void OnCacheMatchAllCallbackAdapter( | 125 void OnCacheMatchAllCallbackAdapter( |
| 126 int thread_id, | 126 int thread_id, |
| 127 int request_id, | 127 int request_id, |
| 128 scoped_refptr<CacheStorageCache> cache, | 128 CacheID cache_id, |
| 129 CacheStorageError error, | 129 CacheStorageError error, |
| 130 std::unique_ptr<ServiceWorkerResponse> response, | 130 std::unique_ptr<ServiceWorkerResponse> response, |
| 131 std::unique_ptr<storage::BlobDataHandle> blob_data_handle); | 131 std::unique_ptr<storage::BlobDataHandle> blob_data_handle); |
| 132 void OnCacheMatchAllCallback( | 132 void OnCacheMatchAllCallback( |
| 133 int thread_id, | 133 int thread_id, |
| 134 int request_id, | 134 int request_id, |
| 135 scoped_refptr<CacheStorageCache> cache, | 135 CacheID cache_id, |
| 136 CacheStorageError error, | 136 CacheStorageError error, |
| 137 std::unique_ptr<std::vector<ServiceWorkerResponse>> responses, | 137 std::unique_ptr<std::vector<ServiceWorkerResponse>> responses, |
| 138 std::unique_ptr<CacheStorageCache::BlobDataHandles> blob_data_handles); | 138 std::unique_ptr<CacheStorageCache::BlobDataHandles> blob_data_handles); |
| 139 void OnCacheMatchAll(int thread_id, | 139 void OnCacheMatchAll(int thread_id, |
| 140 int request_id, | 140 int request_id, |
| 141 int cache_id, | 141 int cache_id, |
| 142 const ServiceWorkerFetchRequest& request, | 142 const ServiceWorkerFetchRequest& request, |
| 143 const CacheStorageCacheQueryParams& match_params); | 143 const CacheStorageCacheQueryParams& match_params); |
| 144 void OnCacheKeysCallback( | 144 void OnCacheKeysCallback( |
| 145 int thread_id, | 145 int thread_id, |
| 146 int request_id, | 146 int request_id, |
| 147 scoped_refptr<CacheStorageCache> cache, | 147 CacheID cache_id, |
| 148 CacheStorageError error, | 148 CacheStorageError error, |
| 149 std::unique_ptr<CacheStorageCache::Requests> requests); | 149 std::unique_ptr<CacheStorageCache::Requests> requests); |
| 150 void OnCacheBatchCallback(int thread_id, | 150 void OnCacheBatchCallback(int thread_id, |
| 151 int request_id, | 151 int request_id, |
| 152 scoped_refptr<CacheStorageCache> cache, | 152 CacheID cache_id, |
| 153 CacheStorageError error); | 153 CacheStorageError error); |
| 154 | 154 |
| 155 // Hangs onto a scoped_refptr for the cache if it isn't already doing so. | 155 // Hangs onto a scoped_refptr to |cache|. Returns a unique cache_id. Call |
| 156 // Returns a unique cache_id. Call DropCacheReference when the client is done | 156 // DropCacheReference when the reference is no longer needed. |
| 157 // with this cache. | |
| 158 CacheID StoreCacheReference(scoped_refptr<CacheStorageCache> cache); | 157 CacheID StoreCacheReference(scoped_refptr<CacheStorageCache> cache); |
| 159 void DropCacheReference(CacheID cache_id); | 158 void DropCacheReference(CacheID cache_id); |
| 160 | 159 |
| 161 // Stores blob handles while waiting for acknowledgement of receipt from the | 160 // Stores blob handles while waiting for acknowledgement of receipt from the |
| 162 // renderer. | 161 // renderer. |
| 163 void StoreBlobDataHandle(const storage::BlobDataHandle& blob_data_handle); | 162 void StoreBlobDataHandle(const storage::BlobDataHandle& blob_data_handle); |
| 164 void DropBlobDataHandle(const std::string& uuid); | 163 void DropBlobDataHandle(const std::string& uuid); |
| 165 | 164 |
| 166 IDToCacheMap id_to_cache_map_; | 165 IDToCacheMap id_to_cache_map_; |
| 167 CacheID next_cache_id_ = 0; | 166 CacheID next_cache_id_ = 0; |
| 168 | 167 |
| 169 UUIDToBlobDataHandleList blob_handle_store_; | 168 UUIDToBlobDataHandleList blob_handle_store_; |
| 170 | 169 |
| 171 scoped_refptr<CacheStorageContextImpl> context_; | 170 scoped_refptr<CacheStorageContextImpl> context_; |
| 172 | 171 |
| 173 DISALLOW_COPY_AND_ASSIGN(CacheStorageDispatcherHost); | 172 DISALLOW_COPY_AND_ASSIGN(CacheStorageDispatcherHost); |
| 174 }; | 173 }; |
| 175 | 174 |
| 176 } // namespace content | 175 } // namespace content |
| 177 | 176 |
| 178 #endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_DISPATCHER_HOST_H_ | 177 #endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_DISPATCHER_HOST_H_ |
| OLD | NEW |