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

Unified Diff: components/autofill/content/browser/risk/fingerprint.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/autofill/content/browser/risk/fingerprint.cc
diff --git a/components/autofill/content/browser/risk/fingerprint.cc b/components/autofill/content/browser/risk/fingerprint.cc
index 08ed54eb772b256dc17b4fd375f9b93030c4a24b..02f76e23bf192bdf666e37d0481e1c624523012b 100644
--- a/components/autofill/content/browser/risk/fingerprint.cc
+++ b/components/autofill/content/browser/risk/fingerprint.cc
@@ -65,8 +65,14 @@ base::TimeDelta GetTimezoneOffset() {
base::Time::Exploded local;
utc.LocalExplode(&local);
-
- return base::Time::FromUTCExploded(local) - utc;
+ base::Time out_time;
+ // |out_time| is set to Time(0) on failure.
+ if (!base::Time::FromUTCExploded(local, &out_time)) {
vabr (Chromium) 2016/06/28 14:34:12 Given that the exploded value comes from the resul
maksims (do not use this acc) 2016/06/29 05:48:59 Correct, it will never fail in this case.
+ // TODO(maksims): implement error handling.
+ // |out_time| is Time(0) here.
+ NOTIMPLEMENTED();
+ }
+ return out_time - utc;
}
// Returns the concatenation of the operating system name and version, e.g.

Powered by Google App Engine
This is Rietveld 408576698