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

Side by Side Diff: chromeos/network/shill_property_util.cc

Issue 2255093003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « chromeos/network/onc/onc_translator_onc_to_shill.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chromeos/network/shill_property_util.h" 5 #include "chromeos/network/shill_property_util.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <set> 9 #include <set>
10 10
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 } 190 }
191 return ssid; 191 return ssid;
192 } 192 }
193 193
194 std::unique_ptr<NetworkUIData> GetUIDataFromValue( 194 std::unique_ptr<NetworkUIData> GetUIDataFromValue(
195 const base::Value& ui_data_value) { 195 const base::Value& ui_data_value) {
196 std::string ui_data_str; 196 std::string ui_data_str;
197 if (!ui_data_value.GetAsString(&ui_data_str)) 197 if (!ui_data_value.GetAsString(&ui_data_str))
198 return std::unique_ptr<NetworkUIData>(); 198 return std::unique_ptr<NetworkUIData>();
199 if (ui_data_str.empty()) 199 if (ui_data_str.empty())
200 return base::WrapUnique(new NetworkUIData()); 200 return base::MakeUnique<NetworkUIData>();
201 std::unique_ptr<base::DictionaryValue> ui_data_dict( 201 std::unique_ptr<base::DictionaryValue> ui_data_dict(
202 chromeos::onc::ReadDictionaryFromJson(ui_data_str)); 202 chromeos::onc::ReadDictionaryFromJson(ui_data_str));
203 if (!ui_data_dict) 203 if (!ui_data_dict)
204 return std::unique_ptr<NetworkUIData>(); 204 return std::unique_ptr<NetworkUIData>();
205 return base::WrapUnique(new NetworkUIData(*ui_data_dict)); 205 return base::MakeUnique<NetworkUIData>(*ui_data_dict);
206 } 206 }
207 207
208 std::unique_ptr<NetworkUIData> GetUIDataFromProperties( 208 std::unique_ptr<NetworkUIData> GetUIDataFromProperties(
209 const base::DictionaryValue& shill_dictionary) { 209 const base::DictionaryValue& shill_dictionary) {
210 const base::Value* ui_data_value = NULL; 210 const base::Value* ui_data_value = NULL;
211 shill_dictionary.GetWithoutPathExpansion(shill::kUIDataProperty, 211 shill_dictionary.GetWithoutPathExpansion(shill::kUIDataProperty,
212 &ui_data_value); 212 &ui_data_value);
213 if (!ui_data_value) { 213 if (!ui_data_value) {
214 VLOG(2) << "Dictionary has no UIData entry."; 214 VLOG(2) << "Dictionary has no UIData entry.";
215 return std::unique_ptr<NetworkUIData>(); 215 return std::unique_ptr<NetworkUIData>();
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 LOG(WARNING) 376 LOG(WARNING)
377 << "Provider name and country not defined, using code instead: " 377 << "Provider name and country not defined, using code instead: "
378 << *home_provider_id; 378 << *home_provider_id;
379 } 379 }
380 return true; 380 return true;
381 } 381 }
382 382
383 } // namespace shill_property_util 383 } // namespace shill_property_util
384 384
385 } // namespace chromeos 385 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/network/onc/onc_translator_onc_to_shill.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698