Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(359)

Unified Diff: net/disk_cache/blockfile/eviction.cc

Issue 2090713003: Make callers of FromUTC(Local)Exploded in net/ use new time API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make callers of FromUTC(Local)Exploded in net/ use new time API. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
+ DCHECK(conversion_success);
+ header_->create_time = out_time.ToInternalValue();
}
}
}

Powered by Google App Engine
This is Rietveld 408576698