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

Side by Side Diff: base/time.h

Issue 11453012: Fix black background when locking with fullscreen window: (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Another attempt to fix win build Created 8 years 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/test/scoped_time_controller.cc ('k') | base/time.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 // Time represents an absolute point in time, internally represented as 5 // Time represents an absolute point in time, internally represented as
6 // microseconds (s/1,000,000) since the Windows epoch (1601-01-01 00:00:00 UTC) 6 // microseconds (s/1,000,000) since the Windows epoch (1601-01-01 00:00:00 UTC)
7 // (See http://crbug.com/14734). System-dependent clock interface routines are 7 // (See http://crbug.com/14734). System-dependent clock interface routines are
8 // defined in time_PLATFORM.cc. 8 // defined in time_PLATFORM.cc.
9 // 9 //
10 // TimeDelta represents a duration of time, internally represented in 10 // TimeDelta represents a duration of time, internally represented in
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 #if defined(OS_WIN) 631 #if defined(OS_WIN)
632 typedef DWORD (*TickFunctionType)(void); 632 typedef DWORD (*TickFunctionType)(void);
633 static TickFunctionType SetMockTickFunction(TickFunctionType ticker); 633 static TickFunctionType SetMockTickFunction(TickFunctionType ticker);
634 #endif 634 #endif
635 }; 635 };
636 636
637 inline TimeTicks TimeDelta::operator+(TimeTicks t) const { 637 inline TimeTicks TimeDelta::operator+(TimeTicks t) const {
638 return TimeTicks(t.ticks_ + delta_); 638 return TimeTicks(t.ticks_ + delta_);
639 } 639 }
640 640
641 // TimeFactory ----------------------------------------------------------------
642
643 class BASE_EXPORT TimeFactory {
644 public:
645 virtual Time TimeNow() = 0;
646 virtual TimeTicks TimeTicksNow() = 0;
647 virtual TimeTicks TimeTicksHighResNow() = 0;
648
649 static TimeFactory* instance() { return instance_; }
650
651 protected:
652 static TimeFactory* instance_;
akalin 2012/12/12 00:58:12 This scares me. Overriding time globally seems li
Denis Kuznetsov (DE-MUC) 2012/12/12 19:20:13 That was my initial approach, but Scott insisted t
sky 2012/12/12 20:42:23 I prefer mocking at a central place. It means supp
653 };
654
641 } // namespace base 655 } // namespace base
642 656
643 #endif // BASE_TIME_H_ 657 #endif // BASE_TIME_H_
OLDNEW
« no previous file with comments | « base/test/scoped_time_controller.cc ('k') | base/time.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698