OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
6 * rights reserved. | 6 * rights reserved. |
7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. |
9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
10 * | 10 * |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 uint32_t m_nodeFlags; | 133 uint32_t m_nodeFlags; |
134 Member<void*> m_willbeMember[4]; | 134 Member<void*> m_willbeMember[4]; |
135 void* m_pointer; | 135 void* m_pointer; |
136 }; | 136 }; |
137 | 137 |
138 static_assert(sizeof(Node) <= sizeof(SameSizeAsNode), "Node should stay small"); | 138 static_assert(sizeof(Node) <= sizeof(SameSizeAsNode), "Node should stay small"); |
139 | 139 |
140 #if DUMP_NODE_STATISTICS | 140 #if DUMP_NODE_STATISTICS |
141 using WeakNodeSet = HeapHashSet<WeakMember<Node>>; | 141 using WeakNodeSet = HeapHashSet<WeakMember<Node>>; |
142 static WeakNodeSet& liveNodeSet() { | 142 static WeakNodeSet& liveNodeSet() { |
| 143 ALLOW_UNSAFE_SINGLETON() |
143 DEFINE_STATIC_LOCAL(WeakNodeSet, set, (new WeakNodeSet)); | 144 DEFINE_STATIC_LOCAL(WeakNodeSet, set, (new WeakNodeSet)); |
144 return set; | 145 return set; |
145 } | 146 } |
146 #endif | 147 #endif |
147 | 148 |
148 void Node::dumpStatistics() { | 149 void Node::dumpStatistics() { |
149 #if DUMP_NODE_STATISTICS | 150 #if DUMP_NODE_STATISTICS |
150 size_t nodesWithRareData = 0; | 151 size_t nodesWithRareData = 0; |
151 | 152 |
152 size_t elementNodes = 0; | 153 size_t elementNodes = 0; |
(...skipping 1746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1899 node.removeAllEventListeners(); | 1900 node.removeAllEventListeners(); |
1900 for (ShadowRoot* root = node.youngestShadowRoot(); root; | 1901 for (ShadowRoot* root = node.youngestShadowRoot(); root; |
1901 root = root->olderShadowRoot()) | 1902 root = root->olderShadowRoot()) |
1902 root->removeAllEventListenersRecursively(); | 1903 root->removeAllEventListenersRecursively(); |
1903 } | 1904 } |
1904 } | 1905 } |
1905 | 1906 |
1906 using EventTargetDataMap = | 1907 using EventTargetDataMap = |
1907 PersistentHeapHashMap<WeakMember<Node>, Member<EventTargetData>>; | 1908 PersistentHeapHashMap<WeakMember<Node>, Member<EventTargetData>>; |
1908 static EventTargetDataMap& eventTargetDataMap() { | 1909 static EventTargetDataMap& eventTargetDataMap() { |
| 1910 ALLOW_UNSAFE_SINGLETON() |
1909 DEFINE_STATIC_LOCAL(EventTargetDataMap, map, ()); | 1911 DEFINE_STATIC_LOCAL(EventTargetDataMap, map, ()); |
1910 return map; | 1912 return map; |
1911 } | 1913 } |
1912 | 1914 |
1913 EventTargetData* Node::eventTargetData() { | 1915 EventTargetData* Node::eventTargetData() { |
1914 return hasEventTargetData() ? eventTargetDataMap().get(this) : nullptr; | 1916 return hasEventTargetData() ? eventTargetDataMap().get(this) : nullptr; |
1915 } | 1917 } |
1916 | 1918 |
1917 EventTargetData& Node::ensureEventTargetData() { | 1919 EventTargetData& Node::ensureEventTargetData() { |
1918 if (hasEventTargetData()) | 1920 if (hasEventTargetData()) |
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2566 if (node) { | 2568 if (node) { |
2567 std::stringstream stream; | 2569 std::stringstream stream; |
2568 node->printNodePathTo(stream); | 2570 node->printNodePathTo(stream); |
2569 LOG(INFO) << stream.str(); | 2571 LOG(INFO) << stream.str(); |
2570 } else { | 2572 } else { |
2571 LOG(INFO) << "Cannot showNodePath for <null>"; | 2573 LOG(INFO) << "Cannot showNodePath for <null>"; |
2572 } | 2574 } |
2573 } | 2575 } |
2574 | 2576 |
2575 #endif | 2577 #endif |
OLD | NEW |