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

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

Issue 600733005: [Invalidation Tracking] add TraceEvents for setNeedsStyleRecalc. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add frame Created 6 years, 3 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.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorTraceEvents.cpp
diff --git a/Source/core/inspector/InspectorTraceEvents.cpp b/Source/core/inspector/InspectorTraceEvents.cpp
index 1afdb1d089d498dda8b1146f1776faa1b4eb2437..fa7dee469c057aa96f07e5642741e3d0b74188eb 100644
--- a/Source/core/inspector/InspectorTraceEvents.cpp
+++ b/Source/core/inspector/InspectorTraceEvents.cpp
@@ -8,6 +8,7 @@
#include "bindings/core/v8/ScriptCallStackFactory.h"
#include "bindings/core/v8/ScriptGCEvent.h"
#include "bindings/core/v8/ScriptSourceCode.h"
+#include "core/dom/StyleChangeReason.h"
#include "core/events/Event.h"
#include "core/frame/FrameView.h"
#include "core/frame/LocalFrame.h"
@@ -56,6 +57,25 @@ String toHexString(const void* p)
return String::format("0x%" PRIx64, static_cast<uint64>(reinterpret_cast<intptr_t>(p)));
}
+void setNodeInfo(TracedValue* value, Node* node, const char* idFieldName, const char* nameFieldName = 0)
+{
+ value->setInteger(idFieldName, InspectorNodeIds::idForNode(node));
+ if (nameFieldName)
+ value->setString(nameFieldName, node->debugName());
+}
+
+}
+
+PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorStyleRecalcInvalidationTrackingEvent::data(Node* node, const StyleChangeReasonForTracing& reason)
+{
+ ASSERT(node);
+
+ RefPtr<TracedValue> value = TracedValue::create();
+ value->setString("frame", toHexString(node->document().frame()));
+ setNodeInfo(value.get(), node, "nodeId", "nodeName");
+ value->setString("reason", reason.reasonString());
+ value->setString("extraData", reason.extraData());
+ return value.release();
}
PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorLayoutEvent::beginData(FrameView* frameView)
@@ -95,9 +115,8 @@ static void setGeneratingNodeInfo(TracedValue* value, const RenderObject* render
node = renderer->generatingNode();
if (!node)
return;
- value->setInteger(idFieldName, InspectorNodeIds::idForNode(node));
- if (nameFieldName)
- value->setString(nameFieldName, node->debugName());
+
+ setNodeInfo(value, node, idFieldName, nameFieldName);
}
PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorLayoutEvent::endData(RenderObject* rootForThisLayout)
« no previous file with comments | « Source/core/inspector/InspectorTraceEvents.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698