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

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: trace regardless of existingChangeType 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
Index: Source/core/inspector/InspectorTraceEvents.cpp
diff --git a/Source/core/inspector/InspectorTraceEvents.cpp b/Source/core/inspector/InspectorTraceEvents.cpp
index 1afdb1d089d498dda8b1146f1776faa1b4eb2437..ca166a6dbe86eb01eddc9f4753069f00f3d7def8 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,22 @@ 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)
+{
+ RefPtr<TracedValue> value = TracedValue::create();
pdr. 2014/09/30 03:25:48 Can you add value->setString("frame", toHexString(
kouhei (in TOK) 2014/09/30 03:49:32 Done.
+ 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 +112,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)
« Source/core/inspector/InspectorTraceEvents.h ('K') | « Source/core/inspector/InspectorTraceEvents.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698