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

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, 5 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/sequenced_task_runner.h" 7 #include "base/sequenced_task_runner.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "content/browser/browser_main_loop.h" 9 #include "content/browser/browser_main_loop.h"
10 #include "content/browser/fileapi/browser_file_system_helper.h" 10 #include "content/browser/fileapi/browser_file_system_helper.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 152
153 } // namespace 153 } // namespace
154 154
155 StoragePartitionImpl::StoragePartitionImpl( 155 StoragePartitionImpl::StoragePartitionImpl(
156 const base::FilePath& partition_path, 156 const base::FilePath& partition_path,
157 quota::QuotaManager* quota_manager, 157 quota::QuotaManager* quota_manager,
158 ChromeAppCacheService* appcache_service, 158 ChromeAppCacheService* appcache_service,
159 fileapi::FileSystemContext* filesystem_context, 159 fileapi::FileSystemContext* filesystem_context,
160 webkit_database::DatabaseTracker* database_tracker, 160 webkit_database::DatabaseTracker* database_tracker,
161 DOMStorageContextImpl* dom_storage_context, 161 DOMStorageContextImpl* dom_storage_context,
162 IndexedDBContextImpl* indexed_db_context) 162 IndexedDBContextImpl* indexed_db_context,
163 scoped_ptr<WebRTCIdentityStore> webrtc_identity_store)
163 : partition_path_(partition_path), 164 : partition_path_(partition_path),
164 quota_manager_(quota_manager), 165 quota_manager_(quota_manager),
165 appcache_service_(appcache_service), 166 appcache_service_(appcache_service),
166 filesystem_context_(filesystem_context), 167 filesystem_context_(filesystem_context),
167 database_tracker_(database_tracker), 168 database_tracker_(database_tracker),
168 dom_storage_context_(dom_storage_context), 169 dom_storage_context_(dom_storage_context),
169 indexed_db_context_(indexed_db_context) { 170 indexed_db_context_(indexed_db_context),
170 } 171 webrtc_identity_store_(webrtc_identity_store.Pass()) {}
171 172
172 StoragePartitionImpl::~StoragePartitionImpl() { 173 StoragePartitionImpl::~StoragePartitionImpl() {
173 // These message loop checks are just to avoid leaks in unittests. 174 // These message loop checks are just to avoid leaks in unittests.
174 if (GetDatabaseTracker() && 175 if (GetDatabaseTracker() &&
175 BrowserThread::IsMessageLoopValid(BrowserThread::FILE)) { 176 BrowserThread::IsMessageLoopValid(BrowserThread::FILE)) {
176 BrowserThread::PostTask( 177 BrowserThread::PostTask(
177 BrowserThread::FILE, FROM_HERE, 178 BrowserThread::FILE, FROM_HERE,
178 base::Bind(&webkit_database::DatabaseTracker::Shutdown, 179 base::Bind(&webkit_database::DatabaseTracker::Shutdown,
179 GetDatabaseTracker())); 180 GetDatabaseTracker()));
180 } 181 }
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 : NULL; 237 : NULL;
237 scoped_refptr<IndexedDBContextImpl> indexed_db_context = 238 scoped_refptr<IndexedDBContextImpl> indexed_db_context =
238 new IndexedDBContextImpl(path, 239 new IndexedDBContextImpl(path,
239 context->GetSpecialStoragePolicy(), 240 context->GetSpecialStoragePolicy(),
240 quota_manager->proxy(), 241 quota_manager->proxy(),
241 idb_task_runner); 242 idb_task_runner);
242 243
243 scoped_refptr<ChromeAppCacheService> appcache_service = 244 scoped_refptr<ChromeAppCacheService> appcache_service =
244 new ChromeAppCacheService(quota_manager->proxy()); 245 new ChromeAppCacheService(quota_manager->proxy());
245 246
247 scoped_ptr<WebRTCIdentityStore> webrtc_identity_store(
248 new WebRTCIdentityStore());
249
246 return new StoragePartitionImpl(partition_path, 250 return new StoragePartitionImpl(partition_path,
247 quota_manager.get(), 251 quota_manager.get(),
248 appcache_service.get(), 252 appcache_service.get(),
249 filesystem_context.get(), 253 filesystem_context.get(),
250 database_tracker.get(), 254 database_tracker.get(),
251 dom_storage_context.get(), 255 dom_storage_context.get(),
252 indexed_db_context.get()); 256 indexed_db_context.get(),
257 webrtc_identity_store.Pass());
253 } 258 }
254 259
255 base::FilePath StoragePartitionImpl::GetPath() { 260 base::FilePath StoragePartitionImpl::GetPath() {
256 return partition_path_; 261 return partition_path_;
257 } 262 }
258 263
259 net::URLRequestContextGetter* StoragePartitionImpl::GetURLRequestContext() { 264 net::URLRequestContextGetter* StoragePartitionImpl::GetURLRequestContext() {
260 return url_request_context_.get(); 265 return url_request_context_.get();
261 } 266 }
262 267
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 DCHECK(storage_mask == kShaderStorage); 342 DCHECK(storage_mask == kShaderStorage);
338 343
339 if (storage_mask & kShaderStorage) { 344 if (storage_mask & kShaderStorage) {
340 BrowserThread::PostTask( 345 BrowserThread::PostTask(
341 BrowserThread::IO, FROM_HERE, 346 BrowserThread::IO, FROM_HERE,
342 base::Bind(&ClearShaderCacheOnIOThread, GetPath(), begin, end, 347 base::Bind(&ClearShaderCacheOnIOThread, GetPath(), begin, end,
343 callback)); 348 callback));
344 } 349 }
345 } 350 }
346 351
352 WebRTCIdentityStore* StoragePartitionImpl::GetWebRTCIdentityStore() {
353 return webrtc_identity_store_.get();
354 }
355
347 void StoragePartitionImpl::SetURLRequestContext( 356 void StoragePartitionImpl::SetURLRequestContext(
348 net::URLRequestContextGetter* url_request_context) { 357 net::URLRequestContextGetter* url_request_context) {
349 url_request_context_ = url_request_context; 358 url_request_context_ = url_request_context;
350 } 359 }
351 360
352 void StoragePartitionImpl::SetMediaURLRequestContext( 361 void StoragePartitionImpl::SetMediaURLRequestContext(
353 net::URLRequestContextGetter* media_url_request_context) { 362 net::URLRequestContextGetter* media_url_request_context) {
354 media_url_request_context_ = media_url_request_context; 363 media_url_request_context_ = media_url_request_context;
355 } 364 }
356 365
357 } // namespace content 366 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/storage_partition_impl.h ('k') | content/browser/storage_partition_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698