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

Side by Side Diff: chromeos/tools/onc_validator/onc_validator.cc

Issue 1556773002: Convert Pass()→std::move() in //chromeos (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/timezone/timezone_unittest.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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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
7 #include <cstdio> 6 #include <cstdio>
8 #include <iostream> 7 #include <iostream>
8 #include <utility>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/files/file_path.h" 11 #include "base/files/file_path.h"
12 #include "base/json/json_file_value_serializer.h" 12 #include "base/json/json_file_value_serializer.h"
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/values.h" 14 #include "base/values.h"
15 #include "chromeos/network/onc/onc_signature.h" 15 #include "chromeos/network/onc/onc_signature.h"
16 #include "chromeos/network/onc/onc_validator.h" 16 #include "chromeos/network/onc/onc_validator.h"
17 17
18 // TODO Check why this file do not fail on default trybots 18 // TODO Check why this file do not fail on default trybots
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 93
94 std::string json_error; 94 std::string json_error;
95 scoped_ptr<base::Value> value = deserializer.Deserialize(NULL, &json_error); 95 scoped_ptr<base::Value> value = deserializer.Deserialize(NULL, &json_error);
96 if (!value) { 96 if (!value) {
97 LOG(ERROR) << "Couldn't json-deserialize file '" << filename 97 LOG(ERROR) << "Couldn't json-deserialize file '" << filename
98 << "': " << json_error; 98 << "': " << json_error;
99 return nullptr; 99 return nullptr;
100 } 100 }
101 101
102 scoped_ptr<base::DictionaryValue> dict = 102 scoped_ptr<base::DictionaryValue> dict =
103 base::DictionaryValue::From(value.Pass()); 103 base::DictionaryValue::From(std::move(value));
104 if (!dict) { 104 if (!dict) {
105 LOG(ERROR) << "File '" << filename 105 LOG(ERROR) << "File '" << filename
106 << "' does not contain a dictionary as expected, but type " 106 << "' does not contain a dictionary as expected, but type "
107 << value->GetType(); 107 << value->GetType();
108 } 108 }
109 109
110 return dict; 110 return dict;
111 } 111 }
112 112
113 int main(int argc, const char* argv[]) { 113 int main(int argc, const char* argv[]) {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 case chromeos::onc::Validator::VALID: 159 case chromeos::onc::Validator::VALID:
160 return kStatusValid; 160 return kStatusValid;
161 case chromeos::onc::Validator::VALID_WITH_WARNINGS: 161 case chromeos::onc::Validator::VALID_WITH_WARNINGS:
162 return kStatusWarnings; 162 return kStatusWarnings;
163 case chromeos::onc::Validator::INVALID: 163 case chromeos::onc::Validator::INVALID:
164 return kStatusInvalid; 164 return kStatusInvalid;
165 default: 165 default:
166 CHECK(false); 166 CHECK(false);
167 } 167 }
168 } 168 }
OLDNEW
« no previous file with comments | « chromeos/timezone/timezone_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698