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

Unified Diff: components/ntp_snippets/ntp_snippets_service.cc

Issue 2095553002: Make callers of FromUTC(Local)Exploded in components/ use new time API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 6 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: components/ntp_snippets/ntp_snippets_service.cc
diff --git a/components/ntp_snippets/ntp_snippets_service.cc b/components/ntp_snippets/ntp_snippets_service.cc
index 48b3f0b11128729b6bde2273f06ad6b2b9e3d658..cd09266a2d376098cb37bf65521aa6ca4e4d23fd 100644
--- a/components/ntp_snippets/ntp_snippets_service.cc
+++ b/components/ntp_snippets/ntp_snippets_service.cc
@@ -140,7 +140,14 @@ base::Time GetRescheduleTime(const base::Time& now) {
exploded.minute = 0;
exploded.second = 0;
exploded.millisecond = 0;
- base::Time reschedule = base::Time::FromLocalExploded(exploded);
+ base::Time reschedule;
+ if (!base::Time::FromLocalExploded(exploded, &reschedule)) {
sfiera 2016/06/28 14:13:28 Here, we are combining YMD of a valid date (from L
maksims (do not use this acc) 2016/06/29 05:48:59 [1] Me neither. Well, it seems like it shouldn't
sfiera 2016/06/29 09:15:11 TL;DR this code can fail in Western Greenland. Se
maksims (do not use this acc) 2016/06/30 07:33:14 Check the latests patch. Is it fine now? Did I und
sfiera 2016/06/30 08:41:50 I was suggesting: return GetRescheduleTime(now
maksims (do not use this acc) 2016/07/04 07:34:04 Done.
sfiera 2016/07/04 07:48:20 Thanks! I also looked at the other changes you've
+ // TODO(maksims): implement error handling here.
+ // We might just return |reschedule|, which is Time(0) here.
+ NOTIMPLEMENTED();
+ return reschedule;
+ }
+
if (next_day)
reschedule += base::TimeDelta::FromDays(1);

Powered by Google App Engine
This is Rietveld 408576698