Chromium Code Reviews| 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" | |
|
jkarlin
2014/08/12 19:22:15
I'll remove this
jkarlin
2014/08/13 00:14:00
Done.
| |
| 11 #include "net/url_request/url_request_context.h" | |
| 12 #include "webkit/browser/blob/blob_storage_context.h" | |
| 10 | 13 |
| 11 namespace content { | 14 namespace content { |
| 12 | 15 |
| 13 // static | 16 // static |
| 14 scoped_ptr<ServiceWorkerCache> ServiceWorkerCache::CreateMemoryCache( | 17 scoped_ptr<ServiceWorkerCache> ServiceWorkerCache::CreateMemoryCache( |
| 15 const std::string& name) { | 18 const std::string& name, |
| 16 return make_scoped_ptr(new ServiceWorkerCache(base::FilePath(), name)); | 19 net::URLRequestContext* request_context, |
| 20 base::WeakPtr<webkit_blob::BlobStorageContext> blob_context) { | |
| 21 return make_scoped_ptr(new ServiceWorkerCache( | |
| 22 base::FilePath(), name, request_context, blob_context)); | |
| 17 } | 23 } |
| 18 | 24 |
| 19 // static | 25 // static |
| 20 scoped_ptr<ServiceWorkerCache> ServiceWorkerCache::CreatePersistentCache( | 26 scoped_ptr<ServiceWorkerCache> ServiceWorkerCache::CreatePersistentCache( |
| 21 const base::FilePath& path, | 27 const base::FilePath& path, |
| 22 const std::string& name) { | 28 const std::string& name, |
| 23 return make_scoped_ptr(new ServiceWorkerCache(path, name)); | 29 net::URLRequestContext* request_context, |
| 30 base::WeakPtr<webkit_blob::BlobStorageContext> blob_context) { | |
| 31 return make_scoped_ptr( | |
| 32 new ServiceWorkerCache(path, name, request_context, blob_context)); | |
| 24 } | 33 } |
| 25 | 34 |
| 26 void ServiceWorkerCache::CreateBackend( | 35 void ServiceWorkerCache::CreateBackend( |
| 27 const base::Callback<void(bool)>& callback) { | 36 const base::Callback<void(bool)>& callback) { |
| 28 callback.Run(true); | 37 callback.Run(true); |
| 29 } | 38 } |
| 30 | 39 |
| 31 ServiceWorkerCache::ServiceWorkerCache(const base::FilePath& path, | 40 ServiceWorkerCache::ServiceWorkerCache( |
| 32 const std::string& name) | 41 const base::FilePath& path, |
| 33 : path_(path), name_(name), id_(0), weak_ptr_factory_(this) { | 42 const std::string& name, |
| 43 net::URLRequestContext* request_context, | |
| 44 base::WeakPtr<webkit_blob::BlobStorageContext> blob_context) | |
| 45 : path_(path), | |
| 46 name_(name), | |
| 47 request_context_(request_context), | |
| 48 blob_storage_context_(blob_context), | |
| 49 id_(0), | |
| 50 weak_ptr_factory_(this) { | |
| 34 } | 51 } |
| 35 | 52 |
| 36 ServiceWorkerCache::~ServiceWorkerCache() { | 53 ServiceWorkerCache::~ServiceWorkerCache() { |
| 37 } | 54 } |
| 38 | 55 |
| 39 } // namespace content | 56 } // namespace content |
| OLD | NEW |