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_SERVICE_WORKER_SERVICE_WORKER_CACHE_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_H_ |
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 ServiceWorkerCache(const base::FilePath& path, | 99 ServiceWorkerCache(const base::FilePath& path, |
100 net::URLRequestContext* request_context, | 100 net::URLRequestContext* request_context, |
101 base::WeakPtr<storage::BlobStorageContext> blob_context); | 101 base::WeakPtr<storage::BlobStorageContext> blob_context); |
102 | 102 |
103 // Operations in progress will complete after the cache is deleted but pending | 103 // Operations in progress will complete after the cache is deleted but pending |
104 // operations (those operations waiting for init to finish) won't. | 104 // operations (those operations waiting for init to finish) won't. |
105 virtual ~ServiceWorkerCache(); | 105 virtual ~ServiceWorkerCache(); |
106 | 106 |
107 // Put callbacks. | 107 // Put callbacks. |
108 static void PutImpl(scoped_ptr<PutContext> put_context); | 108 static void PutImpl(scoped_ptr<PutContext> put_context); |
| 109 static void PutDidDoomEntry(scoped_ptr<PutContext> put_context, int doom_rv); |
109 static void PutDidCreateEntry(scoped_ptr<PutContext> put_context, int rv); | 110 static void PutDidCreateEntry(scoped_ptr<PutContext> put_context, int rv); |
110 static void PutDidWriteHeaders(scoped_ptr<PutContext> put_context, | 111 static void PutDidWriteHeaders(scoped_ptr<PutContext> put_context, |
111 int expected_bytes, | 112 int expected_bytes, |
112 int rv); | 113 int rv); |
113 static void PutDidWriteBlobToCache(scoped_ptr<PutContext> put_context, | 114 static void PutDidWriteBlobToCache(scoped_ptr<PutContext> put_context, |
114 scoped_ptr<BlobReader> blob_reader, | 115 scoped_ptr<BlobReader> blob_reader, |
115 bool success); | 116 bool success); |
116 | 117 |
117 // Static callbacks for the Keys function. | 118 // Static callbacks for the Keys function. |
118 static void KeysDidOpenNextEntry(scoped_ptr<KeysContext> keys_context, | 119 static void KeysDidOpenNextEntry(scoped_ptr<KeysContext> keys_context, |
(...skipping 22 matching lines...) Expand all Loading... |
141 std::vector<base::Closure> init_callbacks_; | 142 std::vector<base::Closure> init_callbacks_; |
142 | 143 |
143 base::WeakPtrFactory<ServiceWorkerCache> weak_ptr_factory_; | 144 base::WeakPtrFactory<ServiceWorkerCache> weak_ptr_factory_; |
144 | 145 |
145 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerCache); | 146 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerCache); |
146 }; | 147 }; |
147 | 148 |
148 } // namespace content | 149 } // namespace content |
149 | 150 |
150 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_H_ | 151 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_H_ |
OLD | NEW |