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

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

Issue 1352523002: Use high precision timestamp for Event.timestamp (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/events/Event.h
diff --git a/third_party/WebKit/Source/core/events/Event.h b/third_party/WebKit/Source/core/events/Event.h
index f0ee9c3637b3875a633d56950d83e070999912c5..0d9f56731fa6a9eb520d1fb225242373d932c3f6 100644
--- a/third_party/WebKit/Source/core/events/Event.h
+++ b/third_party/WebKit/Source/core/events/Event.h
@@ -26,6 +26,7 @@
#include "bindings/core/v8/ScriptWrappable.h"
#include "core/CoreExport.h"
+#include "core/dom/DOMHighResTimeStamp.h"
#include "core/dom/DOMTimeStamp.h"
#include "core/events/EventInit.h"
#include "core/events/EventPath.h"
@@ -122,7 +123,16 @@ public:
bool bubbles() const { return m_canBubble; }
bool cancelable() const { return m_cancelable; }
- DOMTimeStamp timeStamp() const { return m_createTime; }
+
+ // Event creation timestamp in milliseconds. If |HiResEventTimeStamp|
+ // runtime feature is enabled it returns a DOMHighResTimeStamp using the
+ // platform timestamp (see |m_platformTimeStamp|) otherwise it returns a
+ // DOMTimeStamp that represents the current object's construction time (see
+ // |m_createTime|). For more info see http://crbug.com/160524
+ double timeStamp(ScriptState*) const;
+ double platformTimeStamp() const { return m_platformTimeStamp; }
+ void setPlatformTimeStamp(double platformTimeStamp) { m_platformTimeStamp = platformTimeStamp; }
+ DOMTimeStamp createTime() const { return m_createTime; }
void stopPropagation() { m_propagationStopped = true; }
void stopImmediatePropagation() { m_immediatePropagationStopped = true; }
@@ -183,9 +193,6 @@ public:
bool isBeingDispatched() const { return eventPhase(); }
- double uiCreateTime() const { return m_uiCreateTime; }
- void setUICreateTime(double uiCreateTime) { m_uiCreateTime = uiCreateTime; }
-
// Events that must not leak across isolated world, similar to how
// ErrorEvent behaves, can override this method.
virtual bool canBeDispatchedInWorld(const DOMWrapperWorld&) const { return true; }
@@ -225,7 +232,10 @@ private:
DOMTimeStamp m_createTime;
RefPtrWillBeMember<Event> m_underlyingEvent;
OwnPtrWillBeMember<EventPath> m_eventPath;
- double m_uiCreateTime; // For input events, the time the event was recorded by the UI.
+ // The monotonic platform time in seconds, for input events it is the
+ // event timestamp provided by the host OS and reported in the original
+ // WebInputEvent instance.
+ double m_platformTimeStamp;
};
#define DEFINE_EVENT_TYPE_CASTS(typeName) \
« no previous file with comments | « third_party/WebKit/Source/core/dom/DOMHighResTimeStamp.h ('k') | third_party/WebKit/Source/core/events/Event.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698