| 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 #include "content/browser/service_worker/service_worker_cache.h" | 5 #include "content/browser/service_worker/service_worker_cache.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "content/browser/fileapi/chrome_blob_storage_context.h" |
| 11 #include "net/url_request/url_request_context.h" |
| 10 | 12 |
| 11 namespace content { | 13 namespace content { |
| 12 | 14 |
| 13 // static | 15 // static |
| 14 ServiceWorkerCache* ServiceWorkerCache::CreateMemoryCache( | 16 ServiceWorkerCache* ServiceWorkerCache::CreateMemoryCache( |
| 15 const std::string& name) { | 17 const std::string& name, |
| 16 return new ServiceWorkerCache(base::FilePath(), name); | 18 net::URLRequestContext* request_context, |
| 19 ChromeBlobStorageContext* blob_context) { |
| 20 return new ServiceWorkerCache( |
| 21 base::FilePath(), name, request_context, blob_context); |
| 17 } | 22 } |
| 18 | 23 |
| 19 // static | 24 // static |
| 20 ServiceWorkerCache* ServiceWorkerCache::CreatePersistentCache( | 25 ServiceWorkerCache* ServiceWorkerCache::CreatePersistentCache( |
| 21 const base::FilePath& path, | 26 const base::FilePath& path, |
| 22 const std::string& name) { | 27 const std::string& name, |
| 23 return new ServiceWorkerCache(path, name); | 28 net::URLRequestContext* request_context, |
| 29 ChromeBlobStorageContext* blob_context) { |
| 30 return new ServiceWorkerCache(path, name, request_context, blob_context); |
| 24 } | 31 } |
| 25 | 32 |
| 26 void ServiceWorkerCache::CreateBackend( | 33 void ServiceWorkerCache::CreateBackend( |
| 27 const base::Callback<void(bool)>& callback) { | 34 const base::Callback<void(bool)>& callback) { |
| 28 callback.Run(true); | 35 callback.Run(true); |
| 29 } | 36 } |
| 30 | 37 |
| 31 ServiceWorkerCache::ServiceWorkerCache(const base::FilePath& path, | 38 ServiceWorkerCache::ServiceWorkerCache(const base::FilePath& path, |
| 32 const std::string& name) | 39 const std::string& name, |
| 33 : path_(path), name_(name), id_(0) { | 40 net::URLRequestContext* request_context, |
| 41 ChromeBlobStorageContext* blob_context) |
| 42 : path_(path), |
| 43 name_(name), |
| 44 request_context_(request_context), |
| 45 blob_storage_context_(blob_context), |
| 46 id_(0) { |
| 34 } | 47 } |
| 35 | 48 |
| 36 ServiceWorkerCache::~ServiceWorkerCache() { | 49 ServiceWorkerCache::~ServiceWorkerCache() { |
| 37 } | 50 } |
| 38 | 51 |
| 39 } // namespace content | 52 } // namespace content |
| OLD | NEW |