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

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

Issue 1218243002: Fix some clang warnings with -Wmissing-braces in base. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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
« no previous file with comments | « base/third_party/nspr/prtime.cc ('k') | base/trace_event/trace_event_win.cc » ('j') | 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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 QueryPerformanceCounter(&now); 421 QueryPerformanceCounter(&now);
422 return QPCValueToTimeDelta(now.QuadPart); 422 return QPCValueToTimeDelta(now.QuadPart);
423 } 423 }
424 424
425 bool IsBuggyAthlon(const base::CPU& cpu) { 425 bool IsBuggyAthlon(const base::CPU& cpu) {
426 // On Athlon X2 CPUs (e.g. model 15) QueryPerformanceCounter is unreliable. 426 // On Athlon X2 CPUs (e.g. model 15) QueryPerformanceCounter is unreliable.
427 return cpu.vendor_name() == "AuthenticAMD" && cpu.family() == 15; 427 return cpu.vendor_name() == "AuthenticAMD" && cpu.family() == 15;
428 } 428 }
429 429
430 void InitializeNowFunctionPointers() { 430 void InitializeNowFunctionPointers() {
431 LARGE_INTEGER ticks_per_sec = {0}; 431 LARGE_INTEGER ticks_per_sec = {};
432 if (!QueryPerformanceFrequency(&ticks_per_sec)) 432 if (!QueryPerformanceFrequency(&ticks_per_sec))
433 ticks_per_sec.QuadPart = 0; 433 ticks_per_sec.QuadPart = 0;
434 434
435 // If Windows cannot provide a QPC implementation, both TimeTicks::Now() and 435 // If Windows cannot provide a QPC implementation, both TimeTicks::Now() and
436 // TraceTicks::Now() must use the low-resolution clock. 436 // TraceTicks::Now() must use the low-resolution clock.
437 // 437 //
438 // If the QPC implementation is expensive and/or unreliable, TimeTicks::Now() 438 // If the QPC implementation is expensive and/or unreliable, TimeTicks::Now()
439 // will use the low-resolution clock, but TraceTicks::Now() will use the QPC 439 // will use the low-resolution clock, but TraceTicks::Now() will use the QPC
440 // (in the hope that it is still useful for tracing purposes). A CPU lacking a 440 // (in the hope that it is still useful for tracing purposes). A CPU lacking a
441 // non-stop time counter will cause Windows to provide an alternate QPC 441 // non-stop time counter will cause Windows to provide an alternate QPC
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 TimeTicks TimeTicks::FromQPCValue(LONGLONG qpc_value) { 521 TimeTicks TimeTicks::FromQPCValue(LONGLONG qpc_value) {
522 return TimeTicks() + QPCValueToTimeDelta(qpc_value); 522 return TimeTicks() + QPCValueToTimeDelta(qpc_value);
523 } 523 }
524 524
525 // TimeDelta ------------------------------------------------------------------ 525 // TimeDelta ------------------------------------------------------------------
526 526
527 // static 527 // static
528 TimeDelta TimeDelta::FromQPCValue(LONGLONG qpc_value) { 528 TimeDelta TimeDelta::FromQPCValue(LONGLONG qpc_value) {
529 return QPCValueToTimeDelta(qpc_value); 529 return QPCValueToTimeDelta(qpc_value);
530 } 530 }
OLDNEW
« no previous file with comments | « base/third_party/nspr/prtime.cc ('k') | base/trace_event/trace_event_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698