OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "core/inspector/InspectorTraceEvents.h" | 6 #include "core/inspector/InspectorTraceEvents.h" |
7 | 7 |
8 #include "bindings/core/v8/ScriptCallStackFactory.h" | 8 #include "bindings/core/v8/ScriptCallStackFactory.h" |
9 #include "bindings/core/v8/ScriptGCEvent.h" | 9 #include "bindings/core/v8/ScriptGCEvent.h" |
10 #include "bindings/core/v8/ScriptSourceCode.h" | 10 #include "bindings/core/v8/ScriptSourceCode.h" |
| 11 #include "core/css/invalidation/DescendantInvalidationSet.h" |
11 #include "core/dom/StyleChangeReason.h" | 12 #include "core/dom/StyleChangeReason.h" |
12 #include "core/events/Event.h" | 13 #include "core/events/Event.h" |
13 #include "core/frame/FrameView.h" | 14 #include "core/frame/FrameView.h" |
14 #include "core/frame/LocalFrame.h" | 15 #include "core/frame/LocalFrame.h" |
15 #include "core/inspector/IdentifiersFactory.h" | 16 #include "core/inspector/IdentifiersFactory.h" |
16 #include "core/inspector/InspectorNodeIds.h" | 17 #include "core/inspector/InspectorNodeIds.h" |
17 #include "core/inspector/ScriptCallStack.h" | 18 #include "core/inspector/ScriptCallStack.h" |
18 #include "core/page/Page.h" | 19 #include "core/page/Page.h" |
19 #include "core/rendering/RenderImage.h" | 20 #include "core/rendering/RenderImage.h" |
20 #include "core/rendering/RenderLayer.h" | 21 #include "core/rendering/RenderLayer.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 60 |
60 void setNodeInfo(TracedValue* value, Node* node, const char* idFieldName, const
char* nameFieldName = 0) | 61 void setNodeInfo(TracedValue* value, Node* node, const char* idFieldName, const
char* nameFieldName = 0) |
61 { | 62 { |
62 value->setInteger(idFieldName, InspectorNodeIds::idForNode(node)); | 63 value->setInteger(idFieldName, InspectorNodeIds::idForNode(node)); |
63 if (nameFieldName) | 64 if (nameFieldName) |
64 value->setString(nameFieldName, node->debugName()); | 65 value->setString(nameFieldName, node->debugName()); |
65 } | 66 } |
66 | 67 |
67 } | 68 } |
68 | 69 |
| 70 const char InspectorStyleInvalidatorInvalidateEvent::ElementHasPendingInvalidati
onList[] = "Element has pending invalidation list"; |
| 71 const char InspectorStyleInvalidatorInvalidateEvent::InvalidateCustomPseudo[] =
"Invalidate custom pseudo element."; |
| 72 const char InspectorStyleInvalidatorInvalidateEvent::InvalidationSetMatchedAttri
bute[] = "Invalidation set matched attribute."; |
| 73 const char InspectorStyleInvalidatorInvalidateEvent::InvalidationSetMatchedClass
[] = "Invalidation set matched class."; |
| 74 const char InspectorStyleInvalidatorInvalidateEvent::InvalidationSetMatchedId[]
= "Invalidation set matched id."; |
| 75 const char InspectorStyleInvalidatorInvalidateEvent::InvalidationSetMatchedTagNa
me[] = "Invalidation set matched tagName."; |
| 76 const char InspectorStyleInvalidatorInvalidateEvent::PreventStyleSharingForParen
t[] = "Prevent style sharing for parent."; |
| 77 |
| 78 PassRefPtr<TracedValue> InspectorStyleInvalidatorInvalidateEvent::fillCommonPart
(Element& element, const char* reason) |
| 79 { |
| 80 RefPtr<TracedValue> value = TracedValue::create(); |
| 81 value->setString("frame", toHexString(element.document().frame())); |
| 82 setNodeInfo(value.get(), &element, "nodeId", "nodeName"); |
| 83 value->setString("reason", reason); |
| 84 return value.release(); |
| 85 } |
| 86 |
| 87 PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorStyleInvalidatorInvali
dateEvent::data(Element& element, const char* reason) |
| 88 { |
| 89 return fillCommonPart(element, reason); |
| 90 } |
| 91 |
| 92 PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorStyleInvalidatorInvali
dateEvent::selectorPart(Element& element, const char* reason, const String& sele
ctorPart) |
| 93 { |
| 94 RefPtr<TracedValue> value = fillCommonPart(element, reason); |
| 95 value->setString("selectorPart", selectorPart); |
| 96 return value.release(); |
| 97 } |
| 98 |
| 99 PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorStyleInvalidatorInvali
dateEvent::invalidationList(Element& element, const WillBeHeapVector<RefPtrWillB
eMember<DescendantInvalidationSet> >& invalidationList) |
| 100 { |
| 101 RefPtr<TracedValue> value = fillCommonPart(element, ElementHasPendingInvalid
ationList); |
| 102 value->beginArray("invalidationList"); |
| 103 for (const auto& invalidationSet : invalidationList) |
| 104 invalidationSet->toTracedValue(value.get()); |
| 105 value->endArray(); |
| 106 return value.release(); |
| 107 } |
| 108 |
69 PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorStyleRecalcInvalidatio
nTrackingEvent::data(Node* node, const StyleChangeReasonForTracing& reason) | 109 PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorStyleRecalcInvalidatio
nTrackingEvent::data(Node* node, const StyleChangeReasonForTracing& reason) |
70 { | 110 { |
71 ASSERT(node); | 111 ASSERT(node); |
72 | 112 |
73 RefPtr<TracedValue> value = TracedValue::create(); | 113 RefPtr<TracedValue> value = TracedValue::create(); |
74 value->setString("frame", toHexString(node->document().frame())); | 114 value->setString("frame", toHexString(node->document().frame())); |
75 setNodeInfo(value.get(), node, "nodeId", "nodeName"); | 115 setNodeInfo(value.get(), node, "nodeId", "nodeName"); |
76 value->setString("reason", reason.reasonString()); | 116 value->setString("reason", reason.reasonString()); |
77 value->setString("extraData", reason.extraData()); | 117 value->setString("extraData", reason.extraData()); |
78 return value.release(); | 118 return value.release(); |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 | 461 |
422 PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorTracingSessionIdForWor
kerEvent::data(const String& sessionId, WorkerThread* workerThread) | 462 PassRefPtr<TraceEvent::ConvertableToTraceFormat> InspectorTracingSessionIdForWor
kerEvent::data(const String& sessionId, WorkerThread* workerThread) |
423 { | 463 { |
424 RefPtr<TracedValue> value = TracedValue::create(); | 464 RefPtr<TracedValue> value = TracedValue::create(); |
425 value->setString("sessionId", sessionId); | 465 value->setString("sessionId", sessionId); |
426 value->setDouble("workerThreadId", workerThread->platformThreadId()); | 466 value->setDouble("workerThreadId", workerThread->platformThreadId()); |
427 return value.release(); | 467 return value.release(); |
428 } | 468 } |
429 | 469 |
430 } | 470 } |
OLD | NEW |