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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 int request_id, | 78 int request_id, |
79 int cache_id, | 79 int cache_id, |
80 const std::vector<CacheStorageBatchOperation>& operations); | 80 const std::vector<CacheStorageBatchOperation>& operations); |
81 void OnCacheClosed(int cache_id); | 81 void OnCacheClosed(int cache_id); |
82 void OnBlobDataHandled(const std::string& uuid); | 82 void OnBlobDataHandled(const std::string& uuid); |
83 | 83 |
84 // CacheStorageManager callbacks | 84 // CacheStorageManager callbacks |
85 void OnCacheStorageHasCallback(int thread_id, | 85 void OnCacheStorageHasCallback(int thread_id, |
86 int request_id, | 86 int request_id, |
87 bool has_cache, | 87 bool has_cache, |
88 CacheStorage::CacheStorageError error); | 88 CacheStorageError error); |
89 void OnCacheStorageOpenCallback(int thread_id, | 89 void OnCacheStorageOpenCallback(int thread_id, |
90 int request_id, | 90 int request_id, |
91 const scoped_refptr<CacheStorageCache>& cache, | 91 const scoped_refptr<CacheStorageCache>& cache, |
92 CacheStorage::CacheStorageError error); | 92 CacheStorageError error); |
93 void OnCacheStorageDeleteCallback(int thread_id, | 93 void OnCacheStorageDeleteCallback(int thread_id, |
94 int request_id, | 94 int request_id, |
95 bool deleted, | 95 bool deleted, |
96 CacheStorage::CacheStorageError error); | 96 CacheStorageError error); |
97 void OnCacheStorageKeysCallback(int thread_id, | 97 void OnCacheStorageKeysCallback(int thread_id, |
98 int request_id, | 98 int request_id, |
99 const std::vector<std::string>& strings, | 99 const std::vector<std::string>& strings, |
100 CacheStorage::CacheStorageError error); | 100 CacheStorageError error); |
101 void OnCacheStorageMatchCallback( | 101 void OnCacheStorageMatchCallback( |
102 int thread_id, | 102 int thread_id, |
103 int request_id, | 103 int request_id, |
104 CacheStorageCache::ErrorType error, | 104 CacheStorageError error, |
105 scoped_ptr<ServiceWorkerResponse> response, | 105 scoped_ptr<ServiceWorkerResponse> response, |
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 CacheStorageCache::ErrorType 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 OnCacheMatchAll(int thread_id, | 116 void OnCacheMatchAll(int thread_id, |
117 int request_id, | 117 int request_id, |
118 int cache_id, | 118 int cache_id, |
119 const ServiceWorkerFetchRequest& request, | 119 const ServiceWorkerFetchRequest& request, |
120 const CacheStorageCacheQueryParams& match_params); | 120 const CacheStorageCacheQueryParams& match_params); |
121 void OnCacheKeysCallback(int thread_id, | 121 void OnCacheKeysCallback(int thread_id, |
122 int request_id, | 122 int request_id, |
123 const scoped_refptr<CacheStorageCache>& cache, | 123 const scoped_refptr<CacheStorageCache>& cache, |
124 CacheStorageCache::ErrorType error, | 124 CacheStorageError error, |
125 scoped_ptr<CacheStorageCache::Requests> requests); | 125 scoped_ptr<CacheStorageCache::Requests> requests); |
126 void OnCacheBatchCallback(int thread_id, | 126 void OnCacheBatchCallback(int thread_id, |
127 int request_id, | 127 int request_id, |
128 const scoped_refptr<CacheStorageCache>& cache, | 128 const scoped_refptr<CacheStorageCache>& cache, |
129 CacheStorageCache::ErrorType error); | 129 CacheStorageError error); |
130 | 130 |
131 // Hangs onto a scoped_refptr for the cache if it isn't already doing so. | 131 // 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 | 132 // Returns a unique cache_id. Call DropCacheReference when the client is done |
133 // with this cache. | 133 // with this cache. |
134 CacheID StoreCacheReference(const scoped_refptr<CacheStorageCache>& cache); | 134 CacheID StoreCacheReference(const scoped_refptr<CacheStorageCache>& cache); |
135 void DropCacheReference(CacheID cache_id); | 135 void DropCacheReference(CacheID cache_id); |
136 | 136 |
137 // Stores blob handles while waiting for acknowledgement of receipt from the | 137 // Stores blob handles while waiting for acknowledgement of receipt from the |
138 // renderer. | 138 // renderer. |
139 void StoreBlobDataHandle( | 139 void StoreBlobDataHandle( |
140 scoped_ptr<storage::BlobDataHandle> blob_data_handle); | 140 scoped_ptr<storage::BlobDataHandle> blob_data_handle); |
141 void DropBlobDataHandle(std::string uuid); | 141 void DropBlobDataHandle(std::string uuid); |
142 | 142 |
143 IDToCacheMap id_to_cache_map_; | 143 IDToCacheMap id_to_cache_map_; |
144 CacheID next_cache_id_ = 0; | 144 CacheID next_cache_id_ = 0; |
145 | 145 |
146 UUIDToBlobDataHandleList blob_handle_store_; | 146 UUIDToBlobDataHandleList blob_handle_store_; |
147 | 147 |
148 scoped_refptr<CacheStorageContextImpl> context_; | 148 scoped_refptr<CacheStorageContextImpl> context_; |
149 | 149 |
150 DISALLOW_COPY_AND_ASSIGN(CacheStorageDispatcherHost); | 150 DISALLOW_COPY_AND_ASSIGN(CacheStorageDispatcherHost); |
151 }; | 151 }; |
152 | 152 |
153 } // namespace content | 153 } // namespace content |
154 | 154 |
155 #endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_DISPATCHER_HOST_H_ | 155 #endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_DISPATCHER_HOST_H_ |
OLD | NEW |