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

Unified Diff: ppapi/shared_impl/time_conversion.cc

Issue 2084503008: Make callers of FromUTC(Local)Exploded in ppapi/ use new time API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/time_conversion.cc
diff --git a/ppapi/shared_impl/time_conversion.cc b/ppapi/shared_impl/time_conversion.cc
index 651274a73cc9a40062afc38fb7f0821f48d35e5b..76946b2d129c0e2ab2ac53dfb9840c2b9019833a 100644
--- a/ppapi/shared_impl/time_conversion.cc
+++ b/ppapi/shared_impl/time_conversion.cc
@@ -32,9 +32,12 @@ double PPGetLocalTimeZoneOffset(const base::Time& time) {
time.LocalExplode(&exploded);
time.UTCExplode(&utc_exploded);
if (exploded.HasValidValues() && utc_exploded.HasValidValues()) {
- base::Time adj_time = base::Time::FromUTCExploded(exploded);
- base::Time cur = base::Time::FromUTCExploded(utc_exploded);
- return (adj_time - cur).InSecondsF();
+ base::Time adj_time;
+ if (base::Time::FromUTCExploded(exploded, &adj_time)) {
+ base::Time cur;
+ if (base::Time::FromUTCExploded(utc_exploded, &cur))
+ return (adj_time - cur).InSecondsF();
+ }
}
return 0.0;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698