Diff
Modified: trunk/Source/WebCore/ChangeLog (207813 => 207814)
--- trunk/Source/WebCore/ChangeLog 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/ChangeLog 2016-10-25 10:27:12 UTC (rev 207814)
@@ -1,3 +1,115 @@
+2016-10-25 Andreas Kling <[email protected]>
+
+ More PassRefPtr purging in WebCore.
+ <https://webkit.org/b/163895>
+
+ Reviewed by Antti Koivisto.
+
+ Remove PassRefPtr usage in RenderStyle, RenderTheme and Scrollbar, then fix up all the fallout.
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::contentToCSSValue):
+ (WebCore::shapePropertyValue):
+ (WebCore::ComputedStyleExtractor::propertyValue):
+ * css/StyleBuilderConverter.h:
+ (WebCore::StyleBuilderConverter::convertQuotes):
+ * html/HTMLSelectElement.cpp:
+ (WebCore::HTMLSelectElement::usesMenuList):
+ (WebCore::HTMLSelectElement::platformHandleKeydownEvent):
+ (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
+ * html/InputType.cpp:
+ (WebCore::InputType::themeSupportsDataListUI):
+ * html/TextFieldInputType.cpp:
+ (WebCore::TextFieldInputType::shouldHaveSpinButton):
+ (WebCore::TextFieldInputType::shouldHaveCapsLockIndicator):
+ * loader/SubframeLoader.cpp:
+ (WebCore::SubframeLoader::loadPlugin):
+ * page/FrameView.cpp:
+ (WebCore::FrameView::createScrollbar):
+ * page/FrameView.h:
+ * page/animation/CSSPropertyAnimation.cpp:
+ (WebCore::RefCountedPropertyWrapper::RefCountedPropertyWrapper):
+ (WebCore::PropertyWrapperClipPath::PropertyWrapperClipPath):
+ (WebCore::PropertyWrapperShape::PropertyWrapperShape):
+ (WebCore::StyleImagePropertyWrapper::StyleImagePropertyWrapper):
+ (WebCore::FillLayerRefCountedPropertyWrapper::FillLayerRefCountedPropertyWrapper):
+ (WebCore::FillLayerStyleImagePropertyWrapper::FillLayerStyleImagePropertyWrapper):
+ * platform/PopupMenuClient.h:
+ * platform/ScrollView.cpp:
+ (WebCore::ScrollView::createScrollbar):
+ * platform/ScrollView.h:
+ * platform/Scrollbar.cpp:
+ (WebCore::Scrollbar::createNativeScrollbar):
+ * platform/Scrollbar.h:
+ * rendering/FilterEffectRenderer.cpp:
+ (WebCore::FilterEffectRenderer::buildReferenceFilter):
+ * rendering/FilterEffectRenderer.h:
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::createScrollbar):
+ (WebCore::RenderLayer::createLocalTransformState):
+ (WebCore::RenderLayer::hitTestLayerByApplyingTransform):
+ * rendering/RenderLayer.h:
+ * rendering/RenderListBox.cpp:
+ (WebCore::RenderListBox::createScrollbar):
+ * rendering/RenderListBox.h:
+ * rendering/RenderMenuList.cpp:
+ (RenderMenuList::createScrollbar):
+ * rendering/RenderMenuList.h:
+ * rendering/RenderScrollbar.cpp:
+ (WebCore::RenderScrollbar::createCustomScrollbar):
+ * rendering/RenderScrollbar.h:
+ * rendering/RenderSearchField.cpp:
+ (WebCore::RenderSearchField::createScrollbar):
+ * rendering/RenderSearchField.h:
+ * rendering/RenderTheme.h:
+ (WebCore::RenderTheme::defaultTheme):
+ * rendering/RenderThemeEfl.cpp:
+ (WebCore::RenderThemeEfl::create):
+ (WebCore::RenderTheme::themeForPage):
+ * rendering/RenderThemeEfl.h:
+ * rendering/RenderThemeGtk.cpp:
+ (WebCore::RenderTheme::themeForPage):
+ * rendering/RenderThemeIOS.mm:
+ (WebCore::RenderTheme::themeForPage):
+ * rendering/RenderThemeMac.mm:
+ (WebCore::RenderTheme::themeForPage):
+ * rendering/RenderThemeWin.cpp:
+ (WebCore::RenderTheme::themeForPage):
+ * rendering/RenderWidget.cpp:
+ (WebCore::RenderWidget::setWidget):
+ * rendering/RenderWidget.h:
+ * rendering/style/CursorData.h:
+ (WebCore::CursorData::CursorData):
+ (WebCore::CursorData::setImage):
+ * rendering/style/FillLayer.h:
+ (WebCore::FillLayer::setImage):
+ * rendering/style/QuotesData.cpp:
+ (WebCore::QuotesData::create):
+ * rendering/style/QuotesData.h:
+ * rendering/style/RenderStyle.cpp:
+ (WebCore::RenderStyle::addCursor):
+ (WebCore::RenderStyle::setCursorList):
+ (WebCore::RenderStyle::setQuotes):
+ (WebCore::RenderStyle::setWillChange):
+ (WebCore::RenderStyle::setContent):
+ (WebCore::RenderStyle::setListStyleImage):
+ (WebCore::RenderStyle::setBorderImageSource):
+ * rendering/style/RenderStyle.h:
+ (WebCore::RenderStyle::setMaskImage):
+ (WebCore::RenderStyle::setMaskBoxImageSource):
+ (WebCore::RenderStyle::setBoxReflect):
+ (WebCore::RenderStyle::setShapeOutside):
+ (WebCore::RenderStyle::setClipPath):
+ * rendering/style/StyleCachedImage.cpp:
+ (WebCore::StyleCachedImage::cssValue):
+ * rendering/style/StyleCachedImage.h:
+ * rendering/style/StyleGeneratedImage.cpp:
+ (WebCore::StyleGeneratedImage::cssValue):
+ * rendering/style/StyleGeneratedImage.h:
+ * rendering/style/StyleImage.h:
+ * rendering/style/StyleMultiColData.h:
+ * rendering/style/StyleRareInheritedData.h:
+
2016-10-24 Ryosuke Niwa <[email protected]>
Custom elements reactions should have a queue per element
Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (207813 => 207814)
--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp 2016-10-25 10:27:12 UTC (rev 207814)
@@ -1861,7 +1861,7 @@
if (is<CounterContentData>(*contentData))
list.get().append(cssValuePool.createValue(downcast<CounterContentData>(*contentData).counter().identifier(), CSSPrimitiveValue::CSS_COUNTER_NAME));
else if (is<ImageContentData>(*contentData))
- list.get().append(*downcast<ImageContentData>(*contentData).image().cssValue());
+ list.get().append(downcast<ImageContentData>(*contentData).image().cssValue());
else if (is<TextContentData>(*contentData))
list.get().append(cssValuePool.createValue(downcast<TextContentData>(*contentData).text(), CSSPrimitiveValue::CSS_STRING));
}
@@ -2437,7 +2437,7 @@
if (shapeValue->type() == ShapeValue::Type::Image) {
if (shapeValue->image())
- return *shapeValue->image()->cssValue();
+ return shapeValue->image()->cssValue();
return CSSValuePool::singleton().createIdentifierValue(CSSValueNone);
}
@@ -2584,7 +2584,7 @@
RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
for (const FillLayer* currLayer = layers; currLayer; currLayer = currLayer->next()) {
if (currLayer->image())
- list->append(*currLayer->image()->cssValue());
+ list->append(currLayer->image()->cssValue());
else
list->append(cssValuePool.createIdentifierValue(CSSValueNone));
}
@@ -2837,7 +2837,7 @@
list = CSSValueList::createCommaSeparated();
for (unsigned i = 0; i < cursors->size(); ++i)
if (StyleImage* image = cursors->at(i).image())
- list->append(*image->cssValue());
+ list->append(image->cssValue());
}
auto value = cssValuePool.createValue(style->cursor());
if (list) {
Modified: trunk/Source/WebCore/css/StyleBuilderConverter.h (207813 => 207814)
--- trunk/Source/WebCore/css/StyleBuilderConverter.h 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/css/StyleBuilderConverter.h 2016-10-25 10:27:12 UTC (rev 207814)
@@ -86,7 +86,7 @@
static EResize convertResize(StyleResolver&, CSSValue&);
static int convertMarqueeRepetition(StyleResolver&, CSSValue&);
static int convertMarqueeSpeed(StyleResolver&, CSSValue&);
- static PassRefPtr<QuotesData> convertQuotes(StyleResolver&, CSSValue&);
+ static Ref<QuotesData> convertQuotes(StyleResolver&, CSSValue&);
static TextUnderlinePosition convertTextUnderlinePosition(StyleResolver&, CSSValue&);
static RefPtr<StyleReflection> convertReflection(StyleResolver&, CSSValue&);
static IntSize convertInitialLetter(StyleResolver&, CSSValue&);
@@ -585,7 +585,7 @@
return speed;
}
-inline PassRefPtr<QuotesData> StyleBuilderConverter::convertQuotes(StyleResolver&, CSSValue& value)
+inline Ref<QuotesData> StyleBuilderConverter::convertQuotes(StyleResolver&, CSSValue& value)
{
if (is<CSSPrimitiveValue>(value)) {
ASSERT(downcast<CSSPrimitiveValue>(value).valueID() == CSSValueNone);
Modified: trunk/Source/WebCore/html/HTMLSelectElement.cpp (207813 => 207814)
--- trunk/Source/WebCore/html/HTMLSelectElement.cpp 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/html/HTMLSelectElement.cpp 2016-10-25 10:27:12 UTC (rev 207814)
@@ -196,9 +196,7 @@
bool HTMLSelectElement::usesMenuList() const
{
#if !PLATFORM(IOS)
- const Page* page = document().page();
- RefPtr<RenderTheme> renderTheme = page ? &page->theme() : RenderTheme::defaultTheme();
- if (renderTheme->delegatesMenuListRendering())
+ if (RenderTheme::themeForPage(document().page())->delegatesMenuListRendering())
return true;
return !m_multiple && m_size <= 1;
@@ -1092,10 +1090,7 @@
bool HTMLSelectElement::platformHandleKeydownEvent(KeyboardEvent* event)
{
- const Page* page = document().page();
- RefPtr<RenderTheme> renderTheme = page ? &page->theme() : RenderTheme::defaultTheme();
-
- if (!renderTheme->popsMenuByArrowKeys())
+ if (!RenderTheme::themeForPage(document().page())->popsMenuByArrowKeys())
return false;
if (!isSpatialNavigationEnabled(document().frame())) {
@@ -1129,8 +1124,7 @@
ASSERT(renderer());
ASSERT(renderer()->isMenuList());
- const Page* page = document().page();
- RefPtr<RenderTheme> renderTheme = page ? &page->theme() : RenderTheme::defaultTheme();
+ RefPtr<RenderTheme> renderTheme = RenderTheme::themeForPage(document().page());
if (event.type() == eventNames().keydownEvent) {
if (!is<KeyboardEvent>(event))
Modified: trunk/Source/WebCore/html/InputType.cpp (207813 => 207814)
--- trunk/Source/WebCore/html/InputType.cpp 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/html/InputType.cpp 2016-10-25 10:27:12 UTC (rev 207814)
@@ -173,8 +173,7 @@
bool InputType::themeSupportsDataListUI(InputType* type)
{
Document& document = type->element().document();
- RefPtr<RenderTheme> theme = document.page() ? &document.page()->theme() : RenderTheme::defaultTheme();
- return theme->supportsDataListUI(type->formControlType());
+ return RenderTheme::themeForPage(document.page())->supportsDataListUI(type->formControlType());
}
bool InputType::isTextField() const
Modified: trunk/Source/WebCore/html/TextFieldInputType.cpp (207813 => 207814)
--- trunk/Source/WebCore/html/TextFieldInputType.cpp 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/html/TextFieldInputType.cpp 2016-10-25 10:27:12 UTC (rev 207814)
@@ -244,16 +244,12 @@
bool TextFieldInputType::shouldHaveSpinButton() const
{
- Document& document = element().document();
- RefPtr<RenderTheme> theme = document.page() ? &document.page()->theme() : RenderTheme::defaultTheme();
- return theme->shouldHaveSpinButton(element());
+ return RenderTheme::themeForPage(element().document().page())->shouldHaveSpinButton(element());
}
bool TextFieldInputType::shouldHaveCapsLockIndicator() const
{
- Document& document = element().document();
- RefPtr<RenderTheme> theme = document.page() ? &document.page()->theme() : RenderTheme::defaultTheme();
- return theme->shouldHaveCapsLockIndicator(element());
+ return RenderTheme::themeForPage(element().document().page())->shouldHaveCapsLockIndicator(element());
}
void TextFieldInputType::createShadowSubtree()
Modified: trunk/Source/WebCore/loader/SubframeLoader.cpp (207813 => 207814)
--- trunk/Source/WebCore/loader/SubframeLoader.cpp 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/loader/SubframeLoader.cpp 2016-10-25 10:27:12 UTC (rev 207814)
@@ -421,7 +421,7 @@
}
pluginElement.subframeLoaderDidCreatePlugIn(*widget);
- renderer->setWidget(widget);
+ renderer->setWidget(WTFMove(widget));
m_containsPlugins = true;
return true;
}
Modified: trunk/Source/WebCore/page/FrameView.cpp (207813 => 207814)
--- trunk/Source/WebCore/page/FrameView.cpp 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/page/FrameView.cpp 2016-10-25 10:27:12 UTC (rev 207814)
@@ -609,7 +609,7 @@
setCanHaveScrollbars(true);
}
-PassRefPtr<Scrollbar> FrameView::createScrollbar(ScrollbarOrientation orientation)
+Ref<Scrollbar> FrameView::createScrollbar(ScrollbarOrientation orientation)
{
if (!frame().settings().allowCustomScrollbarInMainFrame() && frame().isMainFrame())
return ScrollView::createScrollbar(orientation);
Modified: trunk/Source/WebCore/page/FrameView.h (207813 => 207814)
--- trunk/Source/WebCore/page/FrameView.h 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/page/FrameView.h 2016-10-25 10:27:12 UTC (rev 207814)
@@ -98,7 +98,7 @@
WEBCORE_EXPORT void setCanHaveScrollbars(bool) override;
WEBCORE_EXPORT void updateCanHaveScrollbars();
- PassRefPtr<Scrollbar> createScrollbar(ScrollbarOrientation) override;
+ Ref<Scrollbar> createScrollbar(ScrollbarOrientation) override;
bool avoidScrollbarCreation() const override;
Modified: trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp (207813 => 207814)
--- trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp 2016-10-25 10:27:12 UTC (rev 207814)
@@ -474,7 +474,7 @@
class RefCountedPropertyWrapper : public PropertyWrapperGetter<T*> {
WTF_MAKE_FAST_ALLOCATED;
public:
- RefCountedPropertyWrapper(CSSPropertyID prop, T* (RenderStyle::*getter)() const, void (RenderStyle::*setter)(PassRefPtr<T>))
+ RefCountedPropertyWrapper(CSSPropertyID prop, T* (RenderStyle::*getter)() const, void (RenderStyle::*setter)(RefPtr<T>&&))
: PropertyWrapperGetter<T*>(prop, getter)
, m_setter(setter)
{
@@ -486,7 +486,7 @@
}
protected:
- void (RenderStyle::*m_setter)(PassRefPtr<T>);
+ void (RenderStyle::*m_setter)(RefPtr<T>&&);
};
template <typename T>
@@ -511,7 +511,7 @@
class PropertyWrapperClipPath : public RefCountedPropertyWrapper<ClipPathOperation> {
WTF_MAKE_FAST_ALLOCATED;
public:
- PropertyWrapperClipPath(CSSPropertyID prop, ClipPathOperation* (RenderStyle::*getter)() const, void (RenderStyle::*setter)(PassRefPtr<ClipPathOperation>))
+ PropertyWrapperClipPath(CSSPropertyID prop, ClipPathOperation* (RenderStyle::*getter)() const, void (RenderStyle::*setter)(RefPtr<ClipPathOperation>&&))
: RefCountedPropertyWrapper<ClipPathOperation>(prop, getter, setter)
{
}
@@ -563,7 +563,7 @@
class PropertyWrapperShape : public RefCountedPropertyWrapper<ShapeValue> {
WTF_MAKE_FAST_ALLOCATED;
public:
- PropertyWrapperShape(CSSPropertyID prop, ShapeValue* (RenderStyle::*getter)() const, void (RenderStyle::*setter)(PassRefPtr<ShapeValue>))
+ PropertyWrapperShape(CSSPropertyID prop, ShapeValue* (RenderStyle::*getter)() const, void (RenderStyle::*setter)(RefPtr<ShapeValue>&&))
: RefCountedPropertyWrapper<ShapeValue>(prop, getter, setter)
{
}
@@ -590,7 +590,7 @@
class StyleImagePropertyWrapper : public RefCountedPropertyWrapper<StyleImage> {
WTF_MAKE_FAST_ALLOCATED;
public:
- StyleImagePropertyWrapper(CSSPropertyID prop, StyleImage* (RenderStyle::*getter)() const, void (RenderStyle::*setter)(PassRefPtr<StyleImage>))
+ StyleImagePropertyWrapper(CSSPropertyID prop, StyleImage* (RenderStyle::*getter)() const, void (RenderStyle::*setter)(RefPtr<StyleImage>&&))
: RefCountedPropertyWrapper<StyleImage>(prop, getter, setter)
{
}
@@ -1014,7 +1014,7 @@
class FillLayerRefCountedPropertyWrapper : public FillLayerPropertyWrapperGetter<T*> {
WTF_MAKE_FAST_ALLOCATED;
public:
- FillLayerRefCountedPropertyWrapper(T* (FillLayer::*getter)() const, void (FillLayer::*setter)(PassRefPtr<T>))
+ FillLayerRefCountedPropertyWrapper(T* (FillLayer::*getter)() const, void (FillLayer::*setter)(RefPtr<T>&&))
: FillLayerPropertyWrapperGetter<T*>(getter)
, m_setter(setter)
{
@@ -1026,13 +1026,13 @@
}
protected:
- void (FillLayer::*m_setter)(PassRefPtr<T>);
+ void (FillLayer::*m_setter)(RefPtr<T>&&);
};
class FillLayerStyleImagePropertyWrapper : public FillLayerRefCountedPropertyWrapper<StyleImage> {
WTF_MAKE_FAST_ALLOCATED;
public:
- FillLayerStyleImagePropertyWrapper(StyleImage* (FillLayer::*getter)() const, void (FillLayer::*setter)(PassRefPtr<StyleImage>))
+ FillLayerStyleImagePropertyWrapper(StyleImage* (FillLayer::*getter)() const, void (FillLayer::*setter)(RefPtr<StyleImage>&&))
: FillLayerRefCountedPropertyWrapper<StyleImage>(getter, setter)
{
}
Modified: trunk/Source/WebCore/platform/PopupMenuClient.h (207813 => 207814)
--- trunk/Source/WebCore/platform/PopupMenuClient.h 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/platform/PopupMenuClient.h 2016-10-25 10:27:12 UTC (rev 207814)
@@ -74,7 +74,7 @@
virtual FontSelector* fontSelector() const = 0;
virtual HostWindow* hostWindow() const = 0;
- virtual PassRefPtr<Scrollbar> createScrollbar(ScrollableArea&, ScrollbarOrientation, ScrollbarControlSize) = 0;
+ virtual Ref<Scrollbar> createScrollbar(ScrollableArea&, ScrollbarOrientation, ScrollbarControlSize) = 0;
};
}
Modified: trunk/Source/WebCore/platform/ScrollView.cpp (207813 => 207814)
--- trunk/Source/WebCore/platform/ScrollView.cpp 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/platform/ScrollView.cpp 2016-10-25 10:27:12 UTC (rev 207814)
@@ -118,7 +118,7 @@
return false;
}
-PassRefPtr<Scrollbar> ScrollView::createScrollbar(ScrollbarOrientation orientation)
+Ref<Scrollbar> ScrollView::createScrollbar(ScrollbarOrientation orientation)
{
return Scrollbar::createNativeScrollbar(*this, orientation, RegularScrollbar);
}
Modified: trunk/Source/WebCore/platform/ScrollView.h (207813 => 207814)
--- trunk/Source/WebCore/platform/ScrollView.h 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/platform/ScrollView.h 2016-10-25 10:27:12 UTC (rev 207814)
@@ -140,7 +140,7 @@
WEBCORE_EXPORT void setDelegatesScrolling(bool);
// Overridden by FrameView to create custom CSS scrollbars if applicable.
- virtual PassRefPtr<Scrollbar> createScrollbar(ScrollbarOrientation);
+ virtual Ref<Scrollbar> createScrollbar(ScrollbarOrientation);
void styleDidChange();
Modified: trunk/Source/WebCore/platform/Scrollbar.cpp (207813 => 207814)
--- trunk/Source/WebCore/platform/Scrollbar.cpp 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/platform/Scrollbar.cpp 2016-10-25 10:27:12 UTC (rev 207814)
@@ -43,9 +43,9 @@
namespace WebCore {
-PassRefPtr<Scrollbar> Scrollbar::createNativeScrollbar(ScrollableArea& scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize size)
+Ref<Scrollbar> Scrollbar::createNativeScrollbar(ScrollableArea& scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize size)
{
- return adoptRef(new Scrollbar(scrollableArea, orientation, size));
+ return adoptRef(*new Scrollbar(scrollableArea, orientation, size));
}
int Scrollbar::maxOverlapBetweenPages()
Modified: trunk/Source/WebCore/platform/Scrollbar.h (207813 => 207814)
--- trunk/Source/WebCore/platform/Scrollbar.h 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/platform/Scrollbar.h 2016-10-25 10:27:12 UTC (rev 207814)
@@ -29,7 +29,6 @@
#include "ScrollTypes.h"
#include "Timer.h"
#include "Widget.h"
-#include <wtf/PassRefPtr.h>
#include <wtf/WeakPtr.h>
namespace WebCore {
@@ -43,7 +42,7 @@
class Scrollbar : public Widget {
public:
// Must be implemented by platforms that can't simply use the Scrollbar base class. Right now the only platform that is not using the base class is GTK.
- WEBCORE_EXPORT static PassRefPtr<Scrollbar> createNativeScrollbar(ScrollableArea&, ScrollbarOrientation, ScrollbarControlSize);
+ WEBCORE_EXPORT static Ref<Scrollbar> createNativeScrollbar(ScrollableArea&, ScrollbarOrientation, ScrollbarControlSize);
virtual ~Scrollbar();
Modified: trunk/Source/WebCore/rendering/FilterEffectRenderer.cpp (207813 => 207814)
--- trunk/Source/WebCore/rendering/FilterEffectRenderer.cpp 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/rendering/FilterEffectRenderer.cpp 2016-10-25 10:27:12 UTC (rev 207814)
@@ -85,7 +85,7 @@
return sourceImage() ? &sourceImage()->context() : nullptr;
}
-PassRefPtr<FilterEffect> FilterEffectRenderer::buildReferenceFilter(RenderElement* renderer, PassRefPtr<FilterEffect> previousEffect, ReferenceFilterOperation* filterOperation)
+RefPtr<FilterEffect> FilterEffectRenderer::buildReferenceFilter(RenderElement* renderer, PassRefPtr<FilterEffect> previousEffect, ReferenceFilterOperation* filterOperation)
{
if (!renderer)
return nullptr;
Modified: trunk/Source/WebCore/rendering/FilterEffectRenderer.h (207813 => 207814)
--- trunk/Source/WebCore/rendering/FilterEffectRenderer.h 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/rendering/FilterEffectRenderer.h 2016-10-25 10:27:12 UTC (rev 207814)
@@ -36,7 +36,6 @@
#include "LayoutRect.h"
#include "SVGFilterBuilder.h"
#include "SourceGraphic.h"
-#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
@@ -108,7 +107,7 @@
ImageBuffer* output() const { return lastEffect()->asImageBuffer(); }
bool build(RenderElement*, const FilterOperations&, FilterConsumer);
- PassRefPtr<FilterEffect> buildReferenceFilter(RenderElement*, PassRefPtr<FilterEffect> previousEffect, ReferenceFilterOperation*);
+ RefPtr<FilterEffect> buildReferenceFilter(RenderElement*, PassRefPtr<FilterEffect> previousEffect, ReferenceFilterOperation*);
bool updateBackingStoreRect(const FloatRect& filterRect);
void allocateBackingStoreIfNeeded(const GraphicsContext&);
void clearIntermediateResults();
Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (207813 => 207814)
--- trunk/Source/WebCore/rendering/RenderLayer.cpp 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp 2016-10-25 10:27:12 UTC (rev 207814)
@@ -3105,7 +3105,7 @@
return &renderer;
}
-PassRefPtr<Scrollbar> RenderLayer::createScrollbar(ScrollbarOrientation orientation)
+Ref<Scrollbar> RenderLayer::createScrollbar(ScrollbarOrientation orientation)
{
RefPtr<Scrollbar> widget;
RenderElement* actualRenderer = rendererForScrollbar(renderer());
@@ -3121,7 +3121,7 @@
}
}
renderer().view().frameView().addChild(widget.get());
- return WTFMove(widget);
+ return widget.releaseNonNull();
}
void RenderLayer::destroyScrollbar(ScrollbarOrientation orientation)
@@ -4926,7 +4926,7 @@
return backmappedPoint.z();
}
-PassRefPtr<HitTestingTransformState> RenderLayer::createLocalTransformState(RenderLayer* rootLayer, RenderLayer* containerLayer,
+Ref<HitTestingTransformState> RenderLayer::createLocalTransformState(RenderLayer* rootLayer, RenderLayer* containerLayer,
const LayoutRect& hitTestRect, const HitTestLocation& hitTestLocation,
const HitTestingTransformState* containerTransformState,
const LayoutSize& translationOffset) const
@@ -4954,7 +4954,7 @@
transformState->translate(offset.width(), offset.height(), HitTestingTransformState::AccumulateTransform);
}
- return transformState;
+ return transformState.releaseNonNull();
}
@@ -5308,7 +5308,7 @@
const LayoutSize& translationOffset)
{
// Create a transform state to accumulate this transform.
- RefPtr<HitTestingTransformState> newTransformState = createLocalTransformState(rootLayer, containerLayer, hitTestRect, hitTestLocation, transformState, translationOffset);
+ Ref<HitTestingTransformState> newTransformState = createLocalTransformState(rootLayer, containerLayer, hitTestRect, hitTestLocation, transformState, translationOffset);
// If the transform can't be inverted, then don't hit test this layer at all.
if (!newTransformState->m_accumulatedTransform.isInvertible())
@@ -5330,7 +5330,7 @@
newHitTestLocation = HitTestLocation(localPoint);
// Now do a hit test with the root layer shifted to be us.
- return hitTestLayer(this, containerLayer, request, result, localHitTestRect, newHitTestLocation, true, newTransformState.get(), zOffset);
+ return hitTestLayer(this, containerLayer, request, result, localHitTestRect, newHitTestLocation, true, newTransformState.ptr(), zOffset);
}
bool RenderLayer::hitTestContents(const HitTestRequest& request, HitTestResult& result, const LayoutRect& layerBounds, const HitTestLocation& hitTestLocation, HitTestFilter hitTestFilter) const
Modified: trunk/Source/WebCore/rendering/RenderLayer.h (207813 => 207814)
--- trunk/Source/WebCore/rendering/RenderLayer.h 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/rendering/RenderLayer.h 2016-10-25 10:27:12 UTC (rev 207814)
@@ -213,7 +213,7 @@
void setHasHorizontalScrollbar(bool);
void setHasVerticalScrollbar(bool);
- PassRefPtr<Scrollbar> createScrollbar(ScrollbarOrientation);
+ Ref<Scrollbar> createScrollbar(ScrollbarOrientation);
void destroyScrollbar(ScrollbarOrientation);
bool hasHorizontalScrollbar() const { return horizontalScrollbar(); }
@@ -830,7 +830,7 @@
const HitTestingTransformState* unflattenedTransformState,
bool depthSortDescendants);
- PassRefPtr<HitTestingTransformState> createLocalTransformState(RenderLayer* rootLayer, RenderLayer* containerLayer,
+ Ref<HitTestingTransformState> createLocalTransformState(RenderLayer* rootLayer, RenderLayer* containerLayer,
const LayoutRect& hitTestRect, const HitTestLocation&,
const HitTestingTransformState* containerTransformState,
const LayoutSize& translationOffset = LayoutSize()) const;
Modified: trunk/Source/WebCore/rendering/RenderListBox.cpp (207813 => 207814)
--- trunk/Source/WebCore/rendering/RenderListBox.cpp 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/rendering/RenderListBox.cpp 2016-10-25 10:27:12 UTC (rev 207814)
@@ -896,7 +896,7 @@
document().addConsoleMessage(MessageSource::Other, MessageLevel::Debug, "RenderListBox: " + message);
}
-PassRefPtr<Scrollbar> RenderListBox::createScrollbar()
+Ref<Scrollbar> RenderListBox::createScrollbar()
{
RefPtr<Scrollbar> widget;
bool hasCustomScrollbarStyle = style().hasPseudoStyle(SCROLLBAR);
@@ -911,7 +911,7 @@
}
}
view().frameView().addChild(widget.get());
- return WTFMove(widget);
+ return widget.releaseNonNull();
}
void RenderListBox::destroyScrollbar()
Modified: trunk/Source/WebCore/rendering/RenderListBox.h (207813 => 207814)
--- trunk/Source/WebCore/rendering/RenderListBox.h 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/rendering/RenderListBox.h 2016-10-25 10:27:12 UTC (rev 207814)
@@ -147,7 +147,7 @@
void paintItem(PaintInfo&, const LayoutPoint&, PaintFunction);
void setHasVerticalScrollbar(bool hasScrollbar);
- PassRefPtr<Scrollbar> createScrollbar();
+ Ref<Scrollbar> createScrollbar();
void destroyScrollbar();
int maximumNumberOfItemsThatFitInPaddingBottomArea() const;
Modified: trunk/Source/WebCore/rendering/RenderMenuList.cpp (207813 => 207814)
--- trunk/Source/WebCore/rendering/RenderMenuList.cpp 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/rendering/RenderMenuList.cpp 2016-10-25 10:27:12 UTC (rev 207814)
@@ -570,15 +570,12 @@
return view().frameView().hostWindow();
}
-PassRefPtr<Scrollbar> RenderMenuList::createScrollbar(ScrollableArea& scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize controlSize)
+Ref<Scrollbar> RenderMenuList::createScrollbar(ScrollableArea& scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize controlSize)
{
- RefPtr<Scrollbar> widget;
bool hasCustomScrollbarStyle = style().hasPseudoStyle(SCROLLBAR);
if (hasCustomScrollbarStyle)
- widget = RenderScrollbar::createCustomScrollbar(scrollableArea, orientation, &selectElement());
- else
- widget = Scrollbar::createNativeScrollbar(scrollableArea, orientation, controlSize);
- return WTFMove(widget);
+ return RenderScrollbar::createCustomScrollbar(scrollableArea, orientation, &selectElement());
+ return Scrollbar::createNativeScrollbar(scrollableArea, orientation, controlSize);
}
int RenderMenuList::clientInsetLeft() const
Modified: trunk/Source/WebCore/rendering/RenderMenuList.h (207813 => 207814)
--- trunk/Source/WebCore/rendering/RenderMenuList.h 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/rendering/RenderMenuList.h 2016-10-25 10:27:12 UTC (rev 207814)
@@ -113,7 +113,7 @@
bool multiple() const override;
FontSelector* fontSelector() const override;
HostWindow* hostWindow() const override;
- PassRefPtr<Scrollbar> createScrollbar(ScrollableArea&, ScrollbarOrientation, ScrollbarControlSize) override;
+ Ref<Scrollbar> createScrollbar(ScrollableArea&, ScrollbarOrientation, ScrollbarControlSize) override;
bool hasLineIfEmpty() const override { return true; }
Modified: trunk/Source/WebCore/rendering/RenderScrollbar.cpp (207813 => 207814)
--- trunk/Source/WebCore/rendering/RenderScrollbar.cpp 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/rendering/RenderScrollbar.cpp 2016-10-25 10:27:12 UTC (rev 207814)
@@ -36,9 +36,9 @@
namespace WebCore {
-RefPtr<Scrollbar> RenderScrollbar::createCustomScrollbar(ScrollableArea& scrollableArea, ScrollbarOrientation orientation, Element* ownerElement, Frame* owningFrame)
+Ref<Scrollbar> RenderScrollbar::createCustomScrollbar(ScrollableArea& scrollableArea, ScrollbarOrientation orientation, Element* ownerElement, Frame* owningFrame)
{
- return adoptRef(new RenderScrollbar(scrollableArea, orientation, ownerElement, owningFrame));
+ return adoptRef(*new RenderScrollbar(scrollableArea, orientation, ownerElement, owningFrame));
}
RenderScrollbar::RenderScrollbar(ScrollableArea& scrollableArea, ScrollbarOrientation orientation, Element* ownerElement, Frame* owningFrame)
Modified: trunk/Source/WebCore/rendering/RenderScrollbar.h (207813 => 207814)
--- trunk/Source/WebCore/rendering/RenderScrollbar.h 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/rendering/RenderScrollbar.h 2016-10-25 10:27:12 UTC (rev 207814)
@@ -42,7 +42,7 @@
class RenderScrollbar final : public Scrollbar {
public:
friend class Scrollbar;
- static RefPtr<Scrollbar> createCustomScrollbar(ScrollableArea&, ScrollbarOrientation, Element*, Frame* owningFrame = nullptr);
+ static Ref<Scrollbar> createCustomScrollbar(ScrollableArea&, ScrollbarOrientation, Element*, Frame* owningFrame = nullptr);
virtual ~RenderScrollbar();
RenderBox* owningRenderer() const;
Modified: trunk/Source/WebCore/rendering/RenderSearchField.cpp (207813 => 207814)
--- trunk/Source/WebCore/rendering/RenderSearchField.cpp 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/rendering/RenderSearchField.cpp 2016-10-25 10:27:12 UTC (rev 207814)
@@ -346,15 +346,12 @@
return view().frameView().hostWindow();
}
-PassRefPtr<Scrollbar> RenderSearchField::createScrollbar(ScrollableArea& scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize controlSize)
+Ref<Scrollbar> RenderSearchField::createScrollbar(ScrollableArea& scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize controlSize)
{
- RefPtr<Scrollbar> widget;
bool hasCustomScrollbarStyle = style().hasPseudoStyle(SCROLLBAR);
if (hasCustomScrollbarStyle)
- widget = RenderScrollbar::createCustomScrollbar(scrollableArea, orientation, &inputElement());
- else
- widget = Scrollbar::createNativeScrollbar(scrollableArea, orientation, controlSize);
- return WTFMove(widget);
+ return RenderScrollbar::createCustomScrollbar(scrollableArea, orientation, &inputElement());
+ return Scrollbar::createNativeScrollbar(scrollableArea, orientation, controlSize);
}
LayoutUnit RenderSearchField::computeLogicalHeightLimit() const
Modified: trunk/Source/WebCore/rendering/RenderSearchField.h (207813 => 207814)
--- trunk/Source/WebCore/rendering/RenderSearchField.h 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/rendering/RenderSearchField.h 2016-10-25 10:27:12 UTC (rev 207814)
@@ -80,7 +80,7 @@
void setTextFromItem(unsigned listIndex) override;
FontSelector* fontSelector() const override;
HostWindow* hostWindow() const override;
- PassRefPtr<Scrollbar> createScrollbar(ScrollableArea&, ScrollbarOrientation, ScrollbarControlSize) override;
+ Ref<Scrollbar> createScrollbar(ScrollableArea&, ScrollbarOrientation, ScrollbarControlSize) override;
HTMLElement* resultsButtonElement() const;
HTMLElement* cancelButtonElement() const;
Modified: trunk/Source/WebCore/rendering/RenderTheme.h (207813 => 207814)
--- trunk/Source/WebCore/rendering/RenderTheme.h 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/rendering/RenderTheme.h 2016-10-25 10:27:12 UTC (rev 207814)
@@ -34,7 +34,7 @@
#include "PaintInfo.h"
#include "PopupMenuStyle.h"
#include "ScrollTypes.h"
-#include <wtf/PassRefPtr.h>
+#include <wtf/Ref.h>
#include <wtf/RefCounted.h>
namespace WebCore {
@@ -67,12 +67,12 @@
// This function is to be implemented in your platform-specific theme implementation to hand back the
// appropriate platform theme. When the theme is needed in non-page dependent code, a default theme is
// used as fallback, which is returned for a nulled page, so the platform code needs to account for this.
- static PassRefPtr<RenderTheme> themeForPage(Page* page);
+ static Ref<RenderTheme> themeForPage(Page*);
// When the theme is needed in non-page dependent code, the defaultTheme() is used as fallback.
- static inline PassRefPtr<RenderTheme> defaultTheme()
+ static inline Ref<RenderTheme> defaultTheme()
{
- return themeForPage(0);
+ return themeForPage(nullptr);
};
// This method is called whenever style has been computed for an element and the appearance
Modified: trunk/Source/WebCore/rendering/RenderThemeEfl.cpp (207813 => 207814)
--- trunk/Source/WebCore/rendering/RenderThemeEfl.cpp 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/rendering/RenderThemeEfl.cpp 2016-10-25 10:27:12 UTC (rev 207814)
@@ -410,17 +410,17 @@
return false;
}
-PassRefPtr<RenderTheme> RenderThemeEfl::create(Page* page)
+Ref<RenderTheme> RenderThemeEfl::create(Page* page)
{
- return adoptRef(new RenderThemeEfl(page));
+ return adoptRef(*new RenderThemeEfl(page));
}
-PassRefPtr<RenderTheme> RenderTheme::themeForPage(Page* page)
+Ref<RenderTheme> RenderTheme::themeForPage(Page* page)
{
if (page)
return RenderThemeEfl::create(page);
- static RenderTheme* fallback = RenderThemeEfl::create(0).leakRef();
+ static RenderTheme& fallback = RenderThemeEfl::create(0).leakRef();
return fallback;
}
Modified: trunk/Source/WebCore/rendering/RenderThemeEfl.h (207813 => 207814)
--- trunk/Source/WebCore/rendering/RenderThemeEfl.h 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/rendering/RenderThemeEfl.h 2016-10-25 10:27:12 UTC (rev 207814)
@@ -67,7 +67,7 @@
virtual ~RenderThemeEfl();
public:
- static PassRefPtr<RenderTheme> create(Page*);
+ static Ref<RenderTheme> create(Page*);
// A method asking if the theme's controls actually care about redrawing when hovered.
bool supportsHover(const RenderStyle&) const override { return true; }
Modified: trunk/Source/WebCore/rendering/RenderThemeGtk.cpp (207813 => 207814)
--- trunk/Source/WebCore/rendering/RenderThemeGtk.cpp 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/rendering/RenderThemeGtk.cpp 2016-10-25 10:27:12 UTC (rev 207814)
@@ -67,10 +67,10 @@
return adoptRef(*new RenderThemeGtk());
}
-PassRefPtr<RenderTheme> RenderTheme::themeForPage(Page*)
+Ref<RenderTheme> RenderTheme::themeForPage(Page*)
{
static RenderTheme& rt = RenderThemeGtk::create().leakRef();
- return &rt;
+ return rt;
}
static double getScreenDPI()
Modified: trunk/Source/WebCore/rendering/RenderThemeIOS.mm (207813 => 207814)
--- trunk/Source/WebCore/rendering/RenderThemeIOS.mm 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/rendering/RenderThemeIOS.mm 2016-10-25 10:27:12 UTC (rev 207814)
@@ -294,10 +294,10 @@
CFNotificationCenterAddObserver(CFNotificationCenterGetLocalCenter(), this, contentSizeCategoryDidChange, UIContentSizeCategoryDidChangeNotification, 0, CFNotificationSuspensionBehaviorDeliverImmediately);
}
-PassRefPtr<RenderTheme> RenderTheme::themeForPage(Page*)
+Ref<RenderTheme> RenderTheme::themeForPage(Page*)
{
static RenderTheme& renderTheme = RenderThemeIOS::create().leakRef();
- return &renderTheme;
+ return renderTheme;
}
Ref<RenderTheme> RenderThemeIOS::create()
Modified: trunk/Source/WebCore/rendering/RenderThemeMac.mm (207813 => 207814)
--- trunk/Source/WebCore/rendering/RenderThemeMac.mm 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.mm 2016-10-25 10:27:12 UTC (rev 207814)
@@ -197,10 +197,10 @@
leftPadding
};
-PassRefPtr<RenderTheme> RenderTheme::themeForPage(Page*)
+Ref<RenderTheme> RenderTheme::themeForPage(Page*)
{
static RenderTheme& rt = RenderThemeMac::create().leakRef();
- return &rt;
+ return rt;
}
Ref<RenderTheme> RenderThemeMac::create()
Modified: trunk/Source/WebCore/rendering/RenderThemeWin.cpp (207813 => 207814)
--- trunk/Source/WebCore/rendering/RenderThemeWin.cpp 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/rendering/RenderThemeWin.cpp 2016-10-25 10:27:12 UTC (rev 207814)
@@ -188,10 +188,10 @@
return adoptRef(*new RenderThemeWin);
}
-PassRefPtr<RenderTheme> RenderTheme::themeForPage(Page* page)
+Ref<RenderTheme> RenderTheme::themeForPage(Page* page)
{
static RenderTheme& winTheme = RenderThemeWin::create().leakRef();
- return &winTheme;
+ return winTheme;
}
RenderThemeWin::RenderThemeWin()
Modified: trunk/Source/WebCore/rendering/RenderWidget.cpp (207813 => 207814)
--- trunk/Source/WebCore/rendering/RenderWidget.cpp 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/rendering/RenderWidget.cpp 2016-10-25 10:27:12 UTC (rev 207814)
@@ -161,7 +161,7 @@
return setWidgetGeometry(absoluteContentBox);
}
-void RenderWidget::setWidget(PassRefPtr<Widget> widget)
+void RenderWidget::setWidget(RefPtr<Widget>&& widget)
{
if (widget == m_widget)
return;
Modified: trunk/Source/WebCore/rendering/RenderWidget.h (207813 => 207814)
--- trunk/Source/WebCore/rendering/RenderWidget.h 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/rendering/RenderWidget.h 2016-10-25 10:27:12 UTC (rev 207814)
@@ -63,7 +63,7 @@
HTMLFrameOwnerElement& frameOwnerElement() const { return downcast<HTMLFrameOwnerElement>(nodeForNonAnonymous()); }
Widget* widget() const { return m_widget.get(); }
- WEBCORE_EXPORT void setWidget(PassRefPtr<Widget>);
+ WEBCORE_EXPORT void setWidget(RefPtr<Widget>&&);
static RenderWidget* find(const Widget*);
Modified: trunk/Source/WebCore/rendering/style/CursorData.h (207813 => 207814)
--- trunk/Source/WebCore/rendering/style/CursorData.h 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/rendering/style/CursorData.h 2016-10-25 10:27:12 UTC (rev 207814)
@@ -32,8 +32,8 @@
class CursorData {
public:
- CursorData(PassRefPtr<StyleImage> image, const IntPoint& hotSpot)
- : m_image(image)
+ CursorData(RefPtr<StyleImage>&& image, const IntPoint& hotSpot)
+ : m_image(WTFMove(image))
, m_hotSpot(hotSpot)
{
}
@@ -49,7 +49,7 @@
}
StyleImage* image() const { return m_image.get(); }
- void setImage(PassRefPtr<StyleImage> image) { m_image = image; }
+ void setImage(RefPtr<StyleImage>&& image) { m_image = WTFMove(image); }
// Hot spot in the image in logical pixels.
const IntPoint& hotSpot() const { return m_hotSpot; }
Modified: trunk/Source/WebCore/rendering/style/FillLayer.h (207813 => 207814)
--- trunk/Source/WebCore/rendering/style/FillLayer.h 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/rendering/style/FillLayer.h 2016-10-25 10:27:12 UTC (rev 207814)
@@ -101,7 +101,7 @@
bool isSizeSet() const { return m_sizeType != SizeNone; }
bool isMaskSourceTypeSet() const { return m_maskSourceTypeSet; }
- void setImage(PassRefPtr<StyleImage> image) { m_image = image; m_imageSet = true; }
+ void setImage(RefPtr<StyleImage>&& image) { m_image = WTFMove(image); m_imageSet = true; }
void setXPosition(Length length) { m_xPosition = WTFMove(length); m_xPosSet = true; }
void setYPosition(Length length) { m_yPosition = WTFMove(length); m_yPosSet = true; }
void setBackgroundXOrigin(Edge o) { m_backgroundXOrigin = static_cast<unsigned>(o); m_backgroundOriginSet = true; }
Modified: trunk/Source/WebCore/rendering/style/QuotesData.cpp (207813 => 207814)
--- trunk/Source/WebCore/rendering/style/QuotesData.cpp 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/rendering/style/QuotesData.cpp 2016-10-25 10:27:12 UTC (rev 207814)
@@ -29,10 +29,10 @@
return sizeof(QuotesData) + sizeof(std::pair<String, String>) * count;
}
-PassRefPtr<QuotesData> QuotesData::create(const Vector<std::pair<String, String>>& quotes)
+Ref<QuotesData> QuotesData::create(const Vector<std::pair<String, String>>& quotes)
{
void* slot = fastMalloc(sizeForQuotesDataWithQuoteCount(quotes.size()));
- return adoptRef(new (NotNull, slot) QuotesData(quotes));
+ return adoptRef(*new (NotNull, slot) QuotesData(quotes));
}
QuotesData::QuotesData(const Vector<std::pair<String, String>>& quotes)
Modified: trunk/Source/WebCore/rendering/style/QuotesData.h (207813 => 207814)
--- trunk/Source/WebCore/rendering/style/QuotesData.h 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/rendering/style/QuotesData.h 2016-10-25 10:27:12 UTC (rev 207814)
@@ -22,7 +22,6 @@
#ifndef QuotesData_h
#define QuotesData_h
-#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/Vector.h>
#include <wtf/text/WTFString.h>
@@ -36,7 +35,7 @@
class QuotesData : public RefCounted<QuotesData> {
public:
- static PassRefPtr<QuotesData> create(const Vector<std::pair<String, String>>& quotes);
+ static Ref<QuotesData> create(const Vector<std::pair<String, String>>& quotes);
~QuotesData();
friend bool operator==(const QuotesData&, const QuotesData&);
Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (207813 => 207814)
--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp 2016-10-25 10:27:12 UTC (rev 207814)
@@ -945,27 +945,27 @@
data->clip.left() = left;
}
-void RenderStyle::addCursor(PassRefPtr<StyleImage> image, const IntPoint& hotSpot)
+void RenderStyle::addCursor(RefPtr<StyleImage>&& image, const IntPoint& hotSpot)
{
if (!rareInheritedData.access()->cursorData)
rareInheritedData.access()->cursorData = CursorList::create();
- rareInheritedData.access()->cursorData->append(CursorData(image, hotSpot));
+ rareInheritedData.access()->cursorData->append(CursorData(WTFMove(image), hotSpot));
}
-void RenderStyle::setCursorList(PassRefPtr<CursorList> other)
+void RenderStyle::setCursorList(RefPtr<CursorList>&& list)
{
- rareInheritedData.access()->cursorData = other;
+ rareInheritedData.access()->cursorData = WTFMove(list);
}
-void RenderStyle::setQuotes(PassRefPtr<QuotesData> q)
+void RenderStyle::setQuotes(RefPtr<QuotesData>&& q)
{
if (rareInheritedData->quotes == q || (rareInheritedData->quotes && q && *rareInheritedData->quotes == *q))
return;
- rareInheritedData.access()->quotes = q;
+ rareInheritedData.access()->quotes = WTFMove(q);
}
-void RenderStyle::setWillChange(PassRefPtr<WillChangeData> willChangeData)
+void RenderStyle::setWillChange(RefPtr<WillChangeData>&& willChangeData)
{
if (arePointingToEqualData(rareNonInheritedData->m_willChange.get(), willChangeData.get()))
return;
@@ -998,7 +998,7 @@
content = WTFMove(contentData);
}
-void RenderStyle::setContent(PassRefPtr<StyleImage> image, bool add)
+void RenderStyle::setContent(RefPtr<StyleImage>&& image, bool add)
{
if (!image)
return;
@@ -1008,7 +1008,7 @@
return;
}
- rareNonInheritedData.access()->m_content = std::make_unique<ImageContentData>(image);
+ rareNonInheritedData.access()->m_content = std::make_unique<ImageContentData>(WTFMove(image));
if (!rareNonInheritedData.access()->m_altText.isNull())
rareNonInheritedData.access()->m_content->setAltText(rareNonInheritedData.access()->m_altText);
}
@@ -1179,10 +1179,10 @@
}
StyleImage* RenderStyle::listStyleImage() const { return rareInheritedData->listStyleImage.get(); }
-void RenderStyle::setListStyleImage(PassRefPtr<StyleImage> v)
+void RenderStyle::setListStyleImage(RefPtr<StyleImage>&& v)
{
if (rareInheritedData->listStyleImage != v)
- rareInheritedData.access()->listStyleImage = v;
+ rareInheritedData.access()->listStyleImage = WTFMove(v);
}
const Color& RenderStyle::color() const
@@ -1879,11 +1879,11 @@
}
}
-void RenderStyle::setBorderImageSource(PassRefPtr<StyleImage> image)
+void RenderStyle::setBorderImageSource(RefPtr<StyleImage>&& image)
{
if (surround->border.m_image.image() == image.get())
return;
- surround.access()->border.m_image.setImage(image);
+ surround.access()->border.m_image.setImage(WTFMove(image));
}
void RenderStyle::setBorderImageSlices(LengthBox slices)
Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (207813 => 207814)
--- trunk/Source/WebCore/rendering/style/RenderStyle.h 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h 2016-10-25 10:27:12 UTC (rev 207814)
@@ -1303,7 +1303,7 @@
void setBackgroundSizeLength(LengthSize size) { SET_VAR(m_background, m_background.m_sizeLength, WTFMove(size)); }
void setBorderImage(const NinePieceImage& b) { SET_VAR(surround, border.m_image, b); }
- void setBorderImageSource(PassRefPtr<StyleImage>);
+ void setBorderImageSource(RefPtr<StyleImage>&&);
void setBorderImageSlices(LengthBox);
void setBorderImageWidth(LengthBox);
void setBorderImageOutset(LengthBox);
@@ -1443,10 +1443,10 @@
}
}
- void setMaskImage(PassRefPtr<StyleImage> v) { rareNonInheritedData.access()->m_mask.setImage(v); }
+ void setMaskImage(RefPtr<StyleImage>&& v) { rareNonInheritedData.access()->m_mask.setImage(WTFMove(v)); }
void setMaskBoxImage(const NinePieceImage& b) { SET_VAR(rareNonInheritedData, m_maskBoxImage, b); }
- void setMaskBoxImageSource(PassRefPtr<StyleImage> v) { rareNonInheritedData.access()->m_maskBoxImage.setImage(v); }
+ void setMaskBoxImageSource(RefPtr<StyleImage>&& v) { rareNonInheritedData.access()->m_maskBoxImage.setImage(WTFMove(v)); }
void setMaskXPosition(Length length) { SET_VAR(rareNonInheritedData, m_mask.m_xPosition, WTFMove(length)); }
void setMaskYPosition(Length length) { SET_VAR(rareNonInheritedData, m_mask.m_yPosition, WTFMove(length)); }
void setMaskSize(LengthSize size) { SET_VAR(rareNonInheritedData, m_mask.m_sizeLength, WTFMove(size)); }
@@ -1462,7 +1462,7 @@
void setAspectRatioNumerator(float v) { SET_VAR(rareNonInheritedData, m_aspectRatioNumerator, v); }
void setListStyleType(EListStyleType v) { inherited_flags._list_style_type = v; }
- void setListStyleImage(PassRefPtr<StyleImage>);
+ void setListStyleImage(RefPtr<StyleImage>&&);
void setListStylePosition(EListStylePosition v) { inherited_flags._list_style_position = v; }
void resetMargin() { SET_VAR(surround, margin, LengthBox(Fixed)); }
@@ -1481,8 +1481,8 @@
void setPaddingRight(Length length) { SET_VAR(surround, padding.right(), WTFMove(length)); }
void setCursor(ECursor c) { inherited_flags._cursor_style = c; }
- void addCursor(PassRefPtr<StyleImage>, const IntPoint& hotSpot = IntPoint());
- void setCursorList(PassRefPtr<CursorList>);
+ void addCursor(RefPtr<StyleImage>&&, const IntPoint& hotSpot = IntPoint());
+ void setCursorList(RefPtr<CursorList>&&);
void clearCursorList();
#if ENABLE(CURSOR_VISIBILITY)
@@ -1529,7 +1529,7 @@
void setBoxOrient(EBoxOrient o) { SET_NESTED_VAR(rareNonInheritedData, m_deprecatedFlexibleBox, orient, o); }
void setBoxPack(EBoxPack p) { SET_NESTED_VAR(rareNonInheritedData, m_deprecatedFlexibleBox, pack, p); }
void setBoxShadow(std::unique_ptr<ShadowData>, bool add = false);
- void setBoxReflect(PassRefPtr<StyleReflection> reflect) { if (rareNonInheritedData->m_boxReflect != reflect) rareNonInheritedData.access()->m_boxReflect = reflect; }
+ void setBoxReflect(RefPtr<StyleReflection>&& reflect) { if (rareNonInheritedData->m_boxReflect != reflect) rareNonInheritedData.access()->m_boxReflect = WTFMove(reflect); }
void setBoxSizing(EBoxSizing s) { SET_VAR(m_box, m_boxSizing, s); }
void setFlexGrow(float f) { SET_NESTED_VAR(rareNonInheritedData, m_flexibleBox, m_flexGrow, f); }
void setFlexShrink(float f) { SET_NESTED_VAR(rareNonInheritedData, m_flexibleBox, m_flexShrink, f); }
@@ -1793,11 +1793,11 @@
SVGLength kerning() const { return svgStyle().kerning(); }
void setKerning(SVGLength k) { accessSVGStyle().setKerning(k); }
- void setShapeOutside(PassRefPtr<ShapeValue> value)
+ void setShapeOutside(RefPtr<ShapeValue>&& value)
{
if (rareNonInheritedData->m_shapeOutside == value)
return;
- rareNonInheritedData.access()->m_shapeOutside = value;
+ rareNonInheritedData.access()->m_shapeOutside = WTFMove(value);
}
ShapeValue* shapeOutside() const { return rareNonInheritedData->m_shapeOutside.get(); }
@@ -1815,10 +1815,10 @@
}
static float initialShapeImageThreshold() { return 0; }
- void setClipPath(PassRefPtr<ClipPathOperation> operation)
+ void setClipPath(RefPtr<ClipPathOperation>&& operation)
{
if (rareNonInheritedData->m_clipPath != operation)
- rareNonInheritedData.access()->m_clipPath = operation;
+ rareNonInheritedData.access()->m_clipPath = WTFMove(operation);
}
ClipPathOperation* clipPath() const { return rareNonInheritedData->m_clipPath.get(); }
@@ -1829,7 +1829,7 @@
bool contentDataEquivalent(const RenderStyle* otherStyle) const { return const_cast<RenderStyle*>(this)->rareNonInheritedData->contentDataEquivalent(*const_cast<RenderStyle*>(otherStyle)->rareNonInheritedData); }
void clearContent();
void setContent(const String&, bool add = false);
- void setContent(PassRefPtr<StyleImage>, bool add = false);
+ void setContent(RefPtr<StyleImage>&&, bool add = false);
void setContent(std::unique_ptr<CounterContent>, bool add = false);
void setContent(QuoteType, bool add = false);
void setContentAltText(const String&);
@@ -1842,10 +1842,10 @@
const CounterDirectives getCounterDirectives(const AtomicString& identifier) const;
QuotesData* quotes() const { return rareInheritedData->quotes.get(); }
- void setQuotes(PassRefPtr<QuotesData>);
+ void setQuotes(RefPtr<QuotesData>&&);
WillChangeData* willChange() const { return rareNonInheritedData->m_willChange.get(); }
- void setWillChange(PassRefPtr<WillChangeData>);
+ void setWillChange(RefPtr<WillChangeData>&&);
bool willChangeCreatesStackingContext() const
{
Modified: trunk/Source/WebCore/rendering/style/StyleCachedImage.cpp (207813 => 207814)
--- trunk/Source/WebCore/rendering/style/StyleCachedImage.cpp 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/rendering/style/StyleCachedImage.cpp 2016-10-25 10:27:12 UTC (rev 207814)
@@ -96,9 +96,9 @@
return m_cachedImage.get();
}
-PassRefPtr<CSSValue> StyleCachedImage::cssValue() const
+Ref<CSSValue> StyleCachedImage::cssValue() const
{
- return const_cast<CSSValue*>(m_cssValue.ptr());
+ return const_cast<CSSValue&>(m_cssValue.get());
}
bool StyleCachedImage::canRender(const RenderElement* renderer, float multiplier) const
Modified: trunk/Source/WebCore/rendering/style/StyleCachedImage.h (207813 => 207814)
--- trunk/Source/WebCore/rendering/style/StyleCachedImage.h 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/rendering/style/StyleCachedImage.h 2016-10-25 10:27:12 UTC (rev 207814)
@@ -46,7 +46,7 @@
WrappedImagePtr data() const override { return m_cachedImage.get(); }
- PassRefPtr<CSSValue> cssValue() const override;
+ Ref<CSSValue> cssValue() const override;
bool canRender(const RenderElement*, float multiplier) const override;
bool isPending() const override;
Modified: trunk/Source/WebCore/rendering/style/StyleGeneratedImage.cpp (207813 => 207814)
--- trunk/Source/WebCore/rendering/style/StyleGeneratedImage.cpp 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/rendering/style/StyleGeneratedImage.cpp 2016-10-25 10:27:12 UTC (rev 207814)
@@ -37,9 +37,9 @@
m_isGeneratedImage = true;
}
-PassRefPtr<CSSValue> StyleGeneratedImage::cssValue() const
+Ref<CSSValue> StyleGeneratedImage::cssValue() const
{
- return const_cast<CSSImageGeneratorValue*>(m_imageGeneratorValue.ptr());
+ return const_cast<CSSImageGeneratorValue&>(m_imageGeneratorValue.get());
}
bool StyleGeneratedImage::isPending() const
Modified: trunk/Source/WebCore/rendering/style/StyleGeneratedImage.h (207813 => 207814)
--- trunk/Source/WebCore/rendering/style/StyleGeneratedImage.h 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/rendering/style/StyleGeneratedImage.h 2016-10-25 10:27:12 UTC (rev 207814)
@@ -45,7 +45,7 @@
WrappedImagePtr data() const override { return m_imageGeneratorValue.ptr(); }
- PassRefPtr<CSSValue> cssValue() const override;
+ Ref<CSSValue> cssValue() const override;
bool isPending() const override;
void load(CachedResourceLoader&, const ResourceLoaderOptions&) override;
Modified: trunk/Source/WebCore/rendering/style/StyleImage.h (207813 => 207814)
--- trunk/Source/WebCore/rendering/style/StyleImage.h 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/rendering/style/StyleImage.h 2016-10-25 10:27:12 UTC (rev 207814)
@@ -27,7 +27,6 @@
#include "CSSValue.h"
#include "FloatSize.h"
#include "Image.h"
-#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
#include <wtf/TypeCasts.h>
@@ -49,7 +48,7 @@
virtual bool operator==(const StyleImage& other) const = 0;
- virtual PassRefPtr<CSSValue> cssValue() const = 0;
+ virtual Ref<CSSValue> cssValue() const = 0;
virtual bool canRender(const RenderElement*, float /*multiplier*/) const { return true; }
virtual bool isPending() const = 0;
Modified: trunk/Source/WebCore/rendering/style/StyleMultiColData.h (207813 => 207814)
--- trunk/Source/WebCore/rendering/style/StyleMultiColData.h 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/rendering/style/StyleMultiColData.h 2016-10-25 10:27:12 UTC (rev 207814)
@@ -28,7 +28,6 @@
#include "BorderValue.h"
#include "Length.h"
#include "RenderStyleConstants.h"
-#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
namespace WebCore {
Modified: trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h (207813 => 207814)
--- trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h 2016-10-25 10:27:12 UTC (rev 207814)
@@ -30,7 +30,6 @@
#include "Length.h"
#include "StyleCustomPropertyData.h"
#include <wtf/RefCounted.h>
-#include <wtf/PassRefPtr.h>
#include <wtf/text/AtomicString.h>
#if ENABLE(TEXT_AUTOSIZING)
Modified: trunk/Source/WebKit2/ChangeLog (207813 => 207814)
--- trunk/Source/WebKit2/ChangeLog 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebKit2/ChangeLog 2016-10-25 10:27:12 UTC (rev 207814)
@@ -1,3 +1,14 @@
+2016-10-25 Andreas Kling <[email protected]>
+
+ More PassRefPtr purging in WebCore.
+ <https://webkit.org/b/163895>
+
+ Reviewed by Antti Koivisto.
+
+ * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h:
+ * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
+ (WebKit::PDFPlugin::createScrollbar):
+
2016-10-25 Carlos Garcia Campos <[email protected]>
NetworkSession: switch to use subclasses for NetworkSession and NetworkDataTask implementations
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h (207813 => 207814)
--- trunk/Source/WebKit2/WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h 2016-10-25 10:27:12 UTC (rev 207814)
@@ -218,7 +218,7 @@
// PDFPlugin functions.
void updateScrollbars();
- PassRefPtr<WebCore::Scrollbar> createScrollbar(WebCore::ScrollbarOrientation);
+ Ref<WebCore::Scrollbar> createScrollbar(WebCore::ScrollbarOrientation);
void destroyScrollbar(WebCore::ScrollbarOrientation);
void pdfDocumentDidLoad();
void addArchiveResource();
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm (207813 => 207814)
--- trunk/Source/WebKit2/WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm 2016-10-25 10:25:29 UTC (rev 207813)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm 2016-10-25 10:27:12 UTC (rev 207814)
@@ -649,7 +649,7 @@
return static_cast<const PluginView*>(controller());
}
-PassRefPtr<Scrollbar> PDFPlugin::createScrollbar(ScrollbarOrientation orientation)
+Ref<Scrollbar> PDFPlugin::createScrollbar(ScrollbarOrientation orientation)
{
auto widget = Scrollbar::createNativeScrollbar(*this, orientation, RegularScrollbar);
if (orientation == HorizontalScrollbar) {
@@ -659,7 +659,7 @@
m_verticalScrollbarLayer = adoptNS([[WKPDFPluginScrollbarLayer alloc] initWithPDFPlugin:this]);
[m_containerLayer addSublayer:m_verticalScrollbarLayer.get()];
}
- didAddScrollbar(widget.get(), orientation);
+ didAddScrollbar(widget.ptr(), orientation);
if (Frame* frame = webFrame()->coreFrame()) {
if (Page* page = frame->page()) {
if (page->expectsWheelEventTriggers())
@@ -666,7 +666,7 @@
scrollAnimator().setWheelEventTestTrigger(page->testTrigger());
}
}
- pluginView()->frame()->view()->addChild(widget.get());
+ pluginView()->frame()->view()->addChild(widget.ptr());
return widget;
}