OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/storage_partition_impl.h" | 5 #include "content/browser/storage_partition_impl.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "content/browser/fileapi/browser_file_system_helper.h" | 8 #include "content/browser/fileapi/browser_file_system_helper.h" |
| 9 #include "content/browser/webui/url_data_manager.h" |
9 #include "content/public/browser/browser_context.h" | 10 #include "content/public/browser/browser_context.h" |
10 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
11 #include "content/public/browser/dom_storage_context.h" | 12 #include "content/public/browser/dom_storage_context.h" |
12 #include "content/public/browser/indexed_db_context.h" | 13 #include "content/public/browser/indexed_db_context.h" |
13 #include "net/base/completion_callback.h" | 14 #include "net/base/completion_callback.h" |
14 #include "net/base/net_errors.h" | 15 #include "net/base/net_errors.h" |
15 #include "net/cookies/cookie_monster.h" | 16 #include "net/cookies/cookie_monster.h" |
16 #include "net/url_request/url_request_context_getter.h" | 17 #include "net/url_request/url_request_context_getter.h" |
17 #include "net/url_request/url_request_context.h" | 18 #include "net/url_request/url_request_context.h" |
18 #include "webkit/database/database_tracker.h" | 19 #include "webkit/database/database_tracker.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 | 111 |
111 } // namespace | 112 } // namespace |
112 | 113 |
113 StoragePartitionImpl::StoragePartitionImpl( | 114 StoragePartitionImpl::StoragePartitionImpl( |
114 const FilePath& partition_path, | 115 const FilePath& partition_path, |
115 quota::QuotaManager* quota_manager, | 116 quota::QuotaManager* quota_manager, |
116 ChromeAppCacheService* appcache_service, | 117 ChromeAppCacheService* appcache_service, |
117 fileapi::FileSystemContext* filesystem_context, | 118 fileapi::FileSystemContext* filesystem_context, |
118 webkit_database::DatabaseTracker* database_tracker, | 119 webkit_database::DatabaseTracker* database_tracker, |
119 DOMStorageContextImpl* dom_storage_context, | 120 DOMStorageContextImpl* dom_storage_context, |
120 IndexedDBContextImpl* indexed_db_context) | 121 IndexedDBContextImpl* indexed_db_context, |
| 122 ChromeURLDataManager* url_data_manager) |
121 : partition_path_(partition_path), | 123 : partition_path_(partition_path), |
122 quota_manager_(quota_manager), | 124 quota_manager_(quota_manager), |
123 appcache_service_(appcache_service), | 125 appcache_service_(appcache_service), |
124 filesystem_context_(filesystem_context), | 126 filesystem_context_(filesystem_context), |
125 database_tracker_(database_tracker), | 127 database_tracker_(database_tracker), |
126 dom_storage_context_(dom_storage_context), | 128 dom_storage_context_(dom_storage_context), |
127 indexed_db_context_(indexed_db_context) { | 129 indexed_db_context_(indexed_db_context), |
| 130 url_data_manager_(url_data_manager) { |
128 } | 131 } |
129 | 132 |
130 StoragePartitionImpl::~StoragePartitionImpl() { | 133 StoragePartitionImpl::~StoragePartitionImpl() { |
131 // These message loop checks are just to avoid leaks in unittests. | 134 // These message loop checks are just to avoid leaks in unittests. |
132 if (GetDatabaseTracker() && | 135 if (GetDatabaseTracker() && |
133 BrowserThread::IsMessageLoopValid(BrowserThread::FILE)) { | 136 BrowserThread::IsMessageLoopValid(BrowserThread::FILE)) { |
134 BrowserThread::PostTask( | 137 BrowserThread::PostTask( |
135 BrowserThread::FILE, FROM_HERE, | 138 BrowserThread::FILE, FROM_HERE, |
136 base::Bind(&webkit_database::DatabaseTracker::Shutdown, | 139 base::Bind(&webkit_database::DatabaseTracker::Shutdown, |
137 GetDatabaseTracker())); | 140 GetDatabaseTracker())); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 | 185 |
183 scoped_refptr<IndexedDBContextImpl> indexed_db_context = | 186 scoped_refptr<IndexedDBContextImpl> indexed_db_context = |
184 new IndexedDBContextImpl(path, context->GetSpecialStoragePolicy(), | 187 new IndexedDBContextImpl(path, context->GetSpecialStoragePolicy(), |
185 quota_manager->proxy(), | 188 quota_manager->proxy(), |
186 BrowserThread::GetMessageLoopProxyForThread( | 189 BrowserThread::GetMessageLoopProxyForThread( |
187 BrowserThread::WEBKIT_DEPRECATED)); | 190 BrowserThread::WEBKIT_DEPRECATED)); |
188 | 191 |
189 scoped_refptr<ChromeAppCacheService> appcache_service = | 192 scoped_refptr<ChromeAppCacheService> appcache_service = |
190 new ChromeAppCacheService(quota_manager->proxy()); | 193 new ChromeAppCacheService(quota_manager->proxy()); |
191 | 194 |
| 195 ChromeURLDataManager* url_data_manager = new ChromeURLDataManager(context); |
| 196 |
192 return new StoragePartitionImpl(partition_path, | 197 return new StoragePartitionImpl(partition_path, |
193 quota_manager, | 198 quota_manager, |
194 appcache_service, | 199 appcache_service, |
195 filesystem_context, | 200 filesystem_context, |
196 database_tracker, | 201 database_tracker, |
197 dom_storage_context, | 202 dom_storage_context, |
198 indexed_db_context); | 203 indexed_db_context, |
| 204 url_data_manager); |
199 } | 205 } |
200 | 206 |
201 FilePath StoragePartitionImpl::GetPath() { | 207 FilePath StoragePartitionImpl::GetPath() { |
202 return partition_path_; | 208 return partition_path_; |
203 } | 209 } |
204 | 210 |
205 net::URLRequestContextGetter* StoragePartitionImpl::GetURLRequestContext() { | 211 net::URLRequestContextGetter* StoragePartitionImpl::GetURLRequestContext() { |
206 return url_request_context_; | 212 return url_request_context_; |
207 } | 213 } |
208 | 214 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 net::URLRequestContextGetter* url_request_context) { | 276 net::URLRequestContextGetter* url_request_context) { |
271 url_request_context_ = url_request_context; | 277 url_request_context_ = url_request_context; |
272 } | 278 } |
273 | 279 |
274 void StoragePartitionImpl::SetMediaURLRequestContext( | 280 void StoragePartitionImpl::SetMediaURLRequestContext( |
275 net::URLRequestContextGetter* media_url_request_context) { | 281 net::URLRequestContextGetter* media_url_request_context) { |
276 media_url_request_context_ = media_url_request_context; | 282 media_url_request_context_ = media_url_request_context; |
277 } | 283 } |
278 | 284 |
279 } // namespace content | 285 } // namespace content |
OLD | NEW |