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

Unified Diff: third_party/WebKit/Source/core/events/Event.cpp

Issue 2542693002: Use WTF::TimeTicks to represent timestamp in Platform/Core event types (Closed)
Patch Set: rebase 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/events/Event.cpp
diff --git a/third_party/WebKit/Source/core/events/Event.cpp b/third_party/WebKit/Source/core/events/Event.cpp
index f09c2ac6f1782615bf5da6437981e9aa882edfc7..3c9428ad35de9d91b75fd4c960f8ae9597d4369d 100644
--- a/third_party/WebKit/Source/core/events/Event.cpp
+++ b/third_party/WebKit/Source/core/events/Event.cpp
@@ -30,7 +30,6 @@
#include "core/svg/SVGElement.h"
#include "core/timing/DOMWindowPerformance.h"
#include "core/timing/Performance.h"
-#include "wtf/CurrentTime.h"
namespace blink {
@@ -57,7 +56,7 @@ Event::Event() : Event("", false, false) {
Event::Event(const AtomicString& eventType,
bool canBubbleArg,
bool cancelableArg,
- double platformTimeStamp)
+ TimeTicks platformTimeStamp)
: Event(eventType,
canBubbleArg,
cancelableArg,
@@ -72,13 +71,13 @@ Event::Event(const AtomicString& eventType,
canBubbleArg,
cancelableArg,
composedMode,
- monotonicallyIncreasingTime()) {}
+ TimeTicks::Now()) {}
Event::Event(const AtomicString& eventType,
bool canBubbleArg,
bool cancelableArg,
ComposedMode composedMode,
- double platformTimeStamp)
+ TimeTicks platformTimeStamp)
: m_type(eventType),
m_canBubble(canBubbleArg),
m_cancelable(cancelableArg),
@@ -103,7 +102,7 @@ Event::Event(const AtomicString& eventType, const EventInit& initializer)
initializer.cancelable(),
initializer.composed() ? ComposedMode::Composed
: ComposedMode::Scoped,
- monotonicallyIncreasingTime()) {}
+ TimeTicks::Now()) {}
Event::~Event() {}
@@ -329,8 +328,9 @@ double Event::timeStamp(ScriptState* scriptState) const {
if (scriptState && scriptState->domWindow()) {
Performance* performance =
DOMWindowPerformance::performance(*scriptState->domWindow());
+ double timestampSeconds = (m_platformTimeStamp - TimeTicks()).InSecondsF();
timeStamp =
- performance->monotonicTimeToDOMHighResTimeStamp(m_platformTimeStamp);
+ performance->monotonicTimeToDOMHighResTimeStamp(timestampSeconds);
}
return timeStamp;
« no previous file with comments | « third_party/WebKit/Source/core/events/Event.h ('k') | third_party/WebKit/Source/core/events/EventTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698