OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_CACHE_H_ | 5 #ifndef CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_ |
6 #define CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_ | 6 #define CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_ |
7 | 7 |
8 #include <list> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "content/common/cache_storage/cache_storage_types.h" | 14 #include "content/common/cache_storage/cache_storage_types.h" |
15 #include "content/common/service_worker/service_worker_types.h" | 15 #include "content/common/service_worker/service_worker_types.h" |
16 #include "net/base/completion_callback.h" | 16 #include "net/base/completion_callback.h" |
17 #include "net/disk_cache/disk_cache.h" | 17 #include "net/disk_cache/disk_cache.h" |
18 | 18 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 net::URLRequestContext* request_context, | 129 net::URLRequestContext* request_context, |
130 const scoped_refptr<storage::QuotaManagerProxy>& quota_manager_proxy, | 130 const scoped_refptr<storage::QuotaManagerProxy>& quota_manager_proxy, |
131 base::WeakPtr<storage::BlobStorageContext> blob_context); | 131 base::WeakPtr<storage::BlobStorageContext> blob_context); |
132 | 132 |
133 // Async operations in progress will cancel and not run their callbacks. | 133 // Async operations in progress will cancel and not run their callbacks. |
134 virtual ~CacheStorageCache(); | 134 virtual ~CacheStorageCache(); |
135 | 135 |
136 // Match callbacks | 136 // Match callbacks |
137 void MatchImpl(scoped_ptr<ServiceWorkerFetchRequest> request, | 137 void MatchImpl(scoped_ptr<ServiceWorkerFetchRequest> request, |
138 const ResponseCallback& callback); | 138 const ResponseCallback& callback); |
139 void MatchDidOpenEntry(scoped_ptr<MatchContext> match_context, int rv); | 139 void MatchDidOpenEntry(scoped_ptr<disk_cache::Entry*> entry_ptr, |
| 140 scoped_ptr<MatchContext> match_context, |
| 141 int rv); |
140 void MatchDidReadMetadata(scoped_ptr<MatchContext> match_context, | 142 void MatchDidReadMetadata(scoped_ptr<MatchContext> match_context, |
141 scoped_ptr<CacheMetadata> headers); | 143 scoped_ptr<CacheMetadata> headers); |
142 void MatchDidReadResponseBodyData(scoped_ptr<MatchContext> match_context, | |
143 int rv); | |
144 void MatchDoneWithBody(scoped_ptr<MatchContext> match_context); | |
145 | 144 |
146 // Put callbacks. | 145 // Put callbacks. |
147 void PutImpl(scoped_ptr<PutContext> put_context); | 146 void PutImpl(scoped_ptr<PutContext> put_context); |
148 void PutDidDelete(scoped_ptr<PutContext> put_context, ErrorType delete_error); | 147 void PutDidDelete(scoped_ptr<PutContext> put_context, ErrorType delete_error); |
149 void PutDidCreateEntry(scoped_ptr<PutContext> put_context, int rv); | 148 void PutDidCreateEntry(scoped_ptr<disk_cache::Entry*> entry_ptr, |
| 149 scoped_ptr<PutContext> put_context, |
| 150 int rv); |
150 void PutDidWriteHeaders(scoped_ptr<PutContext> put_context, | 151 void PutDidWriteHeaders(scoped_ptr<PutContext> put_context, |
151 int expected_bytes, | 152 int expected_bytes, |
152 int rv); | 153 int rv); |
153 void PutDidWriteBlobToCache(scoped_ptr<PutContext> put_context, | 154 void PutDidWriteBlobToCache(scoped_ptr<PutContext> put_context, |
154 scoped_ptr<BlobReader> blob_reader, | 155 scoped_ptr<BlobReader> blob_reader, |
155 disk_cache::ScopedEntryPtr entry, | 156 disk_cache::ScopedEntryPtr entry, |
156 bool success); | 157 bool success); |
157 | 158 |
158 // Delete callbacks | 159 // Delete callbacks |
159 void DeleteImpl(scoped_ptr<ServiceWorkerFetchRequest> request, | 160 void DeleteImpl(scoped_ptr<ServiceWorkerFetchRequest> request, |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 bool memory_only_; | 215 bool memory_only_; |
215 | 216 |
216 base::WeakPtrFactory<CacheStorageCache> weak_ptr_factory_; | 217 base::WeakPtrFactory<CacheStorageCache> weak_ptr_factory_; |
217 | 218 |
218 DISALLOW_COPY_AND_ASSIGN(CacheStorageCache); | 219 DISALLOW_COPY_AND_ASSIGN(CacheStorageCache); |
219 }; | 220 }; |
220 | 221 |
221 } // namespace content | 222 } // namespace content |
222 | 223 |
223 #endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_ | 224 #endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_ |
OLD | NEW |