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

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

Issue 503823002: Creates CacheContext for ServiceWorkerCacheStorage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 "net/url_request/url_request_context.h" 10 #include "net/url_request/url_request_context.h"
11 #include "webkit/browser/blob/blob_storage_context.h" 11 #include "webkit/browser/blob/blob_storage_context.h"
12 12
13 namespace content { 13 namespace content {
14 14
15 // static 15 // static
16 scoped_ptr<ServiceWorkerCache> ServiceWorkerCache::CreateMemoryCache( 16 scoped_ptr<ServiceWorkerCache> ServiceWorkerCache::CreateMemoryCache(
17 const std::string& name,
18 net::URLRequestContext* request_context, 17 net::URLRequestContext* request_context,
19 base::WeakPtr<storage::BlobStorageContext> blob_context) { 18 base::WeakPtr<storage::BlobStorageContext> blob_context) {
20 return make_scoped_ptr(new ServiceWorkerCache( 19 return make_scoped_ptr(
21 base::FilePath(), name, request_context, blob_context)); 20 new ServiceWorkerCache(base::FilePath(), request_context, blob_context));
22 } 21 }
23 22
24 // static 23 // static
25 scoped_ptr<ServiceWorkerCache> ServiceWorkerCache::CreatePersistentCache( 24 scoped_ptr<ServiceWorkerCache> ServiceWorkerCache::CreatePersistentCache(
26 const base::FilePath& path, 25 const base::FilePath& path,
27 const std::string& name,
28 net::URLRequestContext* request_context, 26 net::URLRequestContext* request_context,
29 base::WeakPtr<storage::BlobStorageContext> blob_context) { 27 base::WeakPtr<storage::BlobStorageContext> blob_context) {
30 return make_scoped_ptr( 28 return make_scoped_ptr(
31 new ServiceWorkerCache(path, name, request_context, blob_context)); 29 new ServiceWorkerCache(path, request_context, blob_context));
32 } 30 }
33 31
34 void ServiceWorkerCache::CreateBackend( 32 void ServiceWorkerCache::CreateBackend(
35 const base::Callback<void(bool)>& callback) { 33 const base::Callback<void(bool)>& callback) {
36 callback.Run(true); 34 callback.Run(true);
37 } 35 }
38 36
39 base::WeakPtr<ServiceWorkerCache> ServiceWorkerCache::AsWeakPtr() { 37 base::WeakPtr<ServiceWorkerCache> ServiceWorkerCache::AsWeakPtr() {
40 return weak_ptr_factory_.GetWeakPtr(); 38 return weak_ptr_factory_.GetWeakPtr();
41 } 39 }
42 40
43 ServiceWorkerCache::ServiceWorkerCache( 41 ServiceWorkerCache::ServiceWorkerCache(
44 const base::FilePath& path, 42 const base::FilePath& path,
45 const std::string& name,
46 net::URLRequestContext* request_context, 43 net::URLRequestContext* request_context,
47 base::WeakPtr<storage::BlobStorageContext> blob_context) 44 base::WeakPtr<storage::BlobStorageContext> blob_context)
48 : path_(path), 45 : path_(path),
49 name_(name),
50 request_context_(request_context), 46 request_context_(request_context),
51 blob_storage_context_(blob_context), 47 blob_storage_context_(blob_context),
52 id_(0),
53 weak_ptr_factory_(this) { 48 weak_ptr_factory_(this) {
54 } 49 }
55 50
56 ServiceWorkerCache::~ServiceWorkerCache() { 51 ServiceWorkerCache::~ServiceWorkerCache() {
57 } 52 }
58 53
59 } // namespace content 54 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698