Use PassRef for constructing StyleRules.
<https://webkit.org/b/123072>
Let functions that return newly-constructed StyleRuleFoo objects
vend PassRef<StyleRuleFoo> instead of PassRefPtr.
Since StyleRuleBase::copy() has to return something, we can't rely
on ASSERT_NOT_REACHED() + return nullptr anymore, so I've replaced
those with CRASH(). No call sites actually handled null anyway.
Reviewed by Sam Weinig.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157698 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/css/WebKitCSSKeyframesRule.h b/Source/WebCore/css/WebKitCSSKeyframesRule.h
index c364e29..e6baa0c 100644
--- a/Source/WebCore/css/WebKitCSSKeyframesRule.h
+++ b/Source/WebCore/css/WebKitCSSKeyframesRule.h
@@ -39,7 +39,7 @@
class StyleRuleKeyframes : public StyleRuleBase {
public:
- static PassRefPtr<StyleRuleKeyframes> create() { return adoptRef(new StyleRuleKeyframes()); }
+ static PassRef<StyleRuleKeyframes> create() { return adoptRef(*new StyleRuleKeyframes()); }
~StyleRuleKeyframes();
@@ -54,7 +54,7 @@
int findKeyframeIndex(const String& key) const;
- PassRefPtr<StyleRuleKeyframes> copy() const { return adoptRef(new StyleRuleKeyframes(*this)); }
+ PassRef<StyleRuleKeyframes> copy() const { return adoptRef(*new StyleRuleKeyframes(*this)); }
private:
StyleRuleKeyframes();