Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(402)

Side by Side Diff: third_party/WebKit/Source/core/dom/ChildListMutationScope.cpp

Issue 1850413002: Improve DEFINE_STATIC_LOCAL()'s handling of Blink GCed objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address compilation failure Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 28 matching lines...) Expand all
39 namespace blink { 39 namespace blink {
40 40
41 // The accumulator map is used to make sure that there is only one mutation 41 // The accumulator map is used to make sure that there is only one mutation
42 // accumulator for a given node even if there are multiple ChildListMutationScop es 42 // accumulator for a given node even if there are multiple ChildListMutationScop es
43 // on the stack. The map is always empty when there are no ChildListMutationScop es 43 // on the stack. The map is always empty when there are no ChildListMutationScop es
44 // on the stack. 44 // on the stack.
45 typedef HeapHashMap<Member<Node>, Member<ChildListMutationAccumulator>> Accumula torMap; 45 typedef HeapHashMap<Member<Node>, Member<ChildListMutationAccumulator>> Accumula torMap;
46 46
47 static AccumulatorMap& accumulatorMap() 47 static AccumulatorMap& accumulatorMap()
48 { 48 {
49 DEFINE_STATIC_LOCAL(Persistent<AccumulatorMap>, map, (new AccumulatorMap())) ; 49 DEFINE_STATIC_LOCAL(AccumulatorMap, map, (new AccumulatorMap));
50 return *map; 50 return map;
51 } 51 }
52 52
53 ChildListMutationAccumulator::ChildListMutationAccumulator(RawPtr<Node> target, RawPtr<MutationObserverInterestGroup> observers) 53 ChildListMutationAccumulator::ChildListMutationAccumulator(RawPtr<Node> target, RawPtr<MutationObserverInterestGroup> observers)
54 : m_target(target) 54 : m_target(target)
55 , m_lastAdded(nullptr) 55 , m_lastAdded(nullptr)
56 , m_observers(observers) 56 , m_observers(observers)
57 , m_mutationScopes(0) 57 , m_mutationScopes(0)
58 { 58 {
59 } 59 }
60 60
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 visitor->trace(m_target); 160 visitor->trace(m_target);
161 visitor->trace(m_removedNodes); 161 visitor->trace(m_removedNodes);
162 visitor->trace(m_addedNodes); 162 visitor->trace(m_addedNodes);
163 visitor->trace(m_previousSibling); 163 visitor->trace(m_previousSibling);
164 visitor->trace(m_nextSibling); 164 visitor->trace(m_nextSibling);
165 visitor->trace(m_lastAdded); 165 visitor->trace(m_lastAdded);
166 visitor->trace(m_observers); 166 visitor->trace(m_observers);
167 } 167 }
168 168
169 } // namespace blink 169 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp ('k') | third_party/WebKit/Source/core/dom/ContextFeatures.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698