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

Side by Side Diff: chrome/browser/extensions/api/storage/sync_storage_backend.cc

Issue 2257113002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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 "chrome/browser/extensions/api/storage/sync_storage_backend.h" 5 #include "chrome/browser/extensions/api/storage/sync_storage_backend.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 13 matching lines...) Expand all
24 const base::DictionaryValue& src, 24 const base::DictionaryValue& src,
25 syncer::ModelType type, 25 syncer::ModelType type,
26 syncer::SyncDataList* dst) { 26 syncer::SyncDataList* dst) {
27 for (base::DictionaryValue::Iterator it(src); !it.IsAtEnd(); it.Advance()) { 27 for (base::DictionaryValue::Iterator it(src); !it.IsAtEnd(); it.Advance()) {
28 dst->push_back(settings_sync_util::CreateData( 28 dst->push_back(settings_sync_util::CreateData(
29 extension_id, it.key(), it.value(), type)); 29 extension_id, it.key(), it.value(), type));
30 } 30 }
31 } 31 }
32 32
33 std::unique_ptr<base::DictionaryValue> EmptyDictionaryValue() { 33 std::unique_ptr<base::DictionaryValue> EmptyDictionaryValue() {
34 return base::WrapUnique(new base::DictionaryValue()); 34 return base::MakeUnique<base::DictionaryValue>();
35 } 35 }
36 36
37 ValueStoreFactory::ModelType ToFactoryModelType(syncer::ModelType sync_type) { 37 ValueStoreFactory::ModelType ToFactoryModelType(syncer::ModelType sync_type) {
38 switch (sync_type) { 38 switch (sync_type) {
39 case syncer::APP_SETTINGS: 39 case syncer::APP_SETTINGS:
40 return ValueStoreFactory::ModelType::APP; 40 return ValueStoreFactory::ModelType::APP;
41 case syncer::EXTENSION_SETTINGS: 41 case syncer::EXTENSION_SETTINGS:
42 return ValueStoreFactory::ModelType::EXTENSION; 42 return ValueStoreFactory::ModelType::EXTENSION;
43 default: 43 default:
44 NOTREACHED(); 44 NOTREACHED();
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 275
276 std::unique_ptr<SettingsSyncProcessor> 276 std::unique_ptr<SettingsSyncProcessor>
277 SyncStorageBackend::CreateSettingsSyncProcessor( 277 SyncStorageBackend::CreateSettingsSyncProcessor(
278 const std::string& extension_id) const { 278 const std::string& extension_id) const {
279 CHECK(sync_processor_.get()); 279 CHECK(sync_processor_.get());
280 return std::unique_ptr<SettingsSyncProcessor>(new SettingsSyncProcessor( 280 return std::unique_ptr<SettingsSyncProcessor>(new SettingsSyncProcessor(
281 extension_id, sync_type_, sync_processor_.get())); 281 extension_id, sync_type_, sync_processor_.get()));
282 } 282 }
283 283
284 } // namespace extensions 284 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698