OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/base/transport_security_state.h" | 5 #include "net/base/transport_security_state.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 continue; | 135 continue; |
136 if (*tokenizer.token_begin() != '=') | 136 if (*tokenizer.token_begin() != '=') |
137 return false; | 137 return false; |
138 DCHECK(tokenizer.token().length() == 1); | 138 DCHECK(tokenizer.token().length() == 1); |
139 state = AFTER_MAX_AGE_EQUALS; | 139 state = AFTER_MAX_AGE_EQUALS; |
140 break; | 140 break; |
141 | 141 |
142 case AFTER_MAX_AGE_EQUALS: | 142 case AFTER_MAX_AGE_EQUALS: |
143 if (IsAsciiWhitespace(*tokenizer.token_begin())) | 143 if (IsAsciiWhitespace(*tokenizer.token_begin())) |
144 continue; | 144 continue; |
145 if (!base::StringToInt(tokenizer.token(), &max_age_candidate)) | 145 if (!base::StringToInt(tokenizer.token_begin(), |
| 146 tokenizer.token_end(), |
| 147 &max_age_candidate)) |
146 return false; | 148 return false; |
147 if (max_age_candidate < 0) | 149 if (max_age_candidate < 0) |
148 return false; | 150 return false; |
149 state = AFTER_MAX_AGE; | 151 state = AFTER_MAX_AGE; |
150 break; | 152 break; |
151 | 153 |
152 case AFTER_MAX_AGE: | 154 case AFTER_MAX_AGE: |
153 if (IsAsciiWhitespace(*tokenizer.token_begin())) | 155 if (IsAsciiWhitespace(*tokenizer.token_begin())) |
154 continue; | 156 continue; |
155 if (*tokenizer.token_begin() != ';') | 157 if (*tokenizer.token_begin() != ';') |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 *include_subdomains = kPreloadedSTS[j].include_subdomains; | 422 *include_subdomains = kPreloadedSTS[j].include_subdomains; |
421 return true; | 423 return true; |
422 } | 424 } |
423 } | 425 } |
424 } | 426 } |
425 | 427 |
426 return false; | 428 return false; |
427 } | 429 } |
428 | 430 |
429 } // namespace | 431 } // namespace |
OLD | NEW |