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

Unified Diff: google_apis/drive/time_util.cc

Issue 2091663002: Make callers of FromUTC(Local)Exploded in google_apis/ use new time API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments 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
« no previous file with comments | « google_apis/drive/drive_api_requests_unittest.cc ('k') | google_apis/drive/time_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/drive/time_util.cc
diff --git a/google_apis/drive/time_util.cc b/google_apis/drive/time_util.cc
index 5a559cc08fed7f726b4baae3bae1d336709e68ef..806e15889ede98dd49f7cf64433ed2f1f7393fa1 100644
--- a/google_apis/drive/time_util.cc
+++ b/google_apis/drive/time_util.cc
@@ -143,11 +143,13 @@ bool GetTimeFromString(const base::StringPiece& raw_value,
return false;
if (has_timezone) {
- *parsed_time = base::Time::FromUTCExploded(exploded);
+ if (!base::Time::FromUTCExploded(exploded, parsed_time))
+ return false;
if (offset_to_utc_in_minutes != 0)
*parsed_time -= base::TimeDelta::FromMinutes(offset_to_utc_in_minutes);
} else {
- *parsed_time = base::Time::FromLocalExploded(exploded);
+ if (!base::Time::FromLocalExploded(exploded, parsed_time))
+ return false;
}
return true;
« no previous file with comments | « google_apis/drive/drive_api_requests_unittest.cc ('k') | google_apis/drive/time_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698