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

Side by Side Diff: third_party/WebKit/Source/wtf/CurrentTime.h

Issue 2543663002: Provide simple wrappers for base/time types in WTF (Closed)
Patch Set: Consistent mocking Created 4 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 | « third_party/WebKit/Source/wtf/BUILD.gn ('k') | third_party/WebKit/Source/wtf/CurrentTime.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
3 * Copyright (C) 2008 Google Inc. All rights reserved. 3 * Copyright (C) 2008 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 } 57 }
58 58
59 using TimeFunction = double (*)(); 59 using TimeFunction = double (*)();
60 60
61 // Make all the time functions (currentTime(), monotonicallyIncreasingTime(), 61 // Make all the time functions (currentTime(), monotonicallyIncreasingTime(),
62 // systemTraceTime()) return the result of the supplied function. Returns the 62 // systemTraceTime()) return the result of the supplied function. Returns the
63 // pointer to the old time function. For both setting and getting, nullptr 63 // pointer to the old time function. For both setting and getting, nullptr
64 // means using the default timing function returning the actual time. 64 // means using the default timing function returning the actual time.
65 WTF_EXPORT TimeFunction setTimeFunctionsForTesting(TimeFunction); 65 WTF_EXPORT TimeFunction setTimeFunctionsForTesting(TimeFunction);
66 66
67 // Allows wtf/Time.h to use the same mock time function
68 WTF_EXPORT TimeFunction getTimeFunctionForTesting();
69
67 } // namespace WTF 70 } // namespace WTF
68 71
69 using WTF::currentTime; 72 using WTF::currentTime;
70 using WTF::currentTimeMS; 73 using WTF::currentTimeMS;
71 using WTF::monotonicallyIncreasingTime; 74 using WTF::monotonicallyIncreasingTime;
72 using WTF::monotonicallyIncreasingTimeMS; 75 using WTF::monotonicallyIncreasingTimeMS;
73 using WTF::TimeFunction; 76 using WTF::TimeFunction;
74 using WTF::setTimeFunctionsForTesting; 77 using WTF::setTimeFunctionsForTesting;
75 78
76 #endif // CurrentTime_h 79 #endif // CurrentTime_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/BUILD.gn ('k') | third_party/WebKit/Source/wtf/CurrentTime.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698