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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 11591006: Track input latency with UMA stats (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added per event type histograms Created 7 years, 11 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: content/browser/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 49ef41bdbf3c2fd5507f79ae94ec132b5bd4c33c..4b8628209a4242f1e49229814c240c40517c4237 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -43,6 +43,7 @@
#include "ui/aura/window_tracker.h"
#include "ui/base/clipboard/scoped_clipboard_writer.h"
#include "ui/base/events/event.h"
+#include "ui/base/events/event_utils.h"
#include "ui/base/gestures/gesture_recognizer.h"
#include "ui/base/hit_test.h"
#include "ui/base/ime/input_method.h"
@@ -1150,12 +1151,13 @@ void RenderWidgetHostViewAura::InsertChar(char16 ch, int flags) {
}
if (host_) {
+ double now = ui::EventTimeForNow().InSecondsF();
// Send a WebKit::WebInputEvent::Char event to |host_|.
NativeWebKeyboardEvent webkit_event(ui::ET_KEY_PRESSED,
true /* is_char */,
ch,
flags,
- base::Time::Now().ToDoubleT());
+ now);
host_->ForwardKeyboardEvent(webkit_event);
}
}
@@ -1458,12 +1460,13 @@ void RenderWidgetHostViewAura::OnKeyEvent(ui::KeyEvent* event) {
// Send a fabricated event, which is usually a VKEY_PROCESSKEY IME event.
// For keys like VK_BACK/VK_LEFT, etc we need to send the raw keycode to
// the renderer.
+ double now = ui::EventTimeForNow().InSecondsF();
NativeWebKeyboardEvent webkit_event(
event->type(),
false /* is_char */,
event->GetCharacter() ? event->GetCharacter() : event->key_code(),
event->flags(),
- base::Time::Now().ToDoubleT());
+ now);
host_->ForwardKeyboardEvent(webkit_event);
} else {
NativeWebKeyboardEvent webkit_event(event);
« no previous file with comments | « chrome/browser/ui/panels/panel_browsertest.cc ('k') | content/browser/renderer_host/render_widget_host_view_aura_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698