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

Side by Side Diff: extensions/browser/api/networking_private/networking_private_chromeos.cc

Issue 2000803003: Use std::unique_ptr for base::DictionaryValue and base::ListValue's internal store. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix various builds. Created 4 years, 6 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/networking_private/networking_private_chromeos. h" 5 #include "extensions/browser/api/networking_private/networking_private_chromeos. h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 bool visible_only, 349 bool visible_only,
350 int limit, 350 int limit,
351 const NetworkListCallback& success_callback, 351 const NetworkListCallback& success_callback,
352 const FailureCallback& failure_callback) { 352 const FailureCallback& failure_callback) {
353 NetworkTypePattern pattern = 353 NetworkTypePattern pattern =
354 chromeos::onc::NetworkTypePatternFromOncType(network_type); 354 chromeos::onc::NetworkTypePatternFromOncType(network_type);
355 std::unique_ptr<base::ListValue> network_properties_list = 355 std::unique_ptr<base::ListValue> network_properties_list =
356 chromeos::network_util::TranslateNetworkListToONC( 356 chromeos::network_util::TranslateNetworkListToONC(
357 pattern, configured_only, visible_only, limit); 357 pattern, configured_only, visible_only, limit);
358 358
359 for (base::Value* value : *network_properties_list) { 359 for (const auto& value : *network_properties_list) {
360 base::DictionaryValue* network_dict = nullptr; 360 base::DictionaryValue* network_dict = nullptr;
361 value->GetAsDictionary(&network_dict); 361 value->GetAsDictionary(&network_dict);
362 DCHECK(network_dict); 362 DCHECK(network_dict);
363 if (GetThirdPartyVPNDictionary(network_dict)) 363 if (GetThirdPartyVPNDictionary(network_dict))
364 AppendThirdPartyProviderName(network_dict); 364 AppendThirdPartyProviderName(network_dict);
365 } 365 }
366 366
367 success_callback.Run(std::move(network_properties_list)); 367 success_callback.Run(std::move(network_properties_list));
368 } 368 }
369 369
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 // Eventually the caller (e.g. Settings) should handle any failures and 665 // Eventually the caller (e.g. Settings) should handle any failures and
666 // show its own configuration UI. crbug.com/380937. 666 // show its own configuration UI. crbug.com/380937.
667 if (ui_delegate()->HandleConnectFailed(guid, error_name)) { 667 if (ui_delegate()->HandleConnectFailed(guid, error_name)) {
668 success_callback.Run(); 668 success_callback.Run();
669 return; 669 return;
670 } 670 }
671 failure_callback.Run(error_name); 671 failure_callback.Run(error_name);
672 } 672 }
673 673
674 } // namespace extensions 674 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698