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

Side by Side Diff: chromeos/network/onc/onc_validator.cc

Issue 2911033002: Remove raw base::DictionaryValue::Set (Closed)
Patch Set: Proper Windows Fix Created 3 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/onc/onc_validator.h" 5 #include "chromeos/network/onc/onc_validator.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
11 #include <utility>
11 12
12 #include "base/json/json_writer.h" 13 #include "base/json/json_writer.h"
13 #include "base/logging.h" 14 #include "base/logging.h"
14 #include "base/memory/ptr_util.h" 15 #include "base/memory/ptr_util.h"
15 #include "base/strings/string_number_conversions.h" 16 #include "base/strings/string_number_conversions.h"
16 #include "base/strings/string_piece.h" 17 #include "base/strings/string_piece.h"
17 #include "base/strings/string_util.h" 18 #include "base/strings/string_util.h"
18 #include "base/values.h" 19 #include "base/values.h"
19 #include "chromeos/network/onc/onc_signature.h" 20 #include "chromeos/network/onc/onc_signature.h"
20 21
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 return false; 278 return false;
278 } 279 }
279 280
280 LOG(WARNING) << message; 281 LOG(WARNING) << message;
281 continue; 282 continue;
282 } 283 }
283 284
284 repaired_recommended->AppendString(field_name); 285 repaired_recommended->AppendString(field_name);
285 } 286 }
286 287
287 result->Set(::onc::kRecommended, repaired_recommended.release()); 288 result->Set(::onc::kRecommended, std::move(repaired_recommended));
288 return true; 289 return true;
289 } 290 }
290 291
291 bool Validator::ValidateClientCertFields(bool allow_cert_type_none, 292 bool Validator::ValidateClientCertFields(bool allow_cert_type_none,
292 base::DictionaryValue* result) { 293 base::DictionaryValue* result) {
293 using namespace ::onc::client_cert; 294 using namespace ::onc::client_cert;
294 const char* const kValidCertTypes[] = {kRef, kPattern, kPKCS11Id}; 295 const char* const kValidCertTypes[] = {kRef, kPattern, kPKCS11Id};
295 std::vector<const char*> valid_cert_types(toVector(kValidCertTypes)); 296 std::vector<const char*> valid_cert_types(toVector(kValidCertTypes));
296 if (allow_cert_type_none) 297 if (allow_cert_type_none)
297 valid_cert_types.push_back(kClientCertTypeNone); 298 valid_cert_types.push_back(kClientCertTypeNone);
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after
1036 } 1037 }
1037 1038
1038 std::string Validator::MessageHeader() { 1039 std::string Validator::MessageHeader() {
1039 std::string path = path_.empty() ? "toplevel" : base::JoinString(path_, "."); 1040 std::string path = path_.empty() ? "toplevel" : base::JoinString(path_, ".");
1040 std::string message = "At " + path + ": "; 1041 std::string message = "At " + path + ": ";
1041 return message; 1042 return message;
1042 } 1043 }
1043 1044
1044 } // namespace onc 1045 } // namespace onc
1045 } // namespace chromeos 1046 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/network/network_configuration_handler_unittest.cc ('k') | components/cloud_devices/common/description_items_inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698