Chromium Code Reviews| Index: Source/core/inspector/InspectorTraceEvents.cpp |
| diff --git a/Source/core/inspector/InspectorTraceEvents.cpp b/Source/core/inspector/InspectorTraceEvents.cpp |
| index 1afdb1d089d498dda8b1146f1776faa1b4eb2437..a2173e8219265be19c9a9d9a31ad5865b979ddfa 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/events/Event.h" |
| #include "core/frame/FrameView.h" |
| #include "core/frame/LocalFrame.h" |
| @@ -27,6 +28,7 @@ |
| #include "platform/network/ResourceResponse.h" |
| #include "platform/weborigin/KURL.h" |
| #include "wtf/Vector.h" |
| +#include "wtf/text/StringBuilder.h" |
| #include <inttypes.h> |
| namespace blink { |
| @@ -56,6 +58,55 @@ 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()); |
| +} |
| + |
| +} |
| + |
| +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->beginArray("selectorParts"); |
| + value->pushString(selectorPart); |
|
caseq
2014/10/01 07:50:50
So selectorParts contents is either a string (here
kouhei (in TOK)
2014/10/02 02:16:46
I changed this to use different key for each.
|
| + value->endArray(); |
| + return value.release(); |
| +} |
| + |
| +PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorStyleInvalidatorInvalidateEvent::invalidationList(Element& element, const WillBeHeapVector<RefPtrWillBeMember<DescendantInvalidationSet> >& invalidationList) |
| +{ |
| + RefPtr<TracedValue> value = fillCommonPart(element, ElementHasPendingInvalidationList); |
| + value->beginArray("selectorParts"); |
| + for (const auto& invalidationSet : invalidationList) { |
|
caseq
2014/10/01 07:50:50
nit: redundant {}
kouhei (in TOK)
2014/10/02 02:16:46
Done.
|
| + invalidationSet->toTracedValue(value.get()); |
| + } |
| + value->endArray(); |
| + return value.release(); |
| } |
| PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorLayoutEvent::beginData(FrameView* frameView) |