Chromium Code Reviews| Index: net/disk_cache/blockfile/eviction.cc |
| diff --git a/net/disk_cache/blockfile/eviction.cc b/net/disk_cache/blockfile/eviction.cc |
| index 52fca5fb7d0254ca1c0194bfd8a3268e9e48310e..c2d60c4f344cb3ab466e3ed0070f242a87cd39bd 100644 |
| --- a/net/disk_cache/blockfile/eviction.cc |
| +++ b/net/disk_cache/blockfile/eviction.cc |
| @@ -275,12 +275,15 @@ void Eviction::ReportTrimTimes(EntryImpl* entry) { |
| backend_->FirstEviction(); |
| } else { |
| // This is an old file, but we may want more reports from this user so |
| - // lets save some create_time. |
| + // lets save some create_time. Conversion cannot fail here. |
| Time::Exploded old = {0}; |
| old.year = 2009; |
| old.month = 3; |
| old.day_of_month = 1; |
| - header_->create_time = Time::FromLocalExploded(old).ToInternalValue(); |
| + base::Time out_time; |
| + bool conversion_success = Time::FromLocalExploded(old, &out_time); |
|
eroman
2016/10/20 18:05:21
The existing code is not great. My suggestion is t
maksims (do not use this acc)
2016/10/26 08:16:40
Done.
|
| + DCHECK(conversion_success); |
| + header_->create_time = out_time.ToInternalValue(); |
| } |
| } |
| } |