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

Side by Side Diff: Source/core/css/CSSStyleSheet.h

Issue 170283019: Change various helper classes to transition types to get CSSValue entirely onto the gc heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010, 2012 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 CSSRule* item(unsigned index); 80 CSSRule* item(unsigned index);
81 81
82 virtual void clearOwnerNode() OVERRIDE { didMutate(EntireStyleSheetUpdate); m_ownerNode = 0; } 82 virtual void clearOwnerNode() OVERRIDE { didMutate(EntireStyleSheetUpdate); m_ownerNode = 0; }
83 virtual CSSRule* ownerRule() const OVERRIDE { return m_ownerRule; } 83 virtual CSSRule* ownerRule() const OVERRIDE { return m_ownerRule; }
84 virtual KURL baseURL() const OVERRIDE; 84 virtual KURL baseURL() const OVERRIDE;
85 virtual bool isLoading() const OVERRIDE; 85 virtual bool isLoading() const OVERRIDE;
86 86
87 void clearOwnerRule() { m_ownerRule = 0; } 87 void clearOwnerRule() { m_ownerRule = 0; }
88 Document* ownerDocument() const; 88 Document* ownerDocument() const;
89 MediaQuerySet* mediaQueries() const { return m_mediaQueries.get(); } 89 MediaQuerySet* mediaQueries() const { return m_mediaQueries.get(); }
90 void setMediaQueries(PassRefPtr<MediaQuerySet>); 90 void setMediaQueries(PassRefPtrWillBeRawPtr<MediaQuerySet>);
91 void setTitle(const String& title) { m_title = title; } 91 void setTitle(const String& title) { m_title = title; }
92 92
93 class RuleMutationScope { 93 class RuleMutationScope {
94 WTF_MAKE_NONCOPYABLE(RuleMutationScope); 94 WTF_MAKE_NONCOPYABLE(RuleMutationScope);
95 public: 95 public:
96 RuleMutationScope(CSSStyleSheet*); 96 RuleMutationScope(CSSStyleSheet*);
97 RuleMutationScope(CSSRule*); 97 RuleMutationScope(CSSRule*);
98 ~RuleMutationScope(); 98 ~RuleMutationScope();
99 99
100 private: 100 private:
(...skipping 23 matching lines...) Expand all
124 virtual String type() const OVERRIDE { return "text/css"; } 124 virtual String type() const OVERRIDE { return "text/css"; }
125 125
126 void reattachChildRuleCSSOMWrappers(); 126 void reattachChildRuleCSSOMWrappers();
127 127
128 bool canAccessRules() const; 128 bool canAccessRules() const;
129 129
130 RefPtrWillBePersistent<StyleSheetContents> m_contents; 130 RefPtrWillBePersistent<StyleSheetContents> m_contents;
131 bool m_isInlineStylesheet; 131 bool m_isInlineStylesheet;
132 bool m_isDisabled; 132 bool m_isDisabled;
133 String m_title; 133 String m_title;
134 RefPtr<MediaQuerySet> m_mediaQueries; 134 RefPtrWillBePersistent<MediaQuerySet> m_mediaQueries;
135 135
136 Node* m_ownerNode; 136 Node* m_ownerNode;
137 CSSRule* m_ownerRule; 137 CSSRule* m_ownerRule;
138 138
139 TextPosition m_startPosition; 139 TextPosition m_startPosition;
140 bool m_loadCompleted; 140 bool m_loadCompleted;
141 141
142 mutable RefPtr<MediaList> m_mediaCSSOMWrapper; 142 mutable RefPtrWillBePersistent<MediaList> m_mediaCSSOMWrapper;
143 mutable Vector<RefPtr<CSSRule> > m_childRuleCSSOMWrappers; 143 mutable Vector<RefPtr<CSSRule> > m_childRuleCSSOMWrappers;
144 mutable OwnPtr<CSSRuleList> m_ruleListCSSOMWrapper; 144 mutable OwnPtr<CSSRuleList> m_ruleListCSSOMWrapper;
145 }; 145 };
146 146
147 inline CSSStyleSheet::RuleMutationScope::RuleMutationScope(CSSStyleSheet* sheet) 147 inline CSSStyleSheet::RuleMutationScope::RuleMutationScope(CSSStyleSheet* sheet)
148 : m_styleSheet(sheet) 148 : m_styleSheet(sheet)
149 { 149 {
150 if (m_styleSheet) 150 if (m_styleSheet)
151 m_styleSheet->willMutateRules(); 151 m_styleSheet->willMutateRules();
152 } 152 }
153 153
154 inline CSSStyleSheet::RuleMutationScope::RuleMutationScope(CSSRule* rule) 154 inline CSSStyleSheet::RuleMutationScope::RuleMutationScope(CSSRule* rule)
155 : m_styleSheet(rule ? rule->parentStyleSheet() : 0) 155 : m_styleSheet(rule ? rule->parentStyleSheet() : 0)
156 { 156 {
157 if (m_styleSheet) 157 if (m_styleSheet)
158 m_styleSheet->willMutateRules(); 158 m_styleSheet->willMutateRules();
159 } 159 }
160 160
161 inline CSSStyleSheet::RuleMutationScope::~RuleMutationScope() 161 inline CSSStyleSheet::RuleMutationScope::~RuleMutationScope()
162 { 162 {
163 if (m_styleSheet) 163 if (m_styleSheet)
164 m_styleSheet->didMutateRules(); 164 m_styleSheet->didMutateRules();
165 } 165 }
166 166
167 DEFINE_TYPE_CASTS(CSSStyleSheet, StyleSheet, sheet, sheet->isCSSStyleSheet(), sh eet.isCSSStyleSheet()); 167 DEFINE_TYPE_CASTS(CSSStyleSheet, StyleSheet, sheet, sheet->isCSSStyleSheet(), sh eet.isCSSStyleSheet());
168 168
169 } // namespace 169 } // namespace
170 170
171 #endif 171 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698