OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 } | 175 } |
176 | 176 |
177 TreeScopeEventContext* EventPath::ensureTreeScopeEventContext(Node* currentTarge
t, TreeScope* treeScope, TreeScopeEventContextMap& treeScopeEventContextMap) | 177 TreeScopeEventContext* EventPath::ensureTreeScopeEventContext(Node* currentTarge
t, TreeScope* treeScope, TreeScopeEventContextMap& treeScopeEventContextMap) |
178 { | 178 { |
179 if (!treeScope) | 179 if (!treeScope) |
180 return 0; | 180 return 0; |
181 TreeScopeEventContext* treeScopeEventContext; | 181 TreeScopeEventContext* treeScopeEventContext; |
182 bool isNewEntry; | 182 bool isNewEntry; |
183 { | 183 { |
184 TreeScopeEventContextMap::AddResult addResult = treeScopeEventContextMap
.add(treeScope, nullptr); | 184 TreeScopeEventContextMap::AddResult addResult = treeScopeEventContextMap
.add(treeScope, nullptr); |
185 if ((isNewEntry = addResult.isNewEntry)) | 185 isNewEntry = addResult.isNewEntry; |
| 186 if (isNewEntry) |
186 addResult.storedValue->value = TreeScopeEventContext::create(*treeSc
ope); | 187 addResult.storedValue->value = TreeScopeEventContext::create(*treeSc
ope); |
187 treeScopeEventContext = addResult.storedValue->value.get(); | 188 treeScopeEventContext = addResult.storedValue->value.get(); |
188 } | 189 } |
189 if (isNewEntry) { | 190 if (isNewEntry) { |
190 TreeScopeEventContext* parentTreeScopeEventContext = ensureTreeScopeEven
tContext(0, treeScope->olderShadowRootOrParentTreeScope(), treeScopeEventContext
Map); | 191 TreeScopeEventContext* parentTreeScopeEventContext = ensureTreeScopeEven
tContext(0, treeScope->olderShadowRootOrParentTreeScope(), treeScopeEventContext
Map); |
191 if (parentTreeScopeEventContext && parentTreeScopeEventContext->target()
) { | 192 if (parentTreeScopeEventContext && parentTreeScopeEventContext->target()
) { |
192 treeScopeEventContext->setTarget(parentTreeScopeEventContext->target
()); | 193 treeScopeEventContext->setTarget(parentTreeScopeEventContext->target
()); |
193 } else if (currentTarget) { | 194 } else if (currentTarget) { |
194 treeScopeEventContext->setTarget(eventTargetRespectingTargetRules(cu
rrentTarget)); | 195 treeScopeEventContext->setTarget(eventTargetRespectingTargetRules(cu
rrentTarget)); |
195 } | 196 } |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 | 348 |
348 void EventPath::trace(Visitor* visitor) | 349 void EventPath::trace(Visitor* visitor) |
349 { | 350 { |
350 visitor->trace(m_nodeEventContexts); | 351 visitor->trace(m_nodeEventContexts); |
351 visitor->trace(m_node); | 352 visitor->trace(m_node); |
352 visitor->trace(m_event); | 353 visitor->trace(m_event); |
353 visitor->trace(m_treeScopeEventContexts); | 354 visitor->trace(m_treeScopeEventContexts); |
354 } | 355 } |
355 | 356 |
356 } // namespace | 357 } // namespace |
OLD | NEW |