| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |