| 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 "net/base/sdch_manager.h" | 5 #include "net/base/sdch_manager.h" |
| 6 | 6 |
| 7 #include <limits.h> | 7 #include <limits.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 } else if (name == "format-version") { | 375 } else if (name == "format-version") { |
| 376 if (value != "1.0") | 376 if (value != "1.0") |
| 377 return SDCH_DICTIONARY_UNSUPPORTED_VERSION; | 377 return SDCH_DICTIONARY_UNSUPPORTED_VERSION; |
| 378 } else if (name == "max-age") { | 378 } else if (name == "max-age") { |
| 379 int64_t seconds; | 379 int64_t seconds; |
| 380 // TODO(eroman): crbug.com/596541 -- should not accept a leading +. | 380 // TODO(eroman): crbug.com/596541 -- should not accept a leading +. |
| 381 base::StringToInt64(value, &seconds); | 381 base::StringToInt64(value, &seconds); |
| 382 expiration = base::Time::Now() + base::TimeDelta::FromSeconds(seconds); | 382 expiration = base::Time::Now() + base::TimeDelta::FromSeconds(seconds); |
| 383 } else if (name == "port") { | 383 } else if (name == "port") { |
| 384 int port; | 384 int port; |
| 385 if (ParseNonNegativeDecimalInt(value, &port)) | 385 if (ParseInt32(value, ParseIntFormat::NON_NEGATIVE, &port)) |
| 386 ports.insert(port); | 386 ports.insert(port); |
| 387 } | 387 } |
| 388 } | 388 } |
| 389 | 389 |
| 390 if (line_end >= header_end) | 390 if (line_end >= header_end) |
| 391 break; | 391 break; |
| 392 line_start = line_end + 1; | 392 line_start = line_end + 1; |
| 393 } | 393 } |
| 394 | 394 |
| 395 // Narrow fix for http://crbug.com/389451. | 395 // Narrow fix for http://crbug.com/389451. |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 entry_dict->SetInteger("tries", it->second.count); | 474 entry_dict->SetInteger("tries", it->second.count); |
| 475 entry_dict->SetInteger("reason", it->second.reason); | 475 entry_dict->SetInteger("reason", it->second.reason); |
| 476 entry_list->Append(std::move(entry_dict)); | 476 entry_list->Append(std::move(entry_dict)); |
| 477 } | 477 } |
| 478 value->Set("blacklisted", std::move(entry_list)); | 478 value->Set("blacklisted", std::move(entry_list)); |
| 479 | 479 |
| 480 return std::move(value); | 480 return std::move(value); |
| 481 } | 481 } |
| 482 | 482 |
| 483 } // namespace net | 483 } // namespace net |
| OLD | NEW |