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 "core/inspector/InspectorTraceEvents.h" | 5 #include "core/inspector/InspectorTraceEvents.h" |
6 | 6 |
7 #include "bindings/core/v8/ScriptSourceCode.h" | 7 #include "bindings/core/v8/ScriptSourceCode.h" |
8 #include "bindings/core/v8/SourceLocation.h" | 8 #include "bindings/core/v8/SourceLocation.h" |
9 #include "core/animation/Animation.h" | 9 #include "core/animation/Animation.h" |
10 #include "core/animation/KeyframeEffectReadOnly.h" | 10 #include "core/animation/KeyframeEffectReadOnly.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 String urlForFrame(LocalFrame* frame) { | 173 String urlForFrame(LocalFrame* frame) { |
174 KURL url = frame->document()->url(); | 174 KURL url = frame->document()->url(); |
175 url.removeFragmentIdentifier(); | 175 url.removeFragmentIdentifier(); |
176 return url.getString(); | 176 return url.getString(); |
177 } | 177 } |
178 | 178 |
179 } // namespace | 179 } // namespace |
180 | 180 |
181 namespace InspectorScheduleStyleInvalidationTrackingEvent { | 181 namespace InspectorScheduleStyleInvalidationTrackingEvent { |
182 std::unique_ptr<TracedValue> fillCommonPart( | 182 std::unique_ptr<TracedValue> fillCommonPart( |
183 Element& element, | 183 ContainerNode& node, |
184 const InvalidationSet& invalidationSet, | 184 const InvalidationSet& invalidationSet, |
185 const char* invalidatedSelector) { | 185 const char* invalidatedSelector) { |
186 std::unique_ptr<TracedValue> value = TracedValue::create(); | 186 std::unique_ptr<TracedValue> value = TracedValue::create(); |
187 value->setString("frame", toHexString(element.document().frame())); | 187 value->setString("frame", toHexString(node.document().frame())); |
188 setNodeInfo(value.get(), &element, "nodeId", "nodeName"); | 188 setNodeInfo(value.get(), &node, "nodeId", "nodeName"); |
189 value->setString("invalidationSet", | 189 value->setString("invalidationSet", |
190 descendantInvalidationSetToIdString(invalidationSet)); | 190 descendantInvalidationSetToIdString(invalidationSet)); |
191 value->setString("invalidatedSelectorId", invalidatedSelector); | 191 value->setString("invalidatedSelectorId", invalidatedSelector); |
192 SourceLocation::capture()->toTracedValue(value.get(), "stackTrace"); | 192 SourceLocation::capture()->toTracedValue(value.get(), "stackTrace"); |
193 return value; | 193 return value; |
194 } | 194 } |
195 } // namespace InspectorScheduleStyleInvalidationTrackingEvent | 195 } // namespace InspectorScheduleStyleInvalidationTrackingEvent |
196 | 196 |
197 const char InspectorScheduleStyleInvalidationTrackingEvent::Attribute[] = | 197 const char InspectorScheduleStyleInvalidationTrackingEvent::Attribute[] = |
198 "attribute"; | 198 "attribute"; |
199 const char InspectorScheduleStyleInvalidationTrackingEvent::Class[] = "class"; | 199 const char InspectorScheduleStyleInvalidationTrackingEvent::Class[] = "class"; |
200 const char InspectorScheduleStyleInvalidationTrackingEvent::Id[] = "id"; | 200 const char InspectorScheduleStyleInvalidationTrackingEvent::Id[] = "id"; |
201 const char InspectorScheduleStyleInvalidationTrackingEvent::Pseudo[] = "pseudo"; | 201 const char InspectorScheduleStyleInvalidationTrackingEvent::Pseudo[] = "pseudo"; |
| 202 const char InspectorScheduleStyleInvalidationTrackingEvent::RuleSet[] = |
| 203 "ruleset"; |
202 | 204 |
203 const char* resourcePriorityString(ResourceLoadPriority priority) { | 205 const char* resourcePriorityString(ResourceLoadPriority priority) { |
204 const char* priorityString = 0; | 206 const char* priorityString = 0; |
205 switch (priority) { | 207 switch (priority) { |
206 case ResourceLoadPriorityVeryLow: | 208 case ResourceLoadPriorityVeryLow: |
207 priorityString = "VeryLow"; | 209 priorityString = "VeryLow"; |
208 break; | 210 break; |
209 case ResourceLoadPriorityLow: | 211 case ResourceLoadPriorityLow: |
210 priorityString = "Low"; | 212 priorityString = "Low"; |
211 break; | 213 break; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 InspectorScheduleStyleInvalidationTrackingEvent::pseudoChange( | 263 InspectorScheduleStyleInvalidationTrackingEvent::pseudoChange( |
262 Element& element, | 264 Element& element, |
263 const InvalidationSet& invalidationSet, | 265 const InvalidationSet& invalidationSet, |
264 CSSSelector::PseudoType pseudoType) { | 266 CSSSelector::PseudoType pseudoType) { |
265 std::unique_ptr<TracedValue> value = | 267 std::unique_ptr<TracedValue> value = |
266 fillCommonPart(element, invalidationSet, Attribute); | 268 fillCommonPart(element, invalidationSet, Attribute); |
267 value->setString("changedPseudo", pseudoTypeToString(pseudoType)); | 269 value->setString("changedPseudo", pseudoTypeToString(pseudoType)); |
268 return value; | 270 return value; |
269 } | 271 } |
270 | 272 |
| 273 std::unique_ptr<TracedValue> |
| 274 InspectorScheduleStyleInvalidationTrackingEvent::ruleSetInvalidation( |
| 275 ContainerNode& rootNode, |
| 276 const InvalidationSet& invalidationSet) { |
| 277 std::unique_ptr<TracedValue> value = |
| 278 fillCommonPart(rootNode, invalidationSet, RuleSet); |
| 279 return value; |
| 280 } |
| 281 |
271 String descendantInvalidationSetToIdString(const InvalidationSet& set) { | 282 String descendantInvalidationSetToIdString(const InvalidationSet& set) { |
272 return toHexString(&set); | 283 return toHexString(&set); |
273 } | 284 } |
274 | 285 |
275 const char InspectorStyleInvalidatorInvalidateEvent:: | 286 const char InspectorStyleInvalidatorInvalidateEvent:: |
276 ElementHasPendingInvalidationList[] = | 287 ElementHasPendingInvalidationList[] = |
277 "Element has pending invalidation list"; | 288 "Element has pending invalidation list"; |
278 const char InspectorStyleInvalidatorInvalidateEvent::InvalidateCustomPseudo[] = | 289 const char InspectorStyleInvalidatorInvalidateEvent::InvalidateCustomPseudo[] = |
279 "Invalidate custom pseudo element"; | 290 "Invalidate custom pseudo element"; |
280 const char InspectorStyleInvalidatorInvalidateEvent:: | 291 const char InspectorStyleInvalidatorInvalidateEvent:: |
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1068 | 1079 |
1069 std::unique_ptr<TracedValue> InspectorInstrumentedAPIEvent::data( | 1080 std::unique_ptr<TracedValue> InspectorInstrumentedAPIEvent::data( |
1070 const String& name) { | 1081 const String& name) { |
1071 std::unique_ptr<TracedValue> value(TracedValue::create()); | 1082 std::unique_ptr<TracedValue> value(TracedValue::create()); |
1072 value->setString("name", name); | 1083 value->setString("name", name); |
1073 setCallStack(value.get()); | 1084 setCallStack(value.get()); |
1074 return value; | 1085 return value; |
1075 } | 1086 } |
1076 | 1087 |
1077 } // namespace blink | 1088 } // namespace blink |
OLD | NEW |