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

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

Issue 2466523002: Remove some linked_ptr c/b/extension (Closed)
Patch Set: review Created 4 years, 1 month 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/managed_value_store_cache.cc
diff --git a/chrome/browser/extensions/api/storage/managed_value_store_cache.cc b/chrome/browser/extensions/api/storage/managed_value_store_cache.cc
index 46e3228024ba118e4818ef786d492e5da18e390e..ee183c5e5ec5548c312eb945f3519b5489488f32 100644
--- a/chrome/browser/extensions/api/storage/managed_value_store_cache.cc
+++ b/chrome/browser/extensions/api/storage/managed_value_store_cache.cc
@@ -346,19 +346,20 @@ PolicyValueStore* ManagedValueStoreCache::GetStoreFor(
const std::string& extension_id) {
DCHECK_CURRENTLY_ON(BrowserThread::FILE);
- PolicyValueStoreMap::iterator it = store_map_.find(extension_id);
+ auto it = store_map_.find(extension_id);
if (it != store_map_.end())
return it->second.get();
// Create the store now, and serve the cached policy until the PolicyService
// sends updated values.
- PolicyValueStore* store = new PolicyValueStore(
+ std::unique_ptr<PolicyValueStore> store(new PolicyValueStore(
extension_id, observers_,
storage_factory_->CreateSettingsStore(settings_namespace::MANAGED,
- kManagedModelType, extension_id));
- store_map_[extension_id] = make_linked_ptr(store);
+ kManagedModelType, extension_id)));
+ PolicyValueStore* raw_store = store.get();
+ store_map_[extension_id] = std::move(store);
- return store;
+ return raw_store;
}
bool ManagedValueStoreCache::HasStore(const std::string& extension_id) const {

Powered by Google App Engine
This is Rietveld 408576698