Chromium Code Reviews| Index: Source/core/inspector/InspectorTraceEvents.cpp |
| diff --git a/Source/core/inspector/InspectorTraceEvents.cpp b/Source/core/inspector/InspectorTraceEvents.cpp |
| index 29119cc4d069a3016a27d741557483f77537d78c..c692d9734c39edc2b11aac6b387791ddd7fdce5d 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,50 @@ String toHexString(const void* p) |
| return String::format("0x%" PRIx64, static_cast<uint64>(reinterpret_cast<intptr_t>(p))); |
| } |
| +String invalidationListToString(const WillBeHeapVector<RefPtrWillBeMember<DescendantInvalidationSet> >& invalidationList) |
| +{ |
| + StringBuilder builder; |
| + |
| + builder.append("["); |
| + bool isFirst = true; |
| + for (const auto& invalidationSet : invalidationList) { |
| + if (!isFirst) |
| + builder.append(", "); |
| + isFirst = false; |
| + |
| + builder.append(invalidationSet->toString()); |
| + } |
| + builder.append("]"); |
| + return builder.toString(); |
| +} |
| + |
| +} |
| + |
| +const char InspectorStyleInvalidatorInvalidateEvent::ElementHasPendingInvalidationMap[] = "Element has pending invalidation map"; |
| +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<TraceEvent::ConvertableToTraceFormat> InspectorStyleInvalidatorInvalidateEvent::data(Element& element, const char* reason) |
| +{ |
| + return withExtraData(element, reason, nullAtom); |
| +} |
| + |
| +PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorStyleInvalidatorInvalidateEvent::withExtraData(Element& element, const char* reason, const String& extraData) |
|
pdr.
2014/09/30 02:08:49
Can you use a default arg here to avoid needing tw
kouhei (in TOK)
2014/09/30 02:22:00
Acknowledged.
kouhei (in TOK)
2014/09/30 03:44:05
Done.
|
| +{ |
| + RefPtr<TracedValue> value = TracedValue::create(); |
|
pdr.
2014/09/30 03:21:57
We need the frame info here too. Can you add:
valu
kouhei (in TOK)
2014/09/30 03:44:05
Done.
|
| + value->setInteger("nodeId", InspectorNodeIds::idForNode(&element)); |
|
pdr.
2014/09/30 02:08:50
Can you use setNodeInfo here (from https://coderev
kouhei (in TOK)
2014/09/30 02:22:00
Acknowledged.
kouhei (in TOK)
2014/09/30 03:44:05
Done.
|
| + value->setString("reason", reason); |
| + value->setString("extraData", extraData); |
|
pdr.
2014/09/30 02:08:49
Can we be more descriptive than just "extraData" (
kouhei (in TOK)
2014/09/30 02:22:00
Agreed, but want your help on naming.
"extraData"
pdr.
2014/09/30 03:21:57
Talked offline a bit. We don't actually have the e
kouhei (in TOK)
2014/09/30 03:44:05
Done.
|
| + return value; |
| +} |
| + |
| +PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorStyleInvalidatorInvalidateEvent::invalidationList(Element& element, const WillBeHeapVector<RefPtrWillBeMember<DescendantInvalidationSet> >& invalidationList) |
| +{ |
| + return withExtraData(element, InspectorStyleInvalidatorInvalidateEvent::ElementHasPendingInvalidationMap, invalidationListToString(invalidationList)); |
| } |
| PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorLayoutEvent::beginData(FrameView* frameView) |