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

Side by Side Diff: third_party/WebKit/Source/core/css/resolver/StyleResolver.h

Issue 1382353002: Oilpan: promptly dispose style resolvers upon clearing. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 5 years, 2 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 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 MatchAllRulesExcludingSMIL 73 MatchAllRulesExcludingSMIL
74 }; 74 };
75 75
76 const unsigned styleSharingListSize = 15; 76 const unsigned styleSharingListSize = 15;
77 const unsigned styleSharingMaxDepth = 32; 77 const unsigned styleSharingMaxDepth = 32;
78 using StyleSharingList = WillBeHeapDeque<RawPtrWillBeMember<Element>, styleShari ngListSize>; 78 using StyleSharingList = WillBeHeapDeque<RawPtrWillBeMember<Element>, styleShari ngListSize>;
79 using ActiveInterpolationsMap = HashMap<PropertyHandle, Vector<RefPtr<Interpolat ion>, 1>>; 79 using ActiveInterpolationsMap = HashMap<PropertyHandle, Vector<RefPtr<Interpolat ion>, 1>>;
80 80
81 // This class selects a ComputedStyle for a given element based on a collection of stylesheets. 81 // This class selects a ComputedStyle for a given element based on a collection of stylesheets.
82 class CORE_EXPORT StyleResolver final : public NoBaseWillBeGarbageCollectedFinal ized<StyleResolver> { 82 class CORE_EXPORT StyleResolver final : public NoBaseWillBeGarbageCollectedFinal ized<StyleResolver> {
83 WTF_MAKE_NONCOPYABLE(StyleResolver); WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED (StyleResolver); 83 WTF_MAKE_NONCOPYABLE(StyleResolver);
84 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(StyleResolver);
84 public: 85 public:
85 static PassOwnPtrWillBeRawPtr<StyleResolver> create(Document& document) 86 static PassOwnPtrWillBeRawPtr<StyleResolver> create(Document& document)
86 { 87 {
87 return adoptPtrWillBeNoop(new StyleResolver(document)); 88 return adoptPtrWillBeNoop(new StyleResolver(document));
88 } 89 }
89 ~StyleResolver(); 90 ~StyleResolver();
91 void dispose();
haraken 2015/10/08 06:15:45 Ditto.
90 92
91 // FIXME: StyleResolver should not be keeping tree-walk state. 93 // FIXME: StyleResolver should not be keeping tree-walk state.
92 // These should move to some global tree-walk state, or should be contained in a 94 // These should move to some global tree-walk state, or should be contained in a
93 // TreeWalkContext or similar which is passed in to StyleResolver methods wh en available. 95 // TreeWalkContext or similar which is passed in to StyleResolver methods wh en available.
94 // Using these during tree walk will allow style selector to optimize child and descendant selector lookups. 96 // Using these during tree walk will allow style selector to optimize child and descendant selector lookups.
95 void pushParentElement(Element&); 97 void pushParentElement(Element&);
96 void popParentElement(Element&); 98 void popParentElement(Element&);
97 99
98 PassRefPtr<ComputedStyle> styleForElement(Element*, const ComputedStyle* par entStyle = 0, StyleSharingBehavior = AllowStyleSharing, 100 PassRefPtr<ComputedStyle> styleForElement(Element*, const ComputedStyle* par entStyle = 0, StyleSharingBehavior = AllowStyleSharing,
99 RuleMatchingBehavior = MatchAllRules); 101 RuleMatchingBehavior = MatchAllRules);
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 265
264 OwnPtr<StyleResolverStats> m_styleResolverStats; 266 OwnPtr<StyleResolverStats> m_styleResolverStats;
265 267
266 // Use only for Internals::updateStyleAndReturnAffectedElementCount. 268 // Use only for Internals::updateStyleAndReturnAffectedElementCount.
267 unsigned m_accessCount; 269 unsigned m_accessCount;
268 }; 270 };
269 271
270 } // namespace blink 272 } // namespace blink
271 273
272 #endif // StyleResolver_h 274 #endif // StyleResolver_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698