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

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

Issue 580373002: [Invalidation Tracking] Trace StyleInvalidator setNeedsStyleRecalc (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: attributes Created 6 years, 2 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 fa7dee469c057aa96f07e5642741e3d0b74188eb..bbc5ca8388989eadb651af5641f7a17bcded07f2 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/css/invalidation/DescendantInvalidationSet.h"
#include "core/dom/StyleChangeReason.h"
#include "core/events/Event.h"
#include "core/frame/FrameView.h"
@@ -66,6 +67,45 @@ void setNodeInfo(TracedValue* value, Node* node, const char* idFieldName, const
}
+const char InspectorStyleInvalidatorInvalidateEvent::ElementHasPendingInvalidationList[] = "Element has pending invalidation list";
+const char InspectorStyleInvalidatorInvalidateEvent::InvalidateCustomPseudo[] = "Invalidate custom pseudo element.";
+const char InspectorStyleInvalidatorInvalidateEvent::InvalidationSetMatchedAttribute[] = "Invalidation set matched attribute.";
+const char InspectorStyleInvalidatorInvalidateEvent::InvalidationSetMatchedClass[] = "Invalidation set matched class.";
+const char InspectorStyleInvalidatorInvalidateEvent::InvalidationSetMatchedId[] = "Invalidation set matched id.";
+const char InspectorStyleInvalidatorInvalidateEvent::InvalidationSetMatchedTagName[] = "Invalidation set matched tagName.";
+const char InspectorStyleInvalidatorInvalidateEvent::PreventStyleSharingForParent[] = "Prevent style sharing for parent.";
+
+PassRefPtr<TracedValue> InspectorStyleInvalidatorInvalidateEvent::fillCommonPart(Element& element, const char* reason)
+{
+ RefPtr<TracedValue> value = TracedValue::create();
+ value->setString("frame", toHexString(element.document().frame()));
+ setNodeInfo(value.get(), &element, "nodeId", "nodeName");
+ value->setString("reason", reason);
+ return value.release();
+}
+
+PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorStyleInvalidatorInvalidateEvent::data(Element& element, const char* reason)
+{
+ return fillCommonPart(element, reason);
+}
+
+PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorStyleInvalidatorInvalidateEvent::selectorPart(Element& element, const char* reason, const String& selectorPart)
+{
+ RefPtr<TracedValue> value = fillCommonPart(element, reason);
+ value->setString("selectorPart", selectorPart);
+ return value.release();
+}
+
+PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorStyleInvalidatorInvalidateEvent::invalidationList(Element& element, const WillBeHeapVector<RefPtrWillBeMember<DescendantInvalidationSet> >& invalidationList)
+{
+ RefPtr<TracedValue> value = fillCommonPart(element, ElementHasPendingInvalidationList);
+ value->beginArray("invalidationList");
+ for (const auto& invalidationSet : invalidationList)
+ invalidationSet->toTracedValue(value.get());
+ value->endArray();
+ return value.release();
+}
+
PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorStyleRecalcInvalidationTrackingEvent::data(Node* node, const StyleChangeReasonForTracing& reason)
{
ASSERT(node);
« 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