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

Side by Side Diff: chrome/browser/extensions/api/networking_private/networking_private_apitest.cc

Issue 2392693002: Rewrite simple uses of base::ListValue::Append(base::Value*) on CrOS. (Closed)
Patch Set: MakeUnique Created 4 years, 2 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <map> 7 #include <map>
8 #include <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 const NetworkListCallback& success_callback, 91 const NetworkListCallback& success_callback,
92 const FailureCallback& failure_callback) override { 92 const FailureCallback& failure_callback) override {
93 if (fail_) { 93 if (fail_) {
94 failure_callback.Run(kFailure); 94 failure_callback.Run(kFailure);
95 } else { 95 } else {
96 std::unique_ptr<base::ListValue> result(new base::ListValue); 96 std::unique_ptr<base::ListValue> result(new base::ListValue);
97 std::unique_ptr<base::DictionaryValue> network(new base::DictionaryValue); 97 std::unique_ptr<base::DictionaryValue> network(new base::DictionaryValue);
98 network->SetString(::onc::network_config::kType, 98 network->SetString(::onc::network_config::kType,
99 ::onc::network_config::kEthernet); 99 ::onc::network_config::kEthernet);
100 network->SetString(::onc::network_config::kGUID, kGuid); 100 network->SetString(::onc::network_config::kGUID, kGuid);
101 result->Append(network.release()); 101 result->Append(std::move(network));
102 success_callback.Run(std::move(result)); 102 success_callback.Run(std::move(result));
103 } 103 }
104 } 104 }
105 105
106 void StartConnect(const std::string& guid, 106 void StartConnect(const std::string& guid,
107 const VoidCallback& success_callback, 107 const VoidCallback& success_callback,
108 const FailureCallback& failure_callback) override { 108 const FailureCallback& failure_callback) override {
109 VoidResult(success_callback, failure_callback); 109 VoidResult(success_callback, failure_callback);
110 } 110 }
111 111
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 EXPECT_FALSE(RunNetworkingSubtest("unlockCellularSim")) << message_; 558 EXPECT_FALSE(RunNetworkingSubtest("unlockCellularSim")) << message_;
559 } 559 }
560 560
561 IN_PROC_BROWSER_TEST_F(NetworkingPrivateApiTestFail, SetCellularSimState) { 561 IN_PROC_BROWSER_TEST_F(NetworkingPrivateApiTestFail, SetCellularSimState) {
562 EXPECT_FALSE(RunNetworkingSubtest("setCellularSimState")) << message_; 562 EXPECT_FALSE(RunNetworkingSubtest("setCellularSimState")) << message_;
563 } 563 }
564 564
565 #endif // defined(OS_WIN) 565 #endif // defined(OS_WIN)
566 566
567 } // namespace extensions 567 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698