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

Unified Diff: third_party/WebKit/Source/core/html/forms/TypeAhead.cpp

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/html/forms/TypeAhead.cpp
diff --git a/third_party/WebKit/Source/core/html/forms/TypeAhead.cpp b/third_party/WebKit/Source/core/html/forms/TypeAhead.cpp
index 38bbef17c0776c5fde21bdf6d16ef1fff98aa172..4415ea92789cd36f02533a4a4ab74c1422dab46b 100644
--- a/third_party/WebKit/Source/core/html/forms/TypeAhead.cpp
+++ b/third_party/WebKit/Source/core/html/forms/TypeAhead.cpp
@@ -42,7 +42,7 @@ TypeAhead::TypeAhead(TypeAheadDataSource* dataSource)
{
}
-static const DOMTimeStamp typeAheadTimeout = 1000;
+static const double typeAheadTimeout = 1; // in seconds
static String stripLeadingWhiteSpace(const String& string)
{
@@ -59,12 +59,12 @@ static String stripLeadingWhiteSpace(const String& string)
int TypeAhead::handleEvent(KeyboardEvent* event, MatchModeFlags matchMode)
{
- if (event->timeStamp() < m_lastTypeTime)
+ if (event->platformTimeStamp() < m_lastTypeTime)
return -1;
int optionCount = m_dataSource->optionCount();
- DOMTimeStamp delta = event->timeStamp() - m_lastTypeTime;
- m_lastTypeTime = event->timeStamp();
+ double delta = event->platformTimeStamp() - m_lastTypeTime;
+ m_lastTypeTime = event->platformTimeStamp();
UChar c = event->charCode();
@@ -122,7 +122,7 @@ int TypeAhead::handleEvent(KeyboardEvent* event, MatchModeFlags matchMode)
bool TypeAhead::hasActiveSession(KeyboardEvent* event)
{
- DOMTimeStamp delta = event->timeStamp() - m_lastTypeTime;
+ double delta = event->platformTimeStamp() - m_lastTypeTime;
return delta <= typeAheadTimeout;
}
« no previous file with comments | « third_party/WebKit/Source/core/html/forms/TypeAhead.h ('k') | third_party/WebKit/Source/core/loader/FrameLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698