Use Vector<OwnPtr> for m_viewportDependentMediaQueryResults in CSSStyleSelector
authorcaio.oliveira@openbossa.org <caio.oliveira@openbossa.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Jan 2012 14:30:30 +0000 (14:30 +0000)
committercaio.oliveira@openbossa.org <caio.oliveira@openbossa.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Jan 2012 14:30:30 +0000 (14:30 +0000)
https://bugs.webkit.org/show_bug.cgi?id=75723

Reviewed by Andreas Kling.

* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::~CSSStyleSelector):
(WebCore::CSSStyleSelector::addViewportDependentMediaQueryResult):
* css/CSSStyleSelector.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@104457 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/css/CSSStyleSelector.cpp
Source/WebCore/css/CSSStyleSelector.h

index a7a13ed..43ec407 100644 (file)
@@ -1,3 +1,15 @@
+2012-01-09  Caio Marcelo de Oliveira Filho  <caio.oliveira@openbossa.org>
+
+        Use Vector<OwnPtr> for m_viewportDependentMediaQueryResults in CSSStyleSelector
+        https://bugs.webkit.org/show_bug.cgi?id=75723
+
+        Reviewed by Andreas Kling.
+
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::~CSSStyleSelector):
+        (WebCore::CSSStyleSelector::addViewportDependentMediaQueryResult):
+        * css/CSSStyleSelector.h:
+
 2012-01-09  Alexis Menard  <alexis.menard@openbossa.org>
 
         Extend CSSValueList to allow slash separated lists.
index c7c3861..08838f2 100644 (file)
@@ -479,7 +479,6 @@ void CSSStyleSelector::addKeyframeStyle(PassRefPtr<WebKitCSSKeyframesRule> rule)
 CSSStyleSelector::~CSSStyleSelector()
 {
     m_fontSelector->clearDocument();
-    deleteAllValues(m_viewportDependentMediaQueryResults);
 }
 
 CSSStyleSelector::Features::Features()
@@ -4704,7 +4703,7 @@ bool CSSStyleSelector::hasSelectorForAttribute(const AtomicString &attrname) con
 
 void CSSStyleSelector::addViewportDependentMediaQueryResult(const MediaQueryExp* expr, bool result)
 {
-    m_viewportDependentMediaQueryResults.append(new MediaQueryResult(*expr, result));
+    m_viewportDependentMediaQueryResults.append(adoptPtr(new MediaQueryResult(*expr, result)));
 }
 
 bool CSSStyleSelector::affectedByViewportChange() const
index 872b634..a2622ae 100644 (file)
@@ -397,7 +397,7 @@ private:
     bool m_sameOriginOnly;
 
     RefPtr<CSSFontSelector> m_fontSelector;
-    Vector<MediaQueryResult*> m_viewportDependentMediaQueryResults;
+    Vector<OwnPtr<MediaQueryResult> > m_viewportDependentMediaQueryResults;
 
     bool m_applyPropertyToRegularStyle;
     bool m_applyPropertyToVisitedLinkStyle;