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

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

Issue 1550563002: Blink Platform: Remove time functions from Platform. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merrrge agaaain. Created 4 years, 10 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
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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 // Same thing, in milliseconds. 44 // Same thing, in milliseconds.
45 inline double currentTimeMS() 45 inline double currentTimeMS()
46 { 46 {
47 return currentTime() * 1000.0; 47 return currentTime() * 1000.0;
48 } 48 }
49 49
50 // Provides a monotonically increasing time in seconds since an arbitrary point in the past. 50 // Provides a monotonically increasing time in seconds since an arbitrary point in the past.
51 // On unsupported platforms, this function only guarantees the result will be no n-decreasing. 51 // On unsupported platforms, this function only guarantees the result will be no n-decreasing.
52 WTF_EXPORT double monotonicallyIncreasingTime(); 52 WTF_EXPORT double monotonicallyIncreasingTime();
53 53
54 typedef double(*TimeFunction)(void); 54 using TimeFunction = double (*)();
55 void setCurrentTimeFunction(TimeFunction); 55
56 WTF_EXPORT void setMonotonicallyIncreasingTimeFunction(TimeFunction); 56 // Make all the time functions (currentTime(), monotonicallyIncreasingTime(), sy stemTraceTime()) return the result
57 // of the supplied function. Returns the pointer to the old time function. For b oth setting and getting, nullptr means
58 // using the default timing function returning the actual time.
59 WTF_EXPORT TimeFunction setTimeFunctionsForTesting(TimeFunction);
57 60
58 } // namespace WTF 61 } // namespace WTF
59 62
60 using WTF::currentTime; 63 using WTF::currentTime;
61 using WTF::currentTimeMS; 64 using WTF::currentTimeMS;
62 using WTF::monotonicallyIncreasingTime; 65 using WTF::monotonicallyIncreasingTime;
66 using WTF::TimeFunction;
67 using WTF::setTimeFunctionsForTesting;
63 68
64 #endif // CurrentTime_h 69 #endif // CurrentTime_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/tests/TextFinderTest.cpp ('k') | third_party/WebKit/Source/wtf/CurrentTime.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698