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

Side by Side Diff: content/browser/storage_partition_impl.cc

Issue 15969025: Generates the DTLS identity in browser process and returns it to render process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 6 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 (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/strings/utf_string_conversions.h" 7 #include "base/strings/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/gpu/shader_disk_cache.h" 9 #include "content/browser/gpu/shader_disk_cache.h"
10 #include "content/public/browser/browser_context.h" 10 #include "content/public/browser/browser_context.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 150
151 } // namespace 151 } // namespace
152 152
153 StoragePartitionImpl::StoragePartitionImpl( 153 StoragePartitionImpl::StoragePartitionImpl(
154 const base::FilePath& partition_path, 154 const base::FilePath& partition_path,
155 quota::QuotaManager* quota_manager, 155 quota::QuotaManager* quota_manager,
156 ChromeAppCacheService* appcache_service, 156 ChromeAppCacheService* appcache_service,
157 fileapi::FileSystemContext* filesystem_context, 157 fileapi::FileSystemContext* filesystem_context,
158 webkit_database::DatabaseTracker* database_tracker, 158 webkit_database::DatabaseTracker* database_tracker,
159 DOMStorageContextImpl* dom_storage_context, 159 DOMStorageContextImpl* dom_storage_context,
160 IndexedDBContextImpl* indexed_db_context) 160 IndexedDBContextImpl* indexed_db_context,
161 scoped_ptr<DTLSIdentityStore> dtls_identity_store)
161 : partition_path_(partition_path), 162 : partition_path_(partition_path),
162 quota_manager_(quota_manager), 163 quota_manager_(quota_manager),
163 appcache_service_(appcache_service), 164 appcache_service_(appcache_service),
164 filesystem_context_(filesystem_context), 165 filesystem_context_(filesystem_context),
165 database_tracker_(database_tracker), 166 database_tracker_(database_tracker),
166 dom_storage_context_(dom_storage_context), 167 dom_storage_context_(dom_storage_context),
167 indexed_db_context_(indexed_db_context) { 168 indexed_db_context_(indexed_db_context),
169 dtls_identity_store_(dtls_identity_store.Pass()) {
168 } 170 }
169 171
170 StoragePartitionImpl::~StoragePartitionImpl() { 172 StoragePartitionImpl::~StoragePartitionImpl() {
171 // These message loop checks are just to avoid leaks in unittests. 173 // These message loop checks are just to avoid leaks in unittests.
172 if (GetDatabaseTracker() && 174 if (GetDatabaseTracker() &&
173 BrowserThread::IsMessageLoopValid(BrowserThread::FILE)) { 175 BrowserThread::IsMessageLoopValid(BrowserThread::FILE)) {
174 BrowserThread::PostTask( 176 BrowserThread::PostTask(
175 BrowserThread::FILE, FROM_HERE, 177 BrowserThread::FILE, FROM_HERE,
176 base::Bind(&webkit_database::DatabaseTracker::Shutdown, 178 base::Bind(&webkit_database::DatabaseTracker::Shutdown,
177 GetDatabaseTracker())); 179 GetDatabaseTracker()));
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 scoped_refptr<IndexedDBContextImpl> indexed_db_context = 229 scoped_refptr<IndexedDBContextImpl> indexed_db_context =
228 new IndexedDBContextImpl(path, 230 new IndexedDBContextImpl(path,
229 context->GetSpecialStoragePolicy(), 231 context->GetSpecialStoragePolicy(),
230 quota_manager->proxy(), 232 quota_manager->proxy(),
231 BrowserThread::GetMessageLoopProxyForThread( 233 BrowserThread::GetMessageLoopProxyForThread(
232 BrowserThread::WEBKIT_DEPRECATED).get()); 234 BrowserThread::WEBKIT_DEPRECATED).get());
233 235
234 scoped_refptr<ChromeAppCacheService> appcache_service = 236 scoped_refptr<ChromeAppCacheService> appcache_service =
235 new ChromeAppCacheService(quota_manager->proxy()); 237 new ChromeAppCacheService(quota_manager->proxy());
236 238
239 scoped_ptr<DTLSIdentityStore> dtls_identity_store;
240 dtls_identity_store.reset(new DTLSIdentityStore());
241
237 return new StoragePartitionImpl(partition_path, 242 return new StoragePartitionImpl(partition_path,
238 quota_manager.get(), 243 quota_manager.get(),
239 appcache_service.get(), 244 appcache_service.get(),
240 filesystem_context.get(), 245 filesystem_context.get(),
241 database_tracker.get(), 246 database_tracker.get(),
242 dom_storage_context.get(), 247 dom_storage_context.get(),
243 indexed_db_context.get()); 248 indexed_db_context.get(),
249 dtls_identity_store.Pass());
244 } 250 }
245 251
246 base::FilePath StoragePartitionImpl::GetPath() { 252 base::FilePath StoragePartitionImpl::GetPath() {
247 return partition_path_; 253 return partition_path_;
248 } 254 }
249 255
250 net::URLRequestContextGetter* StoragePartitionImpl::GetURLRequestContext() { 256 net::URLRequestContextGetter* StoragePartitionImpl::GetURLRequestContext() {
251 return url_request_context_.get(); 257 return url_request_context_.get();
252 } 258 }
253 259
(...skipping 19 matching lines...) Expand all
273 } 279 }
274 280
275 DOMStorageContextImpl* StoragePartitionImpl::GetDOMStorageContext() { 281 DOMStorageContextImpl* StoragePartitionImpl::GetDOMStorageContext() {
276 return dom_storage_context_.get(); 282 return dom_storage_context_.get();
277 } 283 }
278 284
279 IndexedDBContextImpl* StoragePartitionImpl::GetIndexedDBContext() { 285 IndexedDBContextImpl* StoragePartitionImpl::GetIndexedDBContext() {
280 return indexed_db_context_.get(); 286 return indexed_db_context_.get();
281 } 287 }
282 288
289 DTLSIdentityStore* StoragePartitionImpl::GetDTLSIdentityStore() {
290 return dtls_identity_store_.get();
291 }
292
283 void StoragePartitionImpl::AsyncClearDataForOrigin( 293 void StoragePartitionImpl::AsyncClearDataForOrigin(
284 uint32 storage_mask, 294 uint32 storage_mask,
285 const GURL& storage_origin, 295 const GURL& storage_origin,
286 net::URLRequestContextGetter* request_context_getter) { 296 net::URLRequestContextGetter* request_context_getter) {
287 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 297 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
288 298
289 BrowserThread::PostTask( 299 BrowserThread::PostTask(
290 BrowserThread::IO, FROM_HERE, 300 BrowserThread::IO, FROM_HERE,
291 base::Bind(&ClearOriginOnIOThread, 301 base::Bind(&ClearOriginOnIOThread,
292 storage_mask, 302 storage_mask,
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 net::URLRequestContextGetter* url_request_context) { 349 net::URLRequestContextGetter* url_request_context) {
340 url_request_context_ = url_request_context; 350 url_request_context_ = url_request_context;
341 } 351 }
342 352
343 void StoragePartitionImpl::SetMediaURLRequestContext( 353 void StoragePartitionImpl::SetMediaURLRequestContext(
344 net::URLRequestContextGetter* media_url_request_context) { 354 net::URLRequestContextGetter* media_url_request_context) {
345 media_url_request_context_ = media_url_request_context; 355 media_url_request_context_ = media_url_request_context;
346 } 356 }
347 357
348 } // namespace content 358 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698