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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp

Issue 2737863002: DevTools: move counter-related devtools.timeline trace events into probe:: probes. (Closed)
Patch Set: same Created 3 years, 9 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/inspector/InspectorTraceEvents.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp b/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp
index 79d441d42da26f94383f52b9c86716a05ed98663..0de5ae0cdec09d4e9084e1758fcbd6afaf108386 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp
@@ -19,7 +19,9 @@
#include "core/frame/FrameView.h"
#include "core/frame/LocalFrame.h"
#include "core/html/HTMLFrameOwnerElement.h"
+#include "core/html/parser/HTMLDocumentParser.h"
#include "core/inspector/IdentifiersFactory.h"
+#include "core/inspector/InspectorInstrumentation.h"
#include "core/layout/HitTestResult.h"
#include "core/layout/LayoutImage.h"
#include "core/layout/LayoutObject.h"
@@ -130,6 +132,48 @@ void InspectorTraceEvents::didFailLoading(unsigned long identifier,
InspectorResourceFinishEvent::data(identifier, 0, true, 0, 0));
}
+void InspectorTraceEvents::will(const probe::ExecuteScript&) {}
+
+void InspectorTraceEvents::did(const probe::ExecuteScript&) {
+ TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"),
+ "UpdateCounters", TRACE_EVENT_SCOPE_THREAD, "data",
+ InspectorUpdateCountersEvent::data());
+}
+
+void InspectorTraceEvents::will(const probe::ParseHTML& probe) {
+ // FIXME: Pass in current input length.
+ TRACE_EVENT_BEGIN1(
+ "devtools.timeline", "ParseHTML", "beginData",
+ InspectorParseHtmlEvent::beginData(
+ probe.parser->document(), probe.parser->lineNumber().zeroBasedInt()));
+}
+
+void InspectorTraceEvents::did(const probe::ParseHTML& probe) {
+ TRACE_EVENT_END1("devtools.timeline", "ParseHTML", "endData",
+ InspectorParseHtmlEvent::endData(
+ probe.parser->lineNumber().zeroBasedInt() - 1));
+ TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"),
+ "UpdateCounters", TRACE_EVENT_SCOPE_THREAD, "data",
+ InspectorUpdateCountersEvent::data());
+}
+
+void InspectorTraceEvents::will(const probe::CallFunction& probe) {
+ if (probe.depth)
+ return;
+ TRACE_EVENT_BEGIN1(
+ "devtools.timeline", "FunctionCall", "data",
+ InspectorFunctionCallEvent::data(probe.context, probe.function));
+}
+
+void InspectorTraceEvents::did(const probe::CallFunction& probe) {
+ if (probe.depth)
+ return;
+ TRACE_EVENT_END0("devtools.timeline", "FunctionCall");
+ TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"),
+ "UpdateCounters", TRACE_EVENT_SCOPE_THREAD, "data",
+ InspectorUpdateCountersEvent::data());
+}
+
namespace {
void setNodeInfo(TracedValue* value,

Powered by Google App Engine
This is Rietveld 408576698