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

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

Issue 1737933002: mojo leveldb: Get profile and leveldb connected to DOMStorageContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove stale todo comment Created 4 years, 9 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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 if (GetPlatformNotificationContext()) 401 if (GetPlatformNotificationContext())
402 GetPlatformNotificationContext()->Shutdown(); 402 GetPlatformNotificationContext()->Shutdown();
403 403
404 if (GetBackgroundSyncContext()) 404 if (GetBackgroundSyncContext())
405 GetBackgroundSyncContext()->Shutdown(); 405 GetBackgroundSyncContext()->Shutdown();
406 } 406 }
407 407
408 StoragePartitionImpl* StoragePartitionImpl::Create( 408 StoragePartitionImpl* StoragePartitionImpl::Create(
409 BrowserContext* context, 409 BrowserContext* context,
410 bool in_memory, 410 bool in_memory,
411 const base::FilePath& partition_path) { 411 const base::FilePath& partition_path,
412 const base::FilePath& local_partition_path) {
412 // Ensure that these methods are called on the UI thread, except for 413 // Ensure that these methods are called on the UI thread, except for
413 // unittests where a UI thread might not have been created. 414 // unittests where a UI thread might not have been created.
414 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) || 415 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) ||
415 !BrowserThread::IsMessageLoopValid(BrowserThread::UI)); 416 !BrowserThread::IsMessageLoopValid(BrowserThread::UI));
416 417
417 // All of the clients have to be created and registered with the 418 // All of the clients have to be created and registered with the
418 // QuotaManager prior to the QuotaManger being used. We do them 419 // QuotaManager prior to the QuotaManger being used. We do them
419 // all together here prior to handing out a reference to anything 420 // all together here prior to handing out a reference to anything
420 // that utilizes the QuotaManager. 421 // that utilizes the QuotaManager.
421 scoped_refptr<storage::QuotaManager> quota_manager = 422 scoped_refptr<storage::QuotaManager> quota_manager =
(...skipping 13 matching lines...) Expand all
435 scoped_refptr<storage::DatabaseTracker> database_tracker = 436 scoped_refptr<storage::DatabaseTracker> database_tracker =
436 new storage::DatabaseTracker(partition_path, 437 new storage::DatabaseTracker(partition_path,
437 in_memory, 438 in_memory,
438 context->GetSpecialStoragePolicy(), 439 context->GetSpecialStoragePolicy(),
439 quota_manager->proxy(), 440 quota_manager->proxy(),
440 BrowserThread::GetMessageLoopProxyForThread( 441 BrowserThread::GetMessageLoopProxyForThread(
441 BrowserThread::FILE).get()); 442 BrowserThread::FILE).get());
442 443
443 base::FilePath path = in_memory ? base::FilePath() : partition_path; 444 base::FilePath path = in_memory ? base::FilePath() : partition_path;
444 scoped_refptr<DOMStorageContextWrapper> dom_storage_context = 445 scoped_refptr<DOMStorageContextWrapper> dom_storage_context =
445 new DOMStorageContextWrapper(path, context->GetSpecialStoragePolicy()); 446 new DOMStorageContextWrapper(
447 BrowserContext::GetMojoUserIdFor(context),
448 path,
449 local_partition_path,
450 context->GetSpecialStoragePolicy());
446 451
447 // BrowserMainLoop may not be initialized in unit tests. Tests will 452 // BrowserMainLoop may not be initialized in unit tests. Tests will
448 // need to inject their own task runner into the IndexedDBContext. 453 // need to inject their own task runner into the IndexedDBContext.
449 base::SequencedTaskRunner* idb_task_runner = 454 base::SequencedTaskRunner* idb_task_runner =
450 BrowserThread::CurrentlyOn(BrowserThread::UI) && 455 BrowserThread::CurrentlyOn(BrowserThread::UI) &&
451 BrowserMainLoop::GetInstance() 456 BrowserMainLoop::GetInstance()
452 ? BrowserMainLoop::GetInstance() 457 ? BrowserMainLoop::GetInstance()
453 ->indexed_db_thread() 458 ->indexed_db_thread()
454 ->task_runner() 459 ->task_runner()
455 .get() 460 .get()
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 net::URLRequestContextGetter* url_request_context) { 921 net::URLRequestContextGetter* url_request_context) {
917 url_request_context_ = url_request_context; 922 url_request_context_ = url_request_context;
918 } 923 }
919 924
920 void StoragePartitionImpl::SetMediaURLRequestContext( 925 void StoragePartitionImpl::SetMediaURLRequestContext(
921 net::URLRequestContextGetter* media_url_request_context) { 926 net::URLRequestContextGetter* media_url_request_context) {
922 media_url_request_context_ = media_url_request_context; 927 media_url_request_context_ = media_url_request_context;
923 } 928 }
924 929
925 } // namespace content 930 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698