| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "net/tools/transport_security_state_generator/input_file_parsers.h" | 5 #include "net/tools/transport_security_state_generator/input_file_parsers.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 &entry->hpkp_include_subdomains); | 311 &entry->hpkp_include_subdomains); |
| 312 parsed->GetString("pins", &entry->pinset); | 312 parsed->GetString("pins", &entry->pinset); |
| 313 parsed->GetBoolean("expect_ct", &entry->expect_ct); | 313 parsed->GetBoolean("expect_ct", &entry->expect_ct); |
| 314 parsed->GetString("expect_ct_report_uri", &entry->expect_ct_report_uri); | 314 parsed->GetString("expect_ct_report_uri", &entry->expect_ct_report_uri); |
| 315 parsed->GetBoolean("expect_staple", &entry->expect_staple); | 315 parsed->GetBoolean("expect_staple", &entry->expect_staple); |
| 316 parsed->GetBoolean("include_subdomains_for_expect_staple", | 316 parsed->GetBoolean("include_subdomains_for_expect_staple", |
| 317 &entry->expect_staple_include_subdomains); | 317 &entry->expect_staple_include_subdomains); |
| 318 parsed->GetString("expect_staple_report_uri", | 318 parsed->GetString("expect_staple_report_uri", |
| 319 &entry->expect_staple_report_uri); | 319 &entry->expect_staple_report_uri); |
| 320 | 320 |
| 321 int importance = 0; |
| 322 parsed->GetInteger("importance", &importance); |
| 323 entry->importance = static_cast<unsigned>(importance); |
| 324 |
| 321 entries->push_back(std::move(entry)); | 325 entries->push_back(std::move(entry)); |
| 322 } | 326 } |
| 323 | 327 |
| 324 const base::ListValue* pinsets_list = nullptr; | 328 const base::ListValue* pinsets_list = nullptr; |
| 325 if (!dict_value->GetList("pinsets", &pinsets_list)) { | 329 if (!dict_value->GetList("pinsets", &pinsets_list)) { |
| 326 LOG(ERROR) << "Could not parse the pinsets in the input JSON"; | 330 LOG(ERROR) << "Could not parse the pinsets in the input JSON"; |
| 327 return false; | 331 return false; |
| 328 } | 332 } |
| 329 | 333 |
| 330 for (size_t i = 0; i < pinsets_list->GetSize(); ++i) { | 334 for (size_t i = 0; i < pinsets_list->GetSize(); ++i) { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 | 372 |
| 369 pinsets->RegisterPinset(std::move(pinset)); | 373 pinsets->RegisterPinset(std::move(pinset)); |
| 370 } | 374 } |
| 371 | 375 |
| 372 return true; | 376 return true; |
| 373 } | 377 } |
| 374 | 378 |
| 375 } // namespace transport_security_state | 379 } // namespace transport_security_state |
| 376 | 380 |
| 377 } // namespace net | 381 } // namespace net |
| OLD | NEW |