| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 visitor->trace(m_mutationObserverData); | 51 visitor->trace(m_mutationObserverData); |
| 52 // Do not keep empty NodeListsNodeData objects around. | 52 // Do not keep empty NodeListsNodeData objects around. |
| 53 if (m_nodeLists && m_nodeLists->isEmpty()) | 53 if (m_nodeLists && m_nodeLists->isEmpty()) |
| 54 m_nodeLists.clear(); | 54 m_nodeLists.clear(); |
| 55 else | 55 else |
| 56 visitor->trace(m_nodeLists); | 56 visitor->trace(m_nodeLists); |
| 57 } | 57 } |
| 58 | 58 |
| 59 DEFINE_TRACE(NodeRareData) | 59 DEFINE_TRACE(NodeRareData) |
| 60 { | 60 { |
| 61 if (m_isElementRareData) | 61 if (isElementRareData()) |
| 62 static_cast<ElementRareData*>(this)->traceAfterDispatch(visitor); | 62 static_cast<ElementRareData*>(this)->traceAfterDispatch(visitor); |
| 63 else | 63 else |
| 64 traceAfterDispatch(visitor); | 64 traceAfterDispatch(visitor); |
| 65 } | 65 } |
| 66 | 66 |
| 67 DEFINE_TRACE_WRAPPERS(NodeRareData) | 67 DEFINE_TRACE_WRAPPERS(NodeRareData) |
| 68 { | 68 { |
| 69 if (m_isElementRareData) | 69 if (isElementRareData()) |
| 70 static_cast<const ElementRareData*>(this)->traceWrappersAfterDispatch(vi
sitor); | 70 static_cast<const ElementRareData*>(this)->traceWrappersAfterDispatch(vi
sitor); |
| 71 else | 71 else |
| 72 traceWrappersAfterDispatch(visitor); | 72 traceWrappersAfterDispatch(visitor); |
| 73 } | 73 } |
| 74 | 74 |
| 75 DEFINE_TRACE_WRAPPERS_AFTER_DISPATCH(NodeRareData) | 75 DEFINE_TRACE_WRAPPERS_AFTER_DISPATCH(NodeRareData) |
| 76 { | 76 { |
| 77 visitor->traceWrappers(m_nodeLists); | 77 visitor->traceWrappers(m_nodeLists); |
| 78 visitor->traceWrappers(m_mutationObserverData); | 78 visitor->traceWrappers(m_mutationObserverData); |
| 79 } | 79 } |
| 80 | 80 |
| 81 void NodeRareData::finalizeGarbageCollectedObject() | 81 void NodeRareData::finalizeGarbageCollectedObject() |
| 82 { | 82 { |
| 83 RELEASE_ASSERT(!layoutObject()); | 83 RELEASE_ASSERT(!layoutObject()); |
| 84 if (m_isElementRareData) | 84 if (isElementRareData()) |
| 85 static_cast<ElementRareData*>(this)->~ElementRareData(); | 85 static_cast<ElementRareData*>(this)->~ElementRareData(); |
| 86 else | 86 else |
| 87 this->~NodeRareData(); | 87 this->~NodeRareData(); |
| 88 } | 88 } |
| 89 | 89 |
| 90 void NodeRareData::incrementConnectedSubframeCount() | 90 void NodeRareData::incrementConnectedSubframeCount() |
| 91 { | 91 { |
| 92 SECURITY_CHECK((m_connectedFrameCount + 1) <= FrameHost::maxNumberOfFrames); | 92 SECURITY_CHECK((m_connectedFrameCount + 1) <= FrameHost::maxNumberOfFrames); |
| 93 ++m_connectedFrameCount; | 93 ++m_connectedFrameCount; |
| 94 } | 94 } |
| 95 | 95 |
| 96 // Ensure the 10 bits reserved for the m_connectedFrameCount cannot overflow | 96 // Ensure the 10 bits reserved for the m_connectedFrameCount cannot overflow |
| 97 static_assert(FrameHost::maxNumberOfFrames < (1 << NodeRareData::ConnectedFrameC
ountBits), "Frame limit should fit in rare data count"); | 97 static_assert(FrameHost::maxNumberOfFrames < (1 << NodeRareData::ConnectedFrameC
ountBits), "Frame limit should fit in rare data count"); |
| 98 | 98 |
| 99 } // namespace blink | 99 } // namespace blink |
| OLD | NEW |