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); |