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