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

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

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.h
diff --git a/chrome/browser/extensions/api/storage/sync_value_store_cache.h b/chrome/browser/extensions/api/storage/sync_value_store_cache.h
index 6280582386573165fbd1ce260114b731ae323104..2984522013439ca01368df32fada12c3c93847e9 100644
--- a/chrome/browser/extensions/api/storage/sync_value_store_cache.h
+++ b/chrome/browser/extensions/api/storage/sync_value_store_cache.h
@@ -6,10 +6,12 @@
#define CHROME_BROWSER_EXTENSIONS_API_STORAGE_SYNC_VALUE_STORE_CACHE_H_
#include <memory>
+#include <string>
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
#include "components/sync/model/syncable_service.h"
#include "extensions/browser/api/storage/settings_observer.h"
#include "extensions/browser/api/storage/value_store_cache.h"
@@ -36,6 +38,8 @@ class SyncValueStoreCache : public ValueStoreCache {
const base::FilePath& profile_path);
~SyncValueStoreCache() override;
+ base::WeakPtr<SyncValueStoreCache> AsWeakPtr();
+
syncer::SyncableService* GetSyncableService(syncer::ModelType type) const;
// ValueStoreCache implementation:
@@ -52,6 +56,7 @@ class SyncValueStoreCache : public ValueStoreCache {
bool initialized_;
std::unique_ptr<SyncStorageBackend> app_backend_;
std::unique_ptr<SyncStorageBackend> extension_backend_;
+ base::WeakPtrFactory<SyncValueStoreCache> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(SyncValueStoreCache);
};

Powered by Google App Engine
This is Rietveld 408576698