Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(618)

Side by Side Diff: content/browser/service_worker/service_worker_cache.cc

Issue 459003002: Plumbs URLRequestContext and CacheBlobStorageContext down to cache. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cache1
Patch Set: Rebase Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 scoped_ptr<ServiceWorkerCache> ServiceWorkerCache::CreateMemoryCache( 16 scoped_ptr<ServiceWorkerCache> ServiceWorkerCache::CreateMemoryCache(
15 const std::string& name) { 17 const std::string& name,
16 return make_scoped_ptr(new ServiceWorkerCache(base::FilePath(), name)); 18 net::URLRequestContext* request_context,
19 ChromeBlobStorageContext* blob_context) {
20 return make_scoped_ptr(new ServiceWorkerCache(
21 base::FilePath(), name, request_context, blob_context));
17 } 22 }
18 23
19 // static 24 // static
20 scoped_ptr<ServiceWorkerCache> ServiceWorkerCache::CreatePersistentCache( 25 scoped_ptr<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 make_scoped_ptr(new ServiceWorkerCache(path, name)); 28 net::URLRequestContext* request_context,
29 ChromeBlobStorageContext* blob_context) {
30 return make_scoped_ptr(
31 new ServiceWorkerCache(path, name, request_context, blob_context));
24 } 32 }
25 33
26 void ServiceWorkerCache::CreateBackend( 34 void ServiceWorkerCache::CreateBackend(
27 const base::Callback<void(bool)>& callback) { 35 const base::Callback<void(bool)>& callback) {
28 callback.Run(true); 36 callback.Run(true);
29 } 37 }
30 38
31 ServiceWorkerCache::ServiceWorkerCache(const base::FilePath& path, 39 ServiceWorkerCache::ServiceWorkerCache(const base::FilePath& path,
32 const std::string& name) 40 const std::string& name,
33 : path_(path), name_(name), id_(0), weak_ptr_factory_(this) { 41 net::URLRequestContext* request_context,
42 ChromeBlobStorageContext* blob_context)
43 : path_(path),
44 name_(name),
45 request_context_(request_context),
46 blob_storage_context_(blob_context),
47 id_(0),
48 weak_ptr_factory_(this) {
34 } 49 }
35 50
36 ServiceWorkerCache::~ServiceWorkerCache() { 51 ServiceWorkerCache::~ServiceWorkerCache() {
37 } 52 }
38 53
39 } // namespace content 54 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698