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

Side by Side Diff: chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api.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 "chrome/browser/extensions/api/enterprise_platform_keys/enterprise_plat form_keys_api.h" 5 #include "chrome/browser/extensions/api/enterprise_platform_keys/enterprise_plat form_keys_api.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 for (net::CertificateList::const_iterator it = certs->begin(); 117 for (net::CertificateList::const_iterator it = certs->begin();
118 it != certs->end(); 118 it != certs->end();
119 ++it) { 119 ++it) {
120 std::string der_encoding; 120 std::string der_encoding;
121 net::X509Certificate::GetDEREncoded((*it)->os_cert_handle(), &der_encoding); 121 net::X509Certificate::GetDEREncoded((*it)->os_cert_handle(), &der_encoding);
122 client_certs->Append(base::BinaryValue::CreateWithCopiedBuffer( 122 client_certs->Append(base::BinaryValue::CreateWithCopiedBuffer(
123 der_encoding.data(), der_encoding.size())); 123 der_encoding.data(), der_encoding.size()));
124 } 124 }
125 125
126 std::unique_ptr<base::ListValue> results(new base::ListValue()); 126 std::unique_ptr<base::ListValue> results(new base::ListValue());
127 results->Append(client_certs.release()); 127 results->Append(std::move(client_certs));
128 Respond(ArgumentList(std::move(results))); 128 Respond(ArgumentList(std::move(results)));
129 } 129 }
130 130
131 EnterprisePlatformKeysImportCertificateFunction:: 131 EnterprisePlatformKeysImportCertificateFunction::
132 ~EnterprisePlatformKeysImportCertificateFunction() { 132 ~EnterprisePlatformKeysImportCertificateFunction() {
133 } 133 }
134 134
135 ExtensionFunction::ResponseAction 135 ExtensionFunction::ResponseAction
136 EnterprisePlatformKeysImportCertificateFunction::Run() { 136 EnterprisePlatformKeysImportCertificateFunction::Run() {
137 std::unique_ptr<api_epk::ImportCertificate::Params> params( 137 std::unique_ptr<api_epk::ImportCertificate::Params> params(
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 const std::string& data) { 319 const std::string& data) {
320 if (success) { 320 if (success) {
321 Respond(ArgumentList( 321 Respond(ArgumentList(
322 api_epk::ChallengeUserKey::Results::Create(VectorFromString(data)))); 322 api_epk::ChallengeUserKey::Results::Create(VectorFromString(data))));
323 } else { 323 } else {
324 Respond(Error(data)); 324 Respond(Error(data));
325 } 325 }
326 } 326 }
327 327
328 } // namespace extensions 328 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698