2008-06-04 Anders Carlsson <andersca@apple.com>
Reviewed by Darin.
Convert more classes over to start out with a ref count of 1.
* css/CSSImageGeneratorValue.cpp:
(WebCore::CSSImageGeneratorValue::generatedImage):
* css/CSSImageValue.cpp:
(WebCore::CSSImageValue::cachedImage):
* css/CSSMediaRule.cpp:
(WebCore::CSSMediaRule::CSSMediaRule):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseFillSize):
(WebCore::CSSParser::parseCounter):
(WebCore::CSSParser::createRuleList):
* css/CSSRuleList.cpp:
(WebCore::CSSRuleList::CSSRuleList):
* css/CSSRuleList.h:
(WebCore::CSSRuleList::create):
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::matchRules):
(WebCore::CSSStyleSelector::styleRulesForElement):
* css/CSSStyleSelector.h:
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::cssRules):
(WebCore::CSSStyleSheet::addSubresourceURLStrings):
* css/CSSStyleSheet.h:
(WebCore::CSSStyleSheet::rules):
* css/Pair.h:
(WebCore::Pair::create):
(WebCore::Pair::Pair):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::buffered):
(WebCore::HTMLMediaElement::played):
(WebCore::HTMLMediaElement::seekable):
* html/TimeRanges.cpp:
(TimeRanges::TimeRanges):
* html/TimeRanges.h:
(WebCore::TimeRanges::create):
(WebCore::TimeRanges::TimeRanges):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::addCursor):
(WebCore::RenderStyle::clearCursorList):
* rendering/style/RenderStyle.h:
(WebCore::StyleImage::~StyleImage):
(WebCore::StyleImage::StyleImage):
(WebCore::StyleCachedImage::create):
(WebCore::StyleCachedImage::StyleCachedImage):
(WebCore::StyleGeneratedImage::create):
(WebCore::StyleGeneratedImage::StyleGeneratedImage):
(WebCore::CursorList::create):
(WebCore::CursorList::CursorList):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34369 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/css/CSSStyleSheet.cpp b/WebCore/css/CSSStyleSheet.cpp
index 1facad6..4ff0147 100644
--- a/WebCore/css/CSSStyleSheet.cpp
+++ b/WebCore/css/CSSStyleSheet.cpp
@@ -107,9 +107,9 @@
}
-CSSRuleList* CSSStyleSheet::cssRules(bool omitCharsetRules)
+PassRefPtr<CSSRuleList> CSSStyleSheet::cssRules(bool omitCharsetRules)
{
- return new CSSRuleList(this, omitCharsetRules);
+ return CSSRuleList::create(this, omitCharsetRules);
}
void CSSStyleSheet::deleteRule(unsigned index, ExceptionCode& ec)
@@ -205,7 +205,7 @@
void CSSStyleSheet::addSubresourceURLStrings(HashSet<String>& urls, const String& base) const
{
- OwnPtr<CSSRuleList> ruleList(const_cast<CSSStyleSheet*>(this)->cssRules());
+ RefPtr<CSSRuleList> ruleList = const_cast<CSSStyleSheet*>(this)->cssRules();
// Add the URLs for each child import rule, and recurse for the stylesheet belonging to each of those rules.
for (unsigned i = 0; i < ruleList->length(); ++i) {