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

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

Issue 1902873002: Convert //extensions/browser/api from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 } 71 }
72 72
73 ValueStore* LocalValueStoreCache::GetStorage(const Extension* extension) { 73 ValueStore* LocalValueStoreCache::GetStorage(const Extension* extension) {
74 StorageMap::iterator iter = storage_map_.find(extension->id()); 74 StorageMap::iterator iter = storage_map_.find(extension->id());
75 if (iter != storage_map_.end()) 75 if (iter != storage_map_.end())
76 return iter->second.get(); 76 return iter->second.get();
77 77
78 ValueStoreFactory::ModelType model_type = 78 ValueStoreFactory::ModelType model_type =
79 extension->is_app() ? ValueStoreFactory::ModelType::APP 79 extension->is_app() ? ValueStoreFactory::ModelType::APP
80 : ValueStoreFactory::ModelType::EXTENSION; 80 : ValueStoreFactory::ModelType::EXTENSION;
81 scoped_ptr<ValueStore> store = storage_factory_->CreateSettingsStore( 81 std::unique_ptr<ValueStore> store = storage_factory_->CreateSettingsStore(
82 settings_namespace::LOCAL, model_type, extension->id()); 82 settings_namespace::LOCAL, model_type, extension->id());
83 linked_ptr<SettingsStorageQuotaEnforcer> storage( 83 linked_ptr<SettingsStorageQuotaEnforcer> storage(
84 new SettingsStorageQuotaEnforcer(quota_, std::move(store))); 84 new SettingsStorageQuotaEnforcer(quota_, std::move(store)));
85 DCHECK(storage.get()); 85 DCHECK(storage.get());
86 86
87 storage_map_[extension->id()] = storage; 87 storage_map_[extension->id()] = storage;
88 return storage.get(); 88 return storage.get();
89 } 89 }
90 90
91 } // namespace extensions 91 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/storage/local_value_store_cache.h ('k') | extensions/browser/api/storage/settings_quota_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698