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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 318753008: Add tracing output for the name of an input event to Blink. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Added comment. Created 6 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index f3c093c2a37dbe3811c44b3143fb8eb487cd7611..13519ba1e4943bf9021978645316e908d2fc0d12 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -1808,6 +1808,48 @@ bool WebViewImpl::hasVerticalScrollbar()
const WebInputEvent* WebViewImpl::m_currentInputEvent = 0;
+// FIXME: autogenerate this kind of code, and use it throughout Blink rather than
+// the one-offs for subsets of these values.
+static const AtomicString* inputTypeToName(WebInputEvent::Type type)
+{
+ switch (type) {
+ case WebInputEvent::MouseDown:
+ return &EventTypeNames::mousedown;
+ case WebInputEvent::MouseUp:
+ return &EventTypeNames::mouseup;
+ case WebInputEvent::MouseMove:
+ return &EventTypeNames::mousemove;
+ case WebInputEvent::MouseEnter:
+ return &EventTypeNames::mouseenter;
+ case WebInputEvent::MouseLeave:
+ return &EventTypeNames::mouseleave;
+ case WebInputEvent::ContextMenu:
+ return &EventTypeNames::contextmenu;
+ case WebInputEvent::MouseWheel:
+ return &EventTypeNames::mousewheel;
+ case WebInputEvent::KeyDown:
+ return &EventTypeNames::keydown;
+ case WebInputEvent::KeyUp:
+ return &EventTypeNames::keyup;
+ case WebInputEvent::GestureScrollBegin:
+ return &EventTypeNames::gesturescrollstart;
+ case WebInputEvent::GestureScrollEnd:
+ return &EventTypeNames::gesturescrollend;
+ case WebInputEvent::GestureScrollUpdate:
+ return &EventTypeNames::gesturescrollupdate;
+ case WebInputEvent::TouchStart:
+ return &EventTypeNames::touchstart;
+ case WebInputEvent::TouchMove:
+ return &EventTypeNames::touchmove;
+ case WebInputEvent::TouchEnd:
+ return &EventTypeNames::touchend;
+ case WebInputEvent::TouchCancel:
+ return &EventTypeNames::touchcancel;
+ default:
+ return 0;
+ }
+}
+
bool WebViewImpl::handleInputEvent(const WebInputEvent& inputEvent)
{
UserGestureNotifier notifier(m_autofillClient, &m_userGestureObserved);
@@ -1823,7 +1865,8 @@ bool WebViewImpl::handleInputEvent(const WebInputEvent& inputEvent)
m_autofillClient->firstUserGestureObserved();
}
- TRACE_EVENT0("input", "WebViewImpl::handleInputEvent");
+ const AtomicString* inputEventName = inputTypeToName(inputEvent.type);
+ TRACE_EVENT1("input", "WebViewImpl::handleInputEvent", "type", inputEventName ? TRACE_STR_COPY(inputEventName->ascii().data()) : "unknown");
// If we've started a drag and drop operation, ignore input events until
// we're done.
if (m_doingDragAndDrop)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698