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

Side by Side Diff: extensions/browser/api/storage/local_value_store_cache.cc

Issue 2294653002: Some linked_ptr -> unique_ptr conversion in extensions/browser. (Closed)
Patch Set: address comments Created 4 years, 3 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/api/storage/local_value_store_cache.h" 5 #include "extensions/browser/api/storage/local_value_store_cache.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <limits> 9 #include <limits>
10 10
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 ValueStore* LocalValueStoreCache::GetStorage(const Extension* extension) { 74 ValueStore* LocalValueStoreCache::GetStorage(const Extension* extension) {
75 StorageMap::iterator iter = storage_map_.find(extension->id()); 75 StorageMap::iterator iter = storage_map_.find(extension->id());
76 if (iter != storage_map_.end()) 76 if (iter != storage_map_.end())
77 return iter->second.get(); 77 return iter->second.get();
78 78
79 ValueStoreFactory::ModelType model_type = 79 ValueStoreFactory::ModelType model_type =
80 extension->is_app() ? ValueStoreFactory::ModelType::APP 80 extension->is_app() ? ValueStoreFactory::ModelType::APP
81 : ValueStoreFactory::ModelType::EXTENSION; 81 : ValueStoreFactory::ModelType::EXTENSION;
82 std::unique_ptr<ValueStore> store = storage_factory_->CreateSettingsStore( 82 std::unique_ptr<ValueStore> store = storage_factory_->CreateSettingsStore(
83 settings_namespace::LOCAL, model_type, extension->id()); 83 settings_namespace::LOCAL, model_type, extension->id());
84 linked_ptr<SettingsStorageQuotaEnforcer> storage( 84 std::unique_ptr<SettingsStorageQuotaEnforcer> storage(
85 new SettingsStorageQuotaEnforcer(quota_, std::move(store))); 85 new SettingsStorageQuotaEnforcer(quota_, std::move(store)));
86 DCHECK(storage.get()); 86 DCHECK(storage.get());
87 87
88 storage_map_[extension->id()] = storage; 88 ValueStore* storage_ptr = storage.get();
89 return storage.get(); 89 storage_map_[extension->id()] = std::move(storage);
90 return storage_ptr;
90 } 91 }
91 92
92 } // namespace extensions 93 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/storage/local_value_store_cache.h ('k') | extensions/browser/api/storage/settings_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698