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

Unified Diff: chrome/browser/extensions/api/storage/sync_value_store_cache.cc

Issue 2769113002: [Sync] Stop accessing BrowserContextKeyedServiceFactory on non-UI thread. (Closed)
Patch Set: Rebase and removing dependent patch set. Created 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/storage/sync_value_store_cache.cc
diff --git a/chrome/browser/extensions/api/storage/sync_value_store_cache.cc b/chrome/browser/extensions/api/storage/sync_value_store_cache.cc
index 0a440ee84f6c218b8488b00df6c553a05f5219f7..33267b80f23e5c18669e58bb3a8c0db2dadd4b1a 100644
--- a/chrome/browser/extensions/api/storage/sync_value_store_cache.cc
+++ b/chrome/browser/extensions/api/storage/sync_value_store_cache.cc
@@ -35,7 +35,7 @@ SyncValueStoreCache::SyncValueStoreCache(
const scoped_refptr<ValueStoreFactory>& factory,
const scoped_refptr<SettingsObserverList>& observers,
const base::FilePath& profile_path)
- : initialized_(false) {
+ : initialized_(false), weak_ptr_factory_(this) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
// This post is safe since the destructor can only be invoked from the
@@ -52,6 +52,10 @@ SyncValueStoreCache::~SyncValueStoreCache() {
DCHECK_CURRENTLY_ON(BrowserThread::FILE);
}
+base::WeakPtr<SyncValueStoreCache> SyncValueStoreCache::AsWeakPtr() {
+ return weak_ptr_factory_.GetWeakPtr();
+}
+
syncer::SyncableService* SyncValueStoreCache::GetSyncableService(
syncer::ModelType type) const {
DCHECK_CURRENTLY_ON(BrowserThread::FILE);
« no previous file with comments | « chrome/browser/extensions/api/storage/sync_value_store_cache.h ('k') | chrome/browser/sync/chrome_sync_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698