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

Unified Diff: base/time/time_win.cc

Issue 2022913002: Revert of Add: check exploded time is properly converted (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « base/time/time_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/time/time_win.cc
diff --git a/base/time/time_win.cc b/base/time/time_win.cc
index 8708eb21c90697112771f8a31a4490fa43ebd127..ac3197a0c709140addd9145252789525a96e72e2 100644
--- a/base/time/time_win.cc
+++ b/base/time/time_win.cc
@@ -235,7 +235,7 @@
}
// static
-bool Time::FromExploded(bool is_local, const Exploded& exploded, Time* time) {
+Time Time::FromExploded(bool is_local, const Exploded& exploded) {
// Create the system struct representing our exploded time. It will either be
// in local time or UTC.
SYSTEMTIME st;
@@ -253,19 +253,17 @@
// Ensure that it's in UTC.
if (is_local) {
SYSTEMTIME utc_st;
- success = TzSpecificLocalTimeToSystemTime(nullptr, &st, &utc_st) &&
+ success = TzSpecificLocalTimeToSystemTime(NULL, &st, &utc_st) &&
SystemTimeToFileTime(&utc_st, &ft);
} else {
success = !!SystemTimeToFileTime(&st, &ft);
}
if (!success) {
- *time = Time(0);
- return false;
- }
-
- *time = Time(FileTimeToMicroseconds(ft));
- return true;
+ NOTREACHED() << "Unable to convert time";
+ return Time(0);
+ }
+ return Time(FileTimeToMicroseconds(ft));
}
void Time::Explode(bool is_local, Exploded* exploded) const {
@@ -290,7 +288,7 @@
// daylight saving time, it will take daylight saving time into account,
// even if the time you are converting is in standard time.
success = FileTimeToSystemTime(&utc_ft, &utc_st) &&
- SystemTimeToTzSpecificLocalTime(nullptr, &utc_st, &st);
+ SystemTimeToTzSpecificLocalTime(NULL, &utc_st, &st);
} else {
success = !!FileTimeToSystemTime(&utc_ft, &st);
}
« no previous file with comments | « base/time/time_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698