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

Side by Side Diff: third_party/WebKit/Source/core/dom/Element.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) 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 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
8 * (C) 2007 Eric Seidel (eric@webkit.org) 8 * (C) 2007 Eric Seidel (eric@webkit.org)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 // We need to retain the scroll customization callbacks until the element 141 // We need to retain the scroll customization callbacks until the element
142 // they're associated with is destroyed. It would be simplest if the callbacks 142 // they're associated with is destroyed. It would be simplest if the callbacks
143 // could be stored in ElementRareData, but we can't afford the space 143 // could be stored in ElementRareData, but we can't afford the space
144 // increase. Instead, keep the scroll customization callbacks here. The other 144 // increase. Instead, keep the scroll customization callbacks here. The other
145 // option would be to store these callbacks on the FrameHost or document, but 145 // option would be to store these callbacks on the FrameHost or document, but
146 // that necessitates a bunch more logic for transferring the callbacks between 146 // that necessitates a bunch more logic for transferring the callbacks between
147 // FrameHosts when elements are moved around. 147 // FrameHosts when elements are moved around.
148 ScrollCustomizationCallbacks& scrollCustomizationCallbacks() 148 ScrollCustomizationCallbacks& scrollCustomizationCallbacks()
149 { 149 {
150 ASSERT(RuntimeEnabledFeatures::scrollCustomizationEnabled()); 150 ASSERT(RuntimeEnabledFeatures::scrollCustomizationEnabled());
151 DEFINE_STATIC_LOCAL(Persistent<ScrollCustomizationCallbacks>, 151 DEFINE_STATIC_LOCAL(ScrollCustomizationCallbacks, scrollCustomizationCallbac ks, (new ScrollCustomizationCallbacks));
152 scrollCustomizationCallbacks, (new ScrollCustomizationCallbacks())); 152 return scrollCustomizationCallbacks;
153 return *scrollCustomizationCallbacks;
154 } 153 }
155 154
156 } // namespace 155 } // namespace
157 156
158 using namespace HTMLNames; 157 using namespace HTMLNames;
159 using namespace XMLNames; 158 using namespace XMLNames;
160 159
161 enum class ClassStringContent { Empty, WhiteSpaceOnly, HasClasses }; 160 enum class ClassStringContent { Empty, WhiteSpaceOnly, HasClasses };
162 161
163 RawPtr<Element> Element::create(const QualifiedName& tagName, Document* document ) 162 RawPtr<Element> Element::create(const QualifiedName& tagName, Document* document )
(...skipping 3506 matching lines...) Expand 10 before | Expand all | Expand 10 after
3670 { 3669 {
3671 #if ENABLE(OILPAN) 3670 #if ENABLE(OILPAN)
3672 if (hasRareData()) 3671 if (hasRareData())
3673 visitor->trace(elementRareData()); 3672 visitor->trace(elementRareData());
3674 visitor->trace(m_elementData); 3673 visitor->trace(m_elementData);
3675 #endif 3674 #endif
3676 ContainerNode::trace(visitor); 3675 ContainerNode::trace(visitor);
3677 } 3676 }
3678 3677
3679 } // namespace blink 3678 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/DocumentOrderedMap.cpp ('k') | third_party/WebKit/Source/core/dom/MutationObserver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698