WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
patch
Patch (text/plain), 1.71 KB, created by
Jason Liu
on 2011-06-06 18:44:23 PDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Jason Liu
Created:
2011-06-06 18:44:23 PDT
Size:
1.71 KB
patch
obsolete
>diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 9a60626..a36a711 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,13 @@ >+2011-06-07 Jason Liu <jason.liu@torchmobile.com.cn> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Implement montonicallyIncreasingClock() on Linux >+ https://bugs.webkit.org/show_bug.cgi?id=62159 >+ >+ * wtf/CurrentTime.cpp: >+ (WTF::montonicallyIncreasingClock): >+ > 2011-05-30 Hojong Han <hojong.han@samsung.com> > > Reviewed by Geoffrey Garen. >diff --git a/Source/JavaScriptCore/wtf/CurrentTime.cpp b/Source/JavaScriptCore/wtf/CurrentTime.cpp >index 4205227..667f5ab 100644 >--- a/Source/JavaScriptCore/wtf/CurrentTime.cpp >+++ b/Source/JavaScriptCore/wtf/CurrentTime.cpp >@@ -61,6 +61,9 @@ extern "C" time_t mktime(struct tm *t); > #include <AEEStdLib.h> > #else > #include <sys/time.h> >+#include <sys/times.h> >+#include <unistd.h> >+#include <wtf/AlwaysInline.h> > #endif > > #if PLATFORM(CHROMIUM) >@@ -294,4 +297,26 @@ double currentTime() > > #endif > >+#if OS(LINUX) >+ >+#if PLATFORM(QT) >+ >+double montonicallyIncreasingClock() >+{ >+ static struct tms tmsUnused; >+ static double startTime = currentTime(); >+ static clock_t startTicks = times(&tmsUnused); >+ static long int ticksPerSecond = sysconf(_SC_CLK_TCK); >+ clock_t currentTicks = times(&tmsUnused); >+ // Overflow, just fallback to currentTime() >+ if (UNLIKELY(startTicks == static_cast<clock_t>(-1) || currentTicks == static_cast<clock_t>(-1))) >+ return currentTime(); >+ ASSERT(ticksPerSecond > 0); >+ return startTime + static_cast<double>(currentTicks - startTicks) / ticksPerSecond; >+} >+ >+#endif >+ >+#endif >+ > } // namespace WTF
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 62159
:
96168
| 96172 |
96920
|
96928
|
97056
|
97221
|
120081
|
120219