| OLD | NEW |
| 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 "base/base64.h" | 5 #include "base/base64.h" |
| 6 #include "base/basictypes.h" | 6 #include "base/basictypes.h" |
| 7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
| 8 #include "base/strings/string_tokenizer.h" | 8 #include "base/strings/string_tokenizer.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "net/http/http_security_headers.h" | 10 #include "net/http/http_security_headers.h" |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 } | 316 } |
| 317 | 317 |
| 318 if (!parsed_max_age) | 318 if (!parsed_max_age) |
| 319 return false; | 319 return false; |
| 320 | 320 |
| 321 if (!IsPinListValid(pins, chain_hashes)) | 321 if (!IsPinListValid(pins, chain_hashes)) |
| 322 return false; | 322 return false; |
| 323 | 323 |
| 324 *max_age = base::TimeDelta::FromSeconds(max_age_candidate); | 324 *max_age = base::TimeDelta::FromSeconds(max_age_candidate); |
| 325 *include_subdomains = include_subdomains_candidate; | 325 *include_subdomains = include_subdomains_candidate; |
| 326 for (HashValueVector::const_iterator i = pins.begin(); | 326 hashes->swap(pins); |
| 327 i != pins.end(); ++i) { | |
| 328 bool found = false; | |
| 329 | |
| 330 for (HashValueVector::const_iterator j = hashes->begin(); | |
| 331 j != hashes->end(); ++j) { | |
| 332 if (j->Equals(*i)) { | |
| 333 found = true; | |
| 334 break; | |
| 335 } | |
| 336 } | |
| 337 | |
| 338 if (!found) | |
| 339 hashes->push_back(*i); | |
| 340 } | |
| 341 | 327 |
| 342 return true; | 328 return true; |
| 343 } | 329 } |
| 344 | 330 |
| 345 } // namespace net | 331 } // namespace net |
| OLD | NEW |