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

Unified Diff: Source/core/layout/LayoutView.cpp

Issue 1170153004: DevTools Timeline: expose HitTest event (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 | « Source/core/inspector/InspectorTraceEvents.cpp ('k') | Source/devtools/front_end/timeline/TimelineModel.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutView.cpp
diff --git a/Source/core/layout/LayoutView.cpp b/Source/core/layout/LayoutView.cpp
index c1790151cc635db4c78a5b810bc41ca3bbf8b1be..9f3743d7308a479a3ad0b113ff31ee39d32c29b4 100644
--- a/Source/core/layout/LayoutView.cpp
+++ b/Source/core/layout/LayoutView.cpp
@@ -28,6 +28,7 @@
#include "core/frame/Settings.h"
#include "core/html/HTMLFrameOwnerElement.h"
#include "core/html/HTMLIFrameElement.h"
+#include "core/inspector/InspectorTraceEvents.h"
#include "core/layout/HitTestResult.h"
#include "core/layout/LayoutFlowThread.h"
#include "core/layout/LayoutGeometryMap.h"
@@ -83,38 +84,9 @@ bool LayoutView::hitTest(HitTestResult& result)
return hitTest(result.hitTestRequest(), result.hitTestLocation(), result);
}
-namespace {
-
-PassRefPtr<TracedValue> hitTestInfo(const HitTestRequest& request, const HitTestLocation& location, const HitTestResult& result)
-{
- RefPtr<TracedValue> value(TracedValue::create());
- value->setInteger("x", location.roundedPoint().x());
- value->setInteger("y", location.roundedPoint().y());
- if (location.isRectBasedTest())
- value->setBoolean("rect", true);
- if (location.isRectilinear())
- value->setBoolean("rectilinear", true);
- if (request.touchEvent())
- value->setBoolean("touch", true);
- if (request.move())
- value->setBoolean("move", true);
- if (request.listBased()) {
- value->setBoolean("listBased", true);
- } else if (Node* node = result.innerNode()) {
- value->setString("nodeAddress", String::format("%" PRIx64, static_cast<uint64>(reinterpret_cast<intptr_t>(node))));
- value->setString("tag", node->nodeName());
- Element* elem = result.innerElement();
- if (elem && elem->hasID())
- value->setString("htmlId", elem->getIdAttribute());
- }
- return value;
-}
-
-} // anonymous namespace
-
bool LayoutView::hitTest(const HitTestRequest& request, const HitTestLocation& location, HitTestResult& result)
{
- TRACE_EVENT_BEGIN0("blink", "LayoutView::hitTest");
+ TRACE_EVENT_BEGIN0("blink,devtools.timeline", "HitTest");
m_hitTestCount++;
ASSERT(!location.isRectBasedTest() || request.listBased());
@@ -136,7 +108,7 @@ bool LayoutView::hitTest(const HitTestRequest& request, const HitTestLocation& l
if (Scrollbar* frameScrollbar = frameView()->scrollbarAtFramePoint(framePoint))
result.setScrollbar(frameScrollbar);
- TRACE_EVENT_END1("blink", "LayoutView::hitTest", "info", hitTestInfo(request, location, result));
yurys 2015/06/09 16:39:52 Is there a special handling of the info param that
+ TRACE_EVENT_END1("blink,devtools.timeline", "HitTest", "endData", InspectorHitTestEvent::endData(request, location, result));
return hitLayer;
}
« no previous file with comments | « Source/core/inspector/InspectorTraceEvents.cpp ('k') | Source/devtools/front_end/timeline/TimelineModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698