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

Side by Side Diff: base/time/time_win.cc

Issue 368133002: Fixes for re-enabling more MSVC level 4 warnings: base/ edition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix build, attempt 2 Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/strings/string_util_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 5
6 // Windows Timer Primer 6 // Windows Timer Primer
7 // 7 //
8 // A good article: http://www.ddj.com/windows/184416651 8 // A good article: http://www.ddj.com/windows/184416651
9 // A good mozilla bug: http://bugzilla.mozilla.org/show_bug.cgi?id=363258 9 // A good mozilla bug: http://bugzilla.mozilla.org/show_bug.cgi?id=363258
10 // 10 //
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 return; 244 return;
245 } 245 }
246 246
247 // FILETIME in UTC. 247 // FILETIME in UTC.
248 FILETIME utc_ft; 248 FILETIME utc_ft;
249 MicrosecondsToFileTime(us_, &utc_ft); 249 MicrosecondsToFileTime(us_, &utc_ft);
250 250
251 // FILETIME in local time if necessary. 251 // FILETIME in local time if necessary.
252 bool success = true; 252 bool success = true;
253 // FILETIME in SYSTEMTIME (exploded). 253 // FILETIME in SYSTEMTIME (exploded).
254 SYSTEMTIME st; 254 SYSTEMTIME st = {0};
255 if (is_local) { 255 if (is_local) {
256 SYSTEMTIME utc_st; 256 SYSTEMTIME utc_st;
257 // We don't use FileTimeToLocalFileTime here, since it uses the current 257 // We don't use FileTimeToLocalFileTime here, since it uses the current
258 // settings for the time zone and daylight saving time. Therefore, if it is 258 // settings for the time zone and daylight saving time. Therefore, if it is
259 // daylight saving time, it will take daylight saving time into account, 259 // daylight saving time, it will take daylight saving time into account,
260 // even if the time you are converting is in standard time. 260 // even if the time you are converting is in standard time.
261 success = FileTimeToSystemTime(&utc_ft, &utc_st) && 261 success = FileTimeToSystemTime(&utc_ft, &utc_st) &&
262 SystemTimeToTzSpecificLocalTime(NULL, &utc_st, &st); 262 SystemTimeToTzSpecificLocalTime(NULL, &utc_st, &st);
263 } else { 263 } else {
264 success = !!FileTimeToSystemTime(&utc_ft, &st); 264 success = !!FileTimeToSystemTime(&utc_ft, &st);
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 return TimeTicks() + TimeDelta::FromMilliseconds(timeGetTime()); 527 return TimeTicks() + TimeDelta::FromMilliseconds(timeGetTime());
528 } 528 }
529 } 529 }
530 530
531 // TimeDelta ------------------------------------------------------------------ 531 // TimeDelta ------------------------------------------------------------------
532 532
533 // static 533 // static
534 TimeDelta TimeDelta::FromQPCValue(LONGLONG qpc_value) { 534 TimeDelta TimeDelta::FromQPCValue(LONGLONG qpc_value) {
535 return TimeDelta(GetHighResNowSingleton()->QPCValueToMicroseconds(qpc_value)); 535 return TimeDelta(GetHighResNowSingleton()->QPCValueToMicroseconds(qpc_value));
536 } 536 }
OLDNEW
« no previous file with comments | « base/strings/string_util_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698