| 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_SERVICE_WORKER_SERVICE_WORKER_CACHE_WRITER_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_WRITER_H_ |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_WRITER_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_WRITER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <set> | 12 #include <set> |
| 13 | 13 |
| 14 #include "base/callback.h" | 14 #include "base/callback.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
| 17 #include "net/base/io_buffer.h" | 17 #include "net/base/io_buffer.h" |
| 18 #include "net/base/net_errors.h" | 18 #include "net/base/net_errors.h" |
| 19 | 19 |
| 20 namespace content { | 20 namespace content { |
| 21 | 21 |
| 22 struct HttpResponseInfoIOBuffer; | 22 struct HttpResponseInfoIOBuffer; |
| 23 class ServiceWorkerCacheWriterCore; | |
| 24 class ServiceWorkerResponseReader; | 23 class ServiceWorkerResponseReader; |
| 25 class ServiceWorkerResponseWriter; | 24 class ServiceWorkerResponseWriter; |
| 26 class ServiceWorkerStorage; | |
| 27 | 25 |
| 28 // This class is responsible for possibly updating the ServiceWorker script | 26 // This class is responsible for possibly updating the ServiceWorker script |
| 29 // cache for an installed ServiceWorker main script. If there is no existing | 27 // cache for an installed ServiceWorker main script. If there is no existing |
| 30 // cache entry, this class always writes supplied data back to the cache; if | 28 // cache entry, this class always writes supplied data back to the cache; if |
| 31 // there is an existing cache entry, this class only writes supplied data back | 29 // there is an existing cache entry, this class only writes supplied data back |
| 32 // if there is a cache mismatch. | 30 // if there is a cache mismatch. |
| 33 // | 31 // |
| 34 // Note that writes done by this class cannot be "short" - ie, if they succeed, | 32 // Note that writes done by this class cannot be "short" - ie, if they succeed, |
| 35 // they always write all the supplied data back. Therefore completions are | 33 // they always write all the supplied data back. Therefore completions are |
| 36 // signalled with net::Error without a count of bytes written. | 34 // signalled with net::Error without a count of bytes written. |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 | 212 |
| 215 std::unique_ptr<ServiceWorkerResponseReader> compare_reader_; | 213 std::unique_ptr<ServiceWorkerResponseReader> compare_reader_; |
| 216 std::unique_ptr<ServiceWorkerResponseReader> copy_reader_; | 214 std::unique_ptr<ServiceWorkerResponseReader> copy_reader_; |
| 217 std::unique_ptr<ServiceWorkerResponseWriter> writer_; | 215 std::unique_ptr<ServiceWorkerResponseWriter> writer_; |
| 218 base::WeakPtrFactory<ServiceWorkerCacheWriter> weak_factory_; | 216 base::WeakPtrFactory<ServiceWorkerCacheWriter> weak_factory_; |
| 219 }; | 217 }; |
| 220 | 218 |
| 221 } // namespace content | 219 } // namespace content |
| 222 | 220 |
| 223 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_WRITER_H_ | 221 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CACHE_WRITER_H_ |
| OLD | NEW |