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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSGlobalRuleSet.cpp

Issue 2589243002: Clear CSSGlobalRuleSet on StyleEngine::didDetach(). (Closed)
Patch Set: reset() -> dispose(). Created 3 years, 12 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/css/CSSGlobalRuleSet.h" 5 #include "core/css/CSSGlobalRuleSet.h"
6 6
7 #include "core/css/CSSDefaultStyleSheets.h" 7 #include "core/css/CSSDefaultStyleSheets.h"
8 #include "core/css/RuleSet.h" 8 #include "core/css/RuleSet.h"
9 #include "core/dom/CSSSelectorWatch.h" 9 #include "core/dom/CSSSelectorWatch.h"
10 #include "core/dom/Document.h" 10 #include "core/dom/Document.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 if (m_watchedSelectorsRuleSet) 63 if (m_watchedSelectorsRuleSet)
64 m_features.add(m_watchedSelectorsRuleSet->features()); 64 m_features.add(m_watchedSelectorsRuleSet->features());
65 65
66 document.styleEngine().collectScopedStyleFeaturesTo(m_features); 66 document.styleEngine().collectScopedStyleFeaturesTo(m_features);
67 67
68 m_siblingRuleSet = makeRuleSet(m_features.siblingRules()); 68 m_siblingRuleSet = makeRuleSet(m_features.siblingRules());
69 m_uncommonAttributeRuleSet = makeRuleSet(m_features.uncommonAttributeRules()); 69 m_uncommonAttributeRuleSet = makeRuleSet(m_features.uncommonAttributeRules());
70 } 70 }
71 71
72 void CSSGlobalRuleSet::dispose() {
73 m_features.clear();
74 m_siblingRuleSet = nullptr;
75 m_uncommonAttributeRuleSet = nullptr;
76 m_watchedSelectorsRuleSet = nullptr;
77 m_hasFullscreenUAStyle = false;
78 m_isDirty = true;
79 }
80
72 DEFINE_TRACE(CSSGlobalRuleSet) { 81 DEFINE_TRACE(CSSGlobalRuleSet) {
73 visitor->trace(m_features); 82 visitor->trace(m_features);
74 visitor->trace(m_siblingRuleSet); 83 visitor->trace(m_siblingRuleSet);
75 visitor->trace(m_uncommonAttributeRuleSet); 84 visitor->trace(m_uncommonAttributeRuleSet);
76 visitor->trace(m_watchedSelectorsRuleSet); 85 visitor->trace(m_watchedSelectorsRuleSet);
77 } 86 }
78 87
79 } // namespace blink 88 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSGlobalRuleSet.h ('k') | third_party/WebKit/Source/core/dom/StyleEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698