Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 45 #define TRACE_STYLE_INVALIDATOR_INVALIDATION_SELECTORPART_IF_ENABLED(element, re ason, invalidationSet, singleSelectorPart) \ | 45 #define TRACE_STYLE_INVALIDATOR_INVALIDATION_SELECTORPART_IF_ENABLED(element, re ason, invalidationSet, singleSelectorPart) \ |
| 46 if (UNLIKELY(*s_tracingEnabled)) \ | 46 if (UNLIKELY(*s_tracingEnabled)) \ |
| 47 TRACE_STYLE_INVALIDATOR_INVALIDATION_SELECTORPART(element, reason, inval idationSet, singleSelectorPart); | 47 TRACE_STYLE_INVALIDATOR_INVALIDATION_SELECTORPART(element, reason, inval idationSet, singleSelectorPart); |
| 48 | 48 |
| 49 void InvalidationSet::cacheTracingFlag() | 49 void InvalidationSet::cacheTracingFlag() |
| 50 { | 50 { |
| 51 s_tracingEnabled = TRACE_EVENT_API_GET_CATEGORY_ENABLED(TRACE_DISABLED_BY_DE FAULT("devtools.timeline.invalidationTracking")); | 51 s_tracingEnabled = TRACE_EVENT_API_GET_CATEGORY_ENABLED(TRACE_DISABLED_BY_DE FAULT("devtools.timeline.invalidationTracking")); |
| 52 } | 52 } |
| 53 | 53 |
| 54 InvalidationSet::InvalidationSet() | 54 InvalidationSet::InvalidationSet() |
| 55 : m_allDescendantsMightBeInvalid(false) | 55 : m_appliesDirectly(false) |
| 56 , m_allDescendantsMightBeInvalid(false) | |
| 56 , m_customPseudoInvalid(false) | 57 , m_customPseudoInvalid(false) |
| 57 , m_treeBoundaryCrossing(false) | 58 , m_treeBoundaryCrossing(false) |
| 58 , m_insertionPointCrossing(false) | 59 , m_insertionPointCrossing(false) |
| 59 { | 60 { |
| 60 } | 61 } |
| 61 | 62 |
| 62 bool InvalidationSet::invalidatesElement(Element& element) const | 63 bool InvalidationSet::invalidatesElement(Element& element) const |
| 63 { | 64 { |
| 64 if (m_allDescendantsMightBeInvalid) | 65 if (m_allDescendantsMightBeInvalid) |
| 65 return true; | 66 return true; |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 91 return true; | 92 return true; |
| 92 } | 93 } |
| 93 } | 94 } |
| 94 } | 95 } |
| 95 | 96 |
| 96 return false; | 97 return false; |
| 97 } | 98 } |
| 98 | 99 |
| 99 void InvalidationSet::combine(const InvalidationSet& other) | 100 void InvalidationSet::combine(const InvalidationSet& other) |
| 100 { | 101 { |
| 102 if (other.appliesDirectly()) | |
| 103 setAppliesDirectly(); | |
|
rune
2015/09/16 08:44:32
The existing code did an early return on wholeSubt
Eric Willigers
2015/09/16 13:32:08
Moved. The original positioning, and the original
| |
| 104 | |
| 101 // No longer bother combining data structures, since the whole subtree is de emed invalid. | 105 // No longer bother combining data structures, since the whole subtree is de emed invalid. |
| 102 if (wholeSubtreeInvalid()) | 106 if (wholeSubtreeInvalid()) |
| 103 return; | 107 return; |
| 104 | 108 |
| 105 if (other.wholeSubtreeInvalid()) { | 109 if (other.wholeSubtreeInvalid()) { |
| 106 setWholeSubtreeInvalid(); | 110 setWholeSubtreeInvalid(); |
| 107 return; | 111 return; |
| 108 } | 112 } |
| 109 | 113 |
| 110 if (other.customPseudoInvalid()) | 114 if (other.customPseudoInvalid()) |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 269 { | 273 { |
| 270 RefPtr<TracedValue> value = TracedValue::create(); | 274 RefPtr<TracedValue> value = TracedValue::create(); |
| 271 value->beginArray("InvalidationSet"); | 275 value->beginArray("InvalidationSet"); |
| 272 toTracedValue(value.get()); | 276 toTracedValue(value.get()); |
| 273 value->endArray(); | 277 value->endArray(); |
| 274 fprintf(stderr, "%s\n", value->asTraceFormat().ascii().data()); | 278 fprintf(stderr, "%s\n", value->asTraceFormat().ascii().data()); |
| 275 } | 279 } |
| 276 #endif // NDEBUG | 280 #endif // NDEBUG |
| 277 | 281 |
| 278 } // namespace blink | 282 } // namespace blink |
| OLD | NEW |