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 #include "content/browser/cache_storage/cache_storage_context_impl.h" | 5 #include "content/browser/cache_storage/cache_storage_context_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/threading/sequenced_worker_pool.h" | 9 #include "base/threading/sequenced_worker_pool.h" |
10 #include "content/browser/cache_storage/cache_storage_manager.h" | 10 #include "content/browser/cache_storage/cache_storage_manager.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
70 return cache_manager_.get(); | 70 return cache_manager_.get(); |
71 } | 71 } |
72 | 72 |
73 void CacheStorageContextImpl::SetBlobParametersForCache( | 73 void CacheStorageContextImpl::SetBlobParametersForCache( |
74 net::URLRequestContextGetter* request_context, | 74 net::URLRequestContextGetter* request_context, |
75 ChromeBlobStorageContext* blob_storage_context) { | 75 ChromeBlobStorageContext* blob_storage_context) { |
76 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 76 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
77 | 77 |
78 if (cache_manager_ && request_context && blob_storage_context) { | 78 if (cache_manager_ && request_context && blob_storage_context) { |
79 cache_manager_->SetBlobParametersForCache( | 79 cache_manager_->SetBlobParametersForCache( |
80 request_context->GetURLRequestContext(), | 80 request_context, blob_storage_context->context()->AsWeakPtr()); |
mmenke
2015/06/10 17:00:31
This is the profile's main RequestContextGetter?
jkarlin
2015/06/10 18:26:03
It's the partition's context getter. See https://c
| |
81 blob_storage_context->context()->AsWeakPtr()); | |
82 } | 81 } |
83 } | 82 } |
84 | 83 |
85 void CacheStorageContextImpl::CreateCacheStorageManager( | 84 void CacheStorageContextImpl::CreateCacheStorageManager( |
86 const base::FilePath& user_data_directory, | 85 const base::FilePath& user_data_directory, |
87 const scoped_refptr<base::SequencedTaskRunner>& cache_task_runner, | 86 const scoped_refptr<base::SequencedTaskRunner>& cache_task_runner, |
88 storage::QuotaManagerProxy* quota_manager_proxy, | 87 storage::QuotaManagerProxy* quota_manager_proxy, |
89 storage::SpecialStoragePolicy* special_storage_policy) { | 88 storage::SpecialStoragePolicy* special_storage_policy) { |
90 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 89 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
91 | 90 |
92 DCHECK(!cache_manager_); | 91 DCHECK(!cache_manager_); |
93 cache_manager_ = | 92 cache_manager_ = |
94 CacheStorageManager::Create(user_data_directory, cache_task_runner.get(), | 93 CacheStorageManager::Create(user_data_directory, cache_task_runner.get(), |
95 make_scoped_refptr(quota_manager_proxy)); | 94 make_scoped_refptr(quota_manager_proxy)); |
96 } | 95 } |
97 | 96 |
98 void CacheStorageContextImpl::ShutdownOnIO() { | 97 void CacheStorageContextImpl::ShutdownOnIO() { |
99 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 98 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
100 | 99 |
101 cache_manager_.reset(); | 100 cache_manager_.reset(); |
102 } | 101 } |
103 | 102 |
104 } // namespace content | 103 } // namespace content |
OLD | NEW |