https://bugs.webkit.org/show_bug.cgi?id=144841
Reviewed by Darin Adler.
To kill PassRefPtr, this patch replaces PassRefPtr with Ref or RefPtr
in WebCore/page.
Source/WebCore:
No new tests, no behavior changes.
* page/DebugPageOverlays.cpp:
* page/EventSource.cpp:
(WebCore::EventSource::create):
* page/EventSource.h:
* page/History.h:
(WebCore::History::create):
* page/Location.h:
(WebCore::Location::create):
* page/MainFrame.cpp:
(WebCore::MainFrame::create):
* page/MainFrame.h:
* page/Navigator.h:
(WebCore::Navigator::create):
* page/PageOverlay.cpp:
(WebCore::PageOverlay::create):
* page/PageOverlay.h:
* page/Performance.h:
* page/PerformanceEntryList.h:
(WebCore::PerformanceEntryList::create):
* page/PerformanceMark.h:
(WebCore::PerformanceMark::create):
* page/PerformanceMeasure.h:
(WebCore::PerformanceMeasure::create):
* page/PerformanceNavigation.h:
(WebCore::PerformanceNavigation::create):
* page/PerformanceResourceTiming.h:
(WebCore::PerformanceResourceTiming::create):
* page/PerformanceTiming.h:
(WebCore::PerformanceTiming::create):
* page/PerformanceUserTiming.h:
(WebCore::UserTiming::create):
* page/Screen.h:
* page/Settings.cpp:
(WebCore::Settings::create):
* page/Settings.h:
* page/TextIndicator.cpp:
(WebCore::TextIndicator::create):
* page/TextIndicator.h:
* page/UserContentController.cpp:
(WebCore::UserContentController::create):
* page/UserContentController.h:
* page/UserMessageHandlerDescriptor.h:
(WebCore::UserMessageHandlerDescriptor::create):
* page/UserMessageHandlersNamespace.h:
* page/VisitedLinkStore.h:
* page/WebKitNamespace.h:
(WebCore::WebKitNamespace::create):
* page/WebKitPoint.h:
(WebCore::WebKitPoint::create):
* page/WorkerNavigator.h:
(WebCore::WorkerNavigator::create):
* page/animation/ImplicitAnimation.h:
(WebCore::ImplicitAnimation::create):
* page/animation/KeyframeAnimation.h:
* page/mac/ServicesOverlayController.h:
* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::Highlight::createForSelection):
(WebCore::ServicesOverlayController::Highlight::createForTelephoneNumber):
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::create):
* page/scrolling/ScrollingCoordinator.h:
* page/scrolling/ScrollingStateFixedNode.cpp:
(WebCore::ScrollingStateFixedNode::create):
(WebCore::ScrollingStateFixedNode::clone):
* page/scrolling/ScrollingStateFixedNode.h:
* page/scrolling/ScrollingStateFrameScrollingNode.cpp:
(WebCore::ScrollingStateFrameScrollingNode::create):
(WebCore::ScrollingStateFrameScrollingNode::clone):
* page/scrolling/ScrollingStateFrameScrollingNode.h:
* page/scrolling/ScrollingStateNode.h:
* page/scrolling/ScrollingStateOverflowScrollingNode.cpp:
(WebCore::ScrollingStateOverflowScrollingNode::create):
(WebCore::ScrollingStateOverflowScrollingNode::clone):
* page/scrolling/ScrollingStateOverflowScrollingNode.h:
* page/scrolling/ScrollingStateStickyNode.cpp:
(WebCore::ScrollingStateStickyNode::create):
(WebCore::ScrollingStateStickyNode::clone):
* page/scrolling/ScrollingStateStickyNode.h:
* page/scrolling/ios/ScrollingCoordinatorIOS.mm:
(WebCore::ScrollingCoordinator::create):
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
(WebCore::ScrollingTreeFrameScrollingNodeIOS::create):
* page/scrolling/ios/ScrollingTreeIOS.cpp:
(WebCore::ScrollingTreeIOS::create):
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinator::create):
* page/scrolling/mac/ScrollingTreeFixedNode.h:
* page/scrolling/mac/ScrollingTreeFixedNode.mm:
(WebCore::ScrollingTreeFixedNode::create):
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::create):
* page/scrolling/mac/ScrollingTreeMac.cpp:
(ScrollingTreeMac::create):
* page/scrolling/mac/ScrollingTreeMac.h:
* page/scrolling/mac/ScrollingTreeStickyNode.h:
* page/scrolling/mac/ScrollingTreeStickyNode.mm:
(WebCore::ScrollingTreeStickyNode::create):
Source/WebKit2:
(WebKit::WebUserContentController::WebUserContentController):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setTextIndicator):
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::didPerformDictionaryLookup):
* WebProcess/UserContent/WebUserContentController.cpp:
(WebKit::WebUserContentController::WebUserContentController):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@184066
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2015-05-10 Gyuyoung Kim <gyuyoung.kim@webkit.org>
+
+ Use Ref instead of PassRefPtr in WebCore/page
+ https://bugs.webkit.org/show_bug.cgi?id=144841
+
+ Reviewed by Darin Adler.
+
+ To kill PassRefPtr, this patch replaces PassRefPtr with Ref or RefPtr
+ in WebCore/page.
+
+ No new tests, no behavior changes.
+
+ * page/DebugPageOverlays.cpp:
+ * page/EventSource.cpp:
+ (WebCore::EventSource::create):
+ * page/EventSource.h:
+ * page/History.h:
+ (WebCore::History::create):
+ * page/Location.h:
+ (WebCore::Location::create):
+ * page/MainFrame.cpp:
+ (WebCore::MainFrame::create):
+ * page/MainFrame.h:
+ * page/Navigator.h:
+ (WebCore::Navigator::create):
+ * page/PageOverlay.cpp:
+ (WebCore::PageOverlay::create):
+ * page/PageOverlay.h:
+ * page/Performance.h:
+ * page/PerformanceEntryList.h:
+ (WebCore::PerformanceEntryList::create):
+ * page/PerformanceMark.h:
+ (WebCore::PerformanceMark::create):
+ * page/PerformanceMeasure.h:
+ (WebCore::PerformanceMeasure::create):
+ * page/PerformanceNavigation.h:
+ (WebCore::PerformanceNavigation::create):
+ * page/PerformanceResourceTiming.h:
+ (WebCore::PerformanceResourceTiming::create):
+ * page/PerformanceTiming.h:
+ (WebCore::PerformanceTiming::create):
+ * page/PerformanceUserTiming.h:
+ (WebCore::UserTiming::create):
+ * page/Screen.h:
+ * page/Settings.cpp:
+ (WebCore::Settings::create):
+ * page/Settings.h:
+ * page/TextIndicator.cpp:
+ (WebCore::TextIndicator::create):
+ * page/TextIndicator.h:
+ * page/UserContentController.cpp:
+ (WebCore::UserContentController::create):
+ * page/UserContentController.h:
+ * page/UserMessageHandlerDescriptor.h:
+ (WebCore::UserMessageHandlerDescriptor::create):
+ * page/UserMessageHandlersNamespace.h:
+ * page/VisitedLinkStore.h:
+ * page/WebKitNamespace.h:
+ (WebCore::WebKitNamespace::create):
+ * page/WebKitPoint.h:
+ (WebCore::WebKitPoint::create):
+ * page/WorkerNavigator.h:
+ (WebCore::WorkerNavigator::create):
+ * page/animation/ImplicitAnimation.h:
+ (WebCore::ImplicitAnimation::create):
+ * page/animation/KeyframeAnimation.h:
+ * page/mac/ServicesOverlayController.h:
+ * page/mac/ServicesOverlayController.mm:
+ (WebCore::ServicesOverlayController::Highlight::createForSelection):
+ (WebCore::ServicesOverlayController::Highlight::createForTelephoneNumber):
+ * page/scrolling/ScrollingCoordinator.cpp:
+ (WebCore::ScrollingCoordinator::create):
+ * page/scrolling/ScrollingCoordinator.h:
+ * page/scrolling/ScrollingStateFixedNode.cpp:
+ (WebCore::ScrollingStateFixedNode::create):
+ (WebCore::ScrollingStateFixedNode::clone):
+ * page/scrolling/ScrollingStateFixedNode.h:
+ * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
+ (WebCore::ScrollingStateFrameScrollingNode::create):
+ (WebCore::ScrollingStateFrameScrollingNode::clone):
+ * page/scrolling/ScrollingStateFrameScrollingNode.h:
+ * page/scrolling/ScrollingStateNode.h:
+ * page/scrolling/ScrollingStateOverflowScrollingNode.cpp:
+ (WebCore::ScrollingStateOverflowScrollingNode::create):
+ (WebCore::ScrollingStateOverflowScrollingNode::clone):
+ * page/scrolling/ScrollingStateOverflowScrollingNode.h:
+ * page/scrolling/ScrollingStateStickyNode.cpp:
+ (WebCore::ScrollingStateStickyNode::create):
+ (WebCore::ScrollingStateStickyNode::clone):
+ * page/scrolling/ScrollingStateStickyNode.h:
+ * page/scrolling/ios/ScrollingCoordinatorIOS.mm:
+ (WebCore::ScrollingCoordinator::create):
+ * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
+ * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
+ (WebCore::ScrollingTreeFrameScrollingNodeIOS::create):
+ * page/scrolling/ios/ScrollingTreeIOS.cpp:
+ (WebCore::ScrollingTreeIOS::create):
+ * page/scrolling/mac/ScrollingCoordinatorMac.mm:
+ (WebCore::ScrollingCoordinator::create):
+ * page/scrolling/mac/ScrollingTreeFixedNode.h:
+ * page/scrolling/mac/ScrollingTreeFixedNode.mm:
+ (WebCore::ScrollingTreeFixedNode::create):
+ * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
+ * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
+ (WebCore::ScrollingTreeFrameScrollingNodeMac::create):
+ * page/scrolling/mac/ScrollingTreeMac.cpp:
+ (ScrollingTreeMac::create):
+ * page/scrolling/mac/ScrollingTreeMac.h:
+ * page/scrolling/mac/ScrollingTreeStickyNode.h:
+ * page/scrolling/mac/ScrollingTreeStickyNode.mm:
+ (WebCore::ScrollingTreeStickyNode::create):
+
2015-05-10 Simon Fraser <simon.fraser@apple.com>
background-position sometimes doesn't work properly with background-attachment: fixed
class MouseWheelRegionOverlay final : public RegionOverlay {
public:
- static PassRefPtr<MouseWheelRegionOverlay> create(MainFrame& frame)
+ static Ref<MouseWheelRegionOverlay> create(MainFrame& frame)
{
- return adoptRef(new MouseWheelRegionOverlay(frame));
+ return adoptRef(*new MouseWheelRegionOverlay(frame));
}
private:
class NonFastScrollableRegionOverlay final : public RegionOverlay {
public:
- static PassRefPtr<NonFastScrollableRegionOverlay> create(MainFrame& frame)
+ static Ref<NonFastScrollableRegionOverlay> create(MainFrame& frame)
{
- return adoptRef(new NonFastScrollableRegionOverlay(frame));
+ return adoptRef(*new NonFastScrollableRegionOverlay(frame));
}
private:
eventSourceInit.get("withCredentials", m_withCredentials);
}
-PassRefPtr<EventSource> EventSource::create(ScriptExecutionContext& context, const String& url, const Dictionary& eventSourceInit, ExceptionCode& ec)
+RefPtr<EventSource> EventSource::create(ScriptExecutionContext& context, const String& url, const Dictionary& eventSourceInit, ExceptionCode& ec)
{
if (url.isEmpty()) {
ec = SYNTAX_ERR;
class EventSource final : public RefCounted<EventSource>, public EventTargetWithInlineData, private ThreadableLoaderClient, public ActiveDOMObject {
WTF_MAKE_FAST_ALLOCATED;
public:
- static PassRefPtr<EventSource> create(ScriptExecutionContext&, const String& url, const Dictionary&, ExceptionCode&);
+ static RefPtr<EventSource> create(ScriptExecutionContext&, const String& url, const Dictionary&, ExceptionCode&);
virtual ~EventSource();
static const unsigned long long defaultReconnectDelay;
class History : public ScriptWrappable, public RefCounted<History>, public DOMWindowProperty {
public:
- static PassRefPtr<History> create(Frame* frame) { return adoptRef(new History(frame)); }
+ static Ref<History> create(Frame* frame) { return adoptRef(*new History(frame)); }
unsigned length() const;
PassRefPtr<SerializedScriptValue> state();
class Location : public ScriptWrappable, public RefCounted<Location>, public DOMWindowProperty {
public:
- static PassRefPtr<Location> create(Frame* frame) { return adoptRef(new Location(frame)); }
+ static Ref<Location> create(Frame* frame) { return adoptRef(*new Location(frame)); }
void setHref(const String&, DOMWindow& activeWindow, DOMWindow& firstWindow);
String href() const;
m_diagnosticLoggingClient->mainFrameDestroyed();
}
-RefPtr<MainFrame> MainFrame::create(Page& page, PageConfiguration& configuration)
+Ref<MainFrame> MainFrame::create(Page& page, PageConfiguration& configuration)
{
- return adoptRef(new MainFrame(page, configuration));
+ return adoptRef(*new MainFrame(page, configuration));
}
void MainFrame::selfOnlyRef()
class MainFrame final : public Frame {
public:
- static RefPtr<MainFrame> create(Page&, PageConfiguration&);
+ static Ref<MainFrame> create(Page&, PageConfiguration&);
virtual ~MainFrame();
class Navigator : public NavigatorBase, public ScriptWrappable, public RefCounted<Navigator>, public DOMWindowProperty, public Supplementable<Navigator> {
public:
- static PassRefPtr<Navigator> create(Frame* frame) { return adoptRef(new Navigator(frame)); }
+ static Ref<Navigator> create(Frame* frame) { return adoptRef(*new Navigator(frame)); }
virtual ~Navigator();
String appVersion() const;
return ++pageOverlayID;
}
-PassRefPtr<PageOverlay> PageOverlay::create(Client& client, OverlayType overlayType)
+Ref<PageOverlay> PageOverlay::create(Client& client, OverlayType overlayType)
{
- return adoptRef(new PageOverlay(client, overlayType));
+ return adoptRef(*new PageOverlay(client, overlayType));
}
PageOverlay::PageOverlay(Client& client, OverlayType overlayType)
Document, // Scales and scrolls with the document.
};
- WEBCORE_EXPORT static PassRefPtr<PageOverlay> create(Client&, OverlayType = OverlayType::View);
+ WEBCORE_EXPORT static Ref<PageOverlay> create(Client&, OverlayType = OverlayType::View);
WEBCORE_EXPORT virtual ~PageOverlay();
WEBCORE_EXPORT PageOverlayController* controller() const;
class Performance final : public ScriptWrappable, public RefCounted<Performance>, public DOMWindowProperty, public EventTargetWithInlineData {
public:
- static PassRefPtr<Performance> create(Frame* frame) { return adoptRef(new Performance(frame)); }
+ static Ref<Performance> create(Frame* frame) { return adoptRef(*new Performance(frame)); }
~Performance();
virtual EventTargetInterface eventTargetInterface() const override { return PerformanceEventTargetInterfaceType; }
class PerformanceEntryList : public RefCounted<PerformanceEntryList> {
public:
- static PassRefPtr<PerformanceEntryList> create() { return adoptRef(new PerformanceEntryList); }
+ static Ref<PerformanceEntryList> create() { return adoptRef(*new PerformanceEntryList); }
~PerformanceEntryList();
unsigned length() const;
class PerformanceMark : public PerformanceEntry {
public:
- static PassRefPtr<PerformanceMark> create(const String& name, double startTime) { return adoptRef(new PerformanceMark(name, startTime)); }
+ static Ref<PerformanceMark> create(const String& name, double startTime) { return adoptRef(*new PerformanceMark(name, startTime)); }
virtual bool isMark() { return true; }
class PerformanceMeasure : public PerformanceEntry {
public:
- static PassRefPtr<PerformanceMeasure> create(const String& name, double startTime, double duration) { return adoptRef(new PerformanceMeasure(name, startTime, duration)); }
+ static Ref<PerformanceMeasure> create(const String& name, double startTime, double duration) { return adoptRef(*new PerformanceMeasure(name, startTime, duration)); }
virtual bool isMeasure() { return true; }
class PerformanceNavigation : public RefCounted<PerformanceNavigation>, public DOMWindowProperty {
public:
- static PassRefPtr<PerformanceNavigation> create(Frame* frame) { return adoptRef(new PerformanceNavigation(frame)); }
+ static Ref<PerformanceNavigation> create(Frame* frame) { return adoptRef(*new PerformanceNavigation(frame)); }
enum PerformanceNavigationType {
TYPE_NAVIGATE,
class PerformanceResourceTiming : public PerformanceEntry {
public:
- static PassRefPtr<PerformanceResourceTiming> create(const AtomicString& initiatorType, const ResourceRequest& request, const ResourceResponse& response, double initiationTime, double finishTime, Document* requestingDocument)
+ static Ref<PerformanceResourceTiming> create(const AtomicString& initiatorType, const ResourceRequest& request, const ResourceResponse& response, double initiationTime, double finishTime, Document* requestingDocument)
{
- return adoptRef(new PerformanceResourceTiming(initiatorType, request, response, initiationTime, finishTime, requestingDocument));
+ return adoptRef(*new PerformanceResourceTiming(initiatorType, request, response, initiationTime, finishTime, requestingDocument));
}
AtomicString initiatorType() const;
class PerformanceTiming : public RefCounted<PerformanceTiming>, public DOMWindowProperty {
public:
- static PassRefPtr<PerformanceTiming> create(Frame* frame) { return adoptRef(new PerformanceTiming(frame)); }
+ static Ref<PerformanceTiming> create(Frame* frame) { return adoptRef(*new PerformanceTiming(frame)); }
unsigned long long navigationStart() const;
unsigned long long unloadEventStart() const;
class UserTiming : public RefCounted<UserTiming> {
public:
- static PassRefPtr<UserTiming> create(Performance* performance) { return adoptRef(new UserTiming(performance)); }
+ static Ref<UserTiming> create(Performance* performance) { return adoptRef(*new UserTiming(performance)); }
void mark(const String& markName, ExceptionCode&);
void clearMarks(const String& markName);
class Screen final : public ScriptWrappable, public RefCounted<Screen>, public DOMWindowProperty {
public:
- static PassRefPtr<Screen> create(Frame* frame) { return adoptRef(new Screen(frame)); }
+ static Ref<Screen> create(Frame* frame) { return adoptRef(*new Screen(frame)); }
unsigned height() const;
unsigned width() const;
{
}
-PassRefPtr<Settings> Settings::create(Page* page)
+Ref<Settings> Settings::create(Page* page)
{
- return adoptRef(new Settings(page));
+ return adoptRef(*new Settings(page));
}
SETTINGS_SETTER_BODIES
class Settings : public RefCounted<Settings> {
WTF_MAKE_NONCOPYABLE(Settings); WTF_MAKE_FAST_ALLOCATED;
public:
- static PassRefPtr<Settings> create(Page*);
+ static Ref<Settings> create(Page*);
~Settings();
void pageDestroyed() { m_page = nullptr; }
return false;
}
-PassRefPtr<TextIndicator> TextIndicator::create(const TextIndicatorData& data)
+Ref<TextIndicator> TextIndicator::create(const TextIndicatorData& data)
{
- return adoptRef(new TextIndicator(data));
+ return adoptRef(*new TextIndicator(data));
}
-PassRefPtr<TextIndicator> TextIndicator::createWithRange(const Range& range, TextIndicatorPresentationTransition presentationTransition)
+RefPtr<TextIndicator> TextIndicator::createWithRange(const Range& range, TextIndicatorPresentationTransition presentationTransition)
{
Frame* frame = range.startContainer()->document().frame();
// FIXME (138889): Ideally the FrameSnapshotting functions would be more flexible
// and we wouldn't have to implement this here.
-static PassRefPtr<Image> snapshotSelectionWithHighlight(Frame& frame)
+static RefPtr<Image> snapshotSelectionWithHighlight(Frame& frame)
{
auto& selection = frame.selection();
return snapshot->copyImage(CopyBackingStore, Unscaled);
}
-PassRefPtr<TextIndicator> TextIndicator::createWithSelectionInFrame(Frame& frame, TextIndicatorPresentationTransition presentationTransition)
+RefPtr<TextIndicator> TextIndicator::createWithSelectionInFrame(Frame& frame, TextIndicatorPresentationTransition presentationTransition)
{
IntRect selectionRect = enclosingIntRect(frame.selection().selectionBounds());
std::unique_ptr<ImageBuffer> indicatorBuffer = snapshotSelection(frame, SnapshotOptionsForceBlackText);
class TextIndicator : public RefCounted<TextIndicator> {
public:
- WEBCORE_EXPORT static PassRefPtr<TextIndicator> create(const TextIndicatorData&);
- WEBCORE_EXPORT static PassRefPtr<TextIndicator> createWithSelectionInFrame(Frame&, TextIndicatorPresentationTransition);
- WEBCORE_EXPORT static PassRefPtr<TextIndicator> createWithRange(const Range&, TextIndicatorPresentationTransition);
+ WEBCORE_EXPORT static Ref<TextIndicator> create(const TextIndicatorData&);
+ WEBCORE_EXPORT static RefPtr<TextIndicator> createWithSelectionInFrame(Frame&, TextIndicatorPresentationTransition);
+ WEBCORE_EXPORT static RefPtr<TextIndicator> createWithRange(const Range&, TextIndicatorPresentationTransition);
WEBCORE_EXPORT ~TextIndicator();
namespace WebCore {
-RefPtr<UserContentController> UserContentController::create()
+Ref<UserContentController> UserContentController::create()
{
- return adoptRef(new UserContentController);
+ return adoptRef(*new UserContentController);
}
UserContentController::UserContentController()
class UserContentController : public RefCounted<UserContentController> {
public:
- WEBCORE_EXPORT static RefPtr<UserContentController> create();
+ WEBCORE_EXPORT static Ref<UserContentController> create();
WEBCORE_EXPORT ~UserContentController();
void addPage(Page&);
virtual void didPostMessage(UserMessageHandler&, SerializedScriptValue*) = 0;
};
- static PassRefPtr<UserMessageHandlerDescriptor> create(const AtomicString& name, DOMWrapperWorld& world, Client& client)
+ static Ref<UserMessageHandlerDescriptor> create(const AtomicString& name, DOMWrapperWorld& world, Client& client)
{
- return adoptRef(new UserMessageHandlerDescriptor(name, world, client));
+ return adoptRef(*new UserMessageHandlerDescriptor(name, world, client));
}
WEBCORE_EXPORT ~UserMessageHandlerDescriptor();
#include "FrameDestructionObserver.h"
#include "UserMessageHandler.h"
-#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
#include <wtf/Vector.h>
#include <wtf/Forward.h>
#include <wtf/HashSet.h>
-#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
namespace WebCore {
#if ENABLE(USER_MESSAGE_HANDLERS)
#include "DOMWindowProperty.h"
-#include <wtf/PassRefPtr.h>
#include <wtf/Ref.h>
#include <wtf/RefCounted.h>
class WebKitNamespace : public DOMWindowProperty, public RefCounted<WebKitNamespace> {
public:
- static PassRefPtr<WebKitNamespace> create(Frame& frame)
+ static Ref<WebKitNamespace> create(Frame& frame)
{
- return adoptRef(new WebKitNamespace(frame));
+ return adoptRef(*new WebKitNamespace(frame));
}
virtual ~WebKitNamespace();
class WebKitPoint : public RefCounted<WebKitPoint> {
public:
- static PassRefPtr<WebKitPoint> create()
+ static Ref<WebKitPoint> create()
{
- return adoptRef(new WebKitPoint());
+ return adoptRef(*new WebKitPoint);
}
- static PassRefPtr<WebKitPoint> create(float x, float y)
+ static Ref<WebKitPoint> create(float x, float y)
{
- return adoptRef(new WebKitPoint(x, y));
+ return adoptRef(*new WebKitPoint(x, y));
}
float x() const { return m_x; }
class WorkerNavigator : public NavigatorBase, public RefCounted<WorkerNavigator>, public Supplementable<WorkerNavigator> {
public:
- static PassRefPtr<WorkerNavigator> create(const String& userAgent) { return adoptRef(new WorkerNavigator(userAgent)); }
+ static Ref<WorkerNavigator> create(const String& userAgent) { return adoptRef(*new WorkerNavigator(userAgent)); }
virtual ~WorkerNavigator();
virtual String userAgent() const;
// for a single RenderElement.
class ImplicitAnimation : public AnimationBase {
public:
- static PassRefPtr<ImplicitAnimation> create(Animation& animation, CSSPropertyID animatingProperty, RenderElement* renderer, CompositeAnimation* compositeAnimation, RenderStyle* fromStyle)
+ static Ref<ImplicitAnimation> create(Animation& animation, CSSPropertyID animatingProperty, RenderElement* renderer, CompositeAnimation* compositeAnimation, RenderStyle* fromStyle)
{
- return adoptRef(new ImplicitAnimation(animation, animatingProperty, renderer, compositeAnimation, fromStyle));
+ return adoptRef(*new ImplicitAnimation(animation, animatingProperty, renderer, compositeAnimation, fromStyle));
};
CSSPropertyID transitionProperty() const { return m_transitionProperty; }
// A KeyframeAnimation tracks the state of an explicit animation for a single RenderElement.
class KeyframeAnimation final : public AnimationBase {
public:
- static RefPtr<KeyframeAnimation> create(Animation& animation, RenderElement* renderer, int index, CompositeAnimation* compositeAnimation, RenderStyle* unanimatedStyle)
+ static Ref<KeyframeAnimation> create(Animation& animation, RenderElement* renderer, int index, CompositeAnimation* compositeAnimation, RenderStyle* unanimatedStyle)
{
- return adoptRef(new KeyframeAnimation(animation, renderer, index, compositeAnimation, unanimatedStyle));
+ return adoptRef(*new KeyframeAnimation(animation, renderer, index, compositeAnimation, unanimatedStyle));
}
virtual bool animate(CompositeAnimation*, RenderElement*, const RenderStyle* currentStyle, RenderStyle* targetStyle, RefPtr<RenderStyle>& animatedStyle) override;
class Highlight : public RefCounted<Highlight>, private GraphicsLayerClient {
WTF_MAKE_NONCOPYABLE(Highlight);
public:
- static PassRefPtr<Highlight> createForSelection(ServicesOverlayController&, RetainPtr<DDHighlightRef>, PassRefPtr<Range>);
- static PassRefPtr<Highlight> createForTelephoneNumber(ServicesOverlayController&, RetainPtr<DDHighlightRef>, PassRefPtr<Range>);
+ static Ref<Highlight> createForSelection(ServicesOverlayController&, RetainPtr<DDHighlightRef>, PassRefPtr<Range>);
+ static Ref<Highlight> createForTelephoneNumber(ServicesOverlayController&, RetainPtr<DDHighlightRef>, PassRefPtr<Range>);
~Highlight();
void invalidate();
namespace WebCore {
-PassRefPtr<ServicesOverlayController::Highlight> ServicesOverlayController::Highlight::createForSelection(ServicesOverlayController& controller, RetainPtr<DDHighlightRef> ddHighlight, PassRefPtr<Range> range)
+Ref<ServicesOverlayController::Highlight> ServicesOverlayController::Highlight::createForSelection(ServicesOverlayController& controller, RetainPtr<DDHighlightRef> ddHighlight, PassRefPtr<Range> range)
{
- return adoptRef(new Highlight(controller, Type::Selection, ddHighlight, range));
+ return adoptRef(*new Highlight(controller, Type::Selection, ddHighlight, range));
}
-PassRefPtr<ServicesOverlayController::Highlight> ServicesOverlayController::Highlight::createForTelephoneNumber(ServicesOverlayController& controller, RetainPtr<DDHighlightRef> ddHighlight, PassRefPtr<Range> range)
+Ref<ServicesOverlayController::Highlight> ServicesOverlayController::Highlight::createForTelephoneNumber(ServicesOverlayController& controller, RetainPtr<DDHighlightRef> ddHighlight, PassRefPtr<Range> range)
{
- return adoptRef(new Highlight(controller, Type::TelephoneNumber, ddHighlight, range));
+ return adoptRef(*new Highlight(controller, Type::TelephoneNumber, ddHighlight, range));
}
ServicesOverlayController::Highlight::Highlight(ServicesOverlayController& controller, Type type, RetainPtr<DDHighlightRef> ddHighlight, PassRefPtr<WebCore::Range> range)
namespace WebCore {
#if !PLATFORM(COCOA)
-PassRefPtr<ScrollingCoordinator> ScrollingCoordinator::create(Page* page)
+Ref<ScrollingCoordinator> ScrollingCoordinator::create(Page* page)
{
#if USE(COORDINATED_GRAPHICS)
- return adoptRef(new ScrollingCoordinatorCoordinatedGraphics(page));
+ return adoptRef(*new ScrollingCoordinatorCoordinatedGraphics(page));
#endif
- return adoptRef(new ScrollingCoordinator(page));
+ return adoptRef(*new ScrollingCoordinator(page));
}
#endif
class ScrollingCoordinator : public ThreadSafeRefCounted<ScrollingCoordinator> {
public:
- static PassRefPtr<ScrollingCoordinator> create(Page*);
+ static Ref<ScrollingCoordinator> create(Page*);
virtual ~ScrollingCoordinator();
WEBCORE_EXPORT virtual void pageDestroyed();
namespace WebCore {
-PassRefPtr<ScrollingStateFixedNode> ScrollingStateFixedNode::create(ScrollingStateTree& stateTree, ScrollingNodeID nodeID)
+Ref<ScrollingStateFixedNode> ScrollingStateFixedNode::create(ScrollingStateTree& stateTree, ScrollingNodeID nodeID)
{
- return adoptRef(new ScrollingStateFixedNode(stateTree, nodeID));
+ return adoptRef(*new ScrollingStateFixedNode(stateTree, nodeID));
}
ScrollingStateFixedNode::ScrollingStateFixedNode(ScrollingStateTree& tree, ScrollingNodeID nodeID)
{
}
-PassRefPtr<ScrollingStateNode> ScrollingStateFixedNode::clone(ScrollingStateTree& adoptiveTree)
+Ref<ScrollingStateNode> ScrollingStateFixedNode::clone(ScrollingStateTree& adoptiveTree)
{
- return adoptRef(new ScrollingStateFixedNode(*this, adoptiveTree));
+ return adoptRef(*new ScrollingStateFixedNode(*this, adoptiveTree));
}
void ScrollingStateFixedNode::updateConstraints(const FixedPositionViewportConstraints& constraints)
class ScrollingStateFixedNode final : public ScrollingStateNode {
public:
- static PassRefPtr<ScrollingStateFixedNode> create(ScrollingStateTree&, ScrollingNodeID);
+ static Ref<ScrollingStateFixedNode> create(ScrollingStateTree&, ScrollingNodeID);
- virtual PassRefPtr<ScrollingStateNode> clone(ScrollingStateTree&) override;
+ virtual Ref<ScrollingStateNode> clone(ScrollingStateTree&) override;
virtual ~ScrollingStateFixedNode();
namespace WebCore {
-PassRefPtr<ScrollingStateFrameScrollingNode> ScrollingStateFrameScrollingNode::create(ScrollingStateTree& stateTree, ScrollingNodeID nodeID)
+Ref<ScrollingStateFrameScrollingNode> ScrollingStateFrameScrollingNode::create(ScrollingStateTree& stateTree, ScrollingNodeID nodeID)
{
- return adoptRef(new ScrollingStateFrameScrollingNode(stateTree, nodeID));
+ return adoptRef(*new ScrollingStateFrameScrollingNode(stateTree, nodeID));
}
ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode(ScrollingStateTree& stateTree, ScrollingNodeID nodeID)
{
}
-PassRefPtr<ScrollingStateNode> ScrollingStateFrameScrollingNode::clone(ScrollingStateTree& adoptiveTree)
+Ref<ScrollingStateNode> ScrollingStateFrameScrollingNode::clone(ScrollingStateTree& adoptiveTree)
{
- return adoptRef(new ScrollingStateFrameScrollingNode(*this, adoptiveTree));
+ return adoptRef(*new ScrollingStateFrameScrollingNode(*this, adoptiveTree));
}
void ScrollingStateFrameScrollingNode::setFrameScaleFactor(float scaleFactor)
class ScrollingStateFrameScrollingNode final : public ScrollingStateScrollingNode {
public:
- static PassRefPtr<ScrollingStateFrameScrollingNode> create(ScrollingStateTree&, ScrollingNodeID);
+ static Ref<ScrollingStateFrameScrollingNode> create(ScrollingStateTree&, ScrollingNodeID);
- virtual PassRefPtr<ScrollingStateNode> clone(ScrollingStateTree&) override;
+ virtual Ref<ScrollingStateNode> clone(ScrollingStateTree&) override;
virtual ~ScrollingStateFrameScrollingNode();
bool isFrameScrollingNode() const { return m_nodeType == FrameScrollingNode; }
bool isOverflowScrollingNode() const { return m_nodeType == OverflowScrollingNode; }
- virtual PassRefPtr<ScrollingStateNode> clone(ScrollingStateTree& adoptiveTree) = 0;
+ virtual Ref<ScrollingStateNode> clone(ScrollingStateTree& adoptiveTree) = 0;
PassRefPtr<ScrollingStateNode> cloneAndReset(ScrollingStateTree& adoptiveTree);
void cloneAndResetChildren(ScrollingStateNode&, ScrollingStateTree& adoptiveTree);
namespace WebCore {
-PassRefPtr<ScrollingStateOverflowScrollingNode> ScrollingStateOverflowScrollingNode::create(ScrollingStateTree& stateTree, ScrollingNodeID nodeID)
+Ref<ScrollingStateOverflowScrollingNode> ScrollingStateOverflowScrollingNode::create(ScrollingStateTree& stateTree, ScrollingNodeID nodeID)
{
- return adoptRef(new ScrollingStateOverflowScrollingNode(stateTree, nodeID));
+ return adoptRef(*new ScrollingStateOverflowScrollingNode(stateTree, nodeID));
}
ScrollingStateOverflowScrollingNode::ScrollingStateOverflowScrollingNode(ScrollingStateTree& stateTree, ScrollingNodeID nodeID)
{
}
-PassRefPtr<ScrollingStateNode> ScrollingStateOverflowScrollingNode::clone(ScrollingStateTree& adoptiveTree)
+Ref<ScrollingStateNode> ScrollingStateOverflowScrollingNode::clone(ScrollingStateTree& adoptiveTree)
{
- return adoptRef(new ScrollingStateOverflowScrollingNode(*this, adoptiveTree));
+ return adoptRef(*new ScrollingStateOverflowScrollingNode(*this, adoptiveTree));
}
void ScrollingStateOverflowScrollingNode::setScrolledContentsLayer(const LayerRepresentation& layerRepresentation)
class ScrollingStateOverflowScrollingNode : public ScrollingStateScrollingNode {
public:
- static PassRefPtr<ScrollingStateOverflowScrollingNode> create(ScrollingStateTree&, ScrollingNodeID);
+ static Ref<ScrollingStateOverflowScrollingNode> create(ScrollingStateTree&, ScrollingNodeID);
- virtual PassRefPtr<ScrollingStateNode> clone(ScrollingStateTree&) override;
+ virtual Ref<ScrollingStateNode> clone(ScrollingStateTree&) override;
virtual ~ScrollingStateOverflowScrollingNode();
namespace WebCore {
-PassRefPtr<ScrollingStateStickyNode> ScrollingStateStickyNode::create(ScrollingStateTree& stateTree, ScrollingNodeID nodeID)
+Ref<ScrollingStateStickyNode> ScrollingStateStickyNode::create(ScrollingStateTree& stateTree, ScrollingNodeID nodeID)
{
- return adoptRef(new ScrollingStateStickyNode(stateTree, nodeID));
+ return adoptRef(*new ScrollingStateStickyNode(stateTree, nodeID));
}
ScrollingStateStickyNode::ScrollingStateStickyNode(ScrollingStateTree& tree, ScrollingNodeID nodeID)
{
}
-PassRefPtr<ScrollingStateNode> ScrollingStateStickyNode::clone(ScrollingStateTree& adoptiveTree)
+Ref<ScrollingStateNode> ScrollingStateStickyNode::clone(ScrollingStateTree& adoptiveTree)
{
- return adoptRef(new ScrollingStateStickyNode(*this, adoptiveTree));
+ return adoptRef(*new ScrollingStateStickyNode(*this, adoptiveTree));
}
void ScrollingStateStickyNode::updateConstraints(const StickyPositionViewportConstraints& constraints)
class ScrollingStateStickyNode final : public ScrollingStateNode {
public:
- static PassRefPtr<ScrollingStateStickyNode> create(ScrollingStateTree&, ScrollingNodeID);
+ static Ref<ScrollingStateStickyNode> create(ScrollingStateTree&, ScrollingNodeID);
- virtual PassRefPtr<ScrollingStateNode> clone(ScrollingStateTree&) override;
+ virtual Ref<ScrollingStateNode> clone(ScrollingStateTree&) override;
virtual ~ScrollingStateStickyNode();
namespace WebCore {
-PassRefPtr<ScrollingCoordinator> ScrollingCoordinator::create(Page* page)
+Ref<ScrollingCoordinator> ScrollingCoordinator::create(Page* page)
{
- return adoptRef(new ScrollingCoordinatorIOS(page));
+ return adoptRef(*new ScrollingCoordinatorIOS(page));
}
ScrollingCoordinatorIOS::ScrollingCoordinatorIOS(Page* page)
class ScrollingTreeFrameScrollingNodeIOS : public ScrollingTreeFrameScrollingNode {
public:
- WEBCORE_EXPORT static PassRefPtr<ScrollingTreeFrameScrollingNodeIOS> create(ScrollingTree&, ScrollingNodeID);
+ WEBCORE_EXPORT static Ref<ScrollingTreeFrameScrollingNodeIOS> create(ScrollingTree&, ScrollingNodeID);
virtual ~ScrollingTreeFrameScrollingNodeIOS();
protected:
namespace WebCore {
-PassRefPtr<ScrollingTreeFrameScrollingNodeIOS> ScrollingTreeFrameScrollingNodeIOS::create(ScrollingTree& scrollingTree, ScrollingNodeID nodeID)
+Ref<ScrollingTreeFrameScrollingNodeIOS> ScrollingTreeFrameScrollingNodeIOS::create(ScrollingTree& scrollingTree, ScrollingNodeID nodeID)
{
- return adoptRef(new ScrollingTreeFrameScrollingNodeIOS(scrollingTree, nodeID));
+ return adoptRef(*new ScrollingTreeFrameScrollingNodeIOS(scrollingTree, nodeID));
}
ScrollingTreeFrameScrollingNodeIOS::ScrollingTreeFrameScrollingNodeIOS(ScrollingTree& scrollingTree, ScrollingNodeID nodeID)
namespace WebCore {
-RefPtr<ScrollingTreeIOS> ScrollingTreeIOS::create(AsyncScrollingCoordinator* scrollingCoordinator)
+Ref<ScrollingTreeIOS> ScrollingTreeIOS::create(AsyncScrollingCoordinator* scrollingCoordinator)
{
- return adoptRef(new ScrollingTreeIOS(scrollingCoordinator));
+ return adoptRef(*new ScrollingTreeIOS(scrollingCoordinator));
}
ScrollingTreeIOS::ScrollingTreeIOS(AsyncScrollingCoordinator* scrollingCoordinator)
class ScrollingTreeIOS : public ScrollingTree {
public:
- static RefPtr<ScrollingTreeIOS> create(AsyncScrollingCoordinator*);
+ static Ref<ScrollingTreeIOS> create(AsyncScrollingCoordinator*);
virtual ~ScrollingTreeIOS();
virtual void commitNewTreeState(std::unique_ptr<ScrollingStateTree>) override;
namespace WebCore {
-PassRefPtr<ScrollingCoordinator> ScrollingCoordinator::create(Page* page)
+Ref<ScrollingCoordinator> ScrollingCoordinator::create(Page* page)
{
- return adoptRef(new ScrollingCoordinatorMac(page));
+ return adoptRef(*new ScrollingCoordinatorMac(page));
}
ScrollingCoordinatorMac::ScrollingCoordinatorMac(Page* page)
class ScrollingTreeFixedNode : public ScrollingTreeNode {
public:
- WEBCORE_EXPORT static PassRefPtr<ScrollingTreeFixedNode> create(ScrollingTree&, ScrollingNodeID);
+ WEBCORE_EXPORT static Ref<ScrollingTreeFixedNode> create(ScrollingTree&, ScrollingNodeID);
virtual ~ScrollingTreeFixedNode();
namespace WebCore {
-PassRefPtr<ScrollingTreeFixedNode> ScrollingTreeFixedNode::create(ScrollingTree& scrollingTree, ScrollingNodeID nodeID)
+Ref<ScrollingTreeFixedNode> ScrollingTreeFixedNode::create(ScrollingTree& scrollingTree, ScrollingNodeID nodeID)
{
- return adoptRef(new ScrollingTreeFixedNode(scrollingTree, nodeID));
+ return adoptRef(*new ScrollingTreeFixedNode(scrollingTree, nodeID));
}
ScrollingTreeFixedNode::ScrollingTreeFixedNode(ScrollingTree& scrollingTree, ScrollingNodeID nodeID)
class ScrollingTreeFrameScrollingNodeMac : public ScrollingTreeFrameScrollingNode, private ScrollControllerClient {
public:
- WEBCORE_EXPORT static PassRefPtr<ScrollingTreeFrameScrollingNode> create(ScrollingTree&, ScrollingNodeID);
+ WEBCORE_EXPORT static Ref<ScrollingTreeFrameScrollingNode> create(ScrollingTree&, ScrollingNodeID);
virtual ~ScrollingTreeFrameScrollingNodeMac();
private:
static void logThreadedScrollingMode(unsigned synchronousScrollingReasons);
-PassRefPtr<ScrollingTreeFrameScrollingNode> ScrollingTreeFrameScrollingNodeMac::create(ScrollingTree& scrollingTree, ScrollingNodeID nodeID)
+Ref<ScrollingTreeFrameScrollingNode> ScrollingTreeFrameScrollingNodeMac::create(ScrollingTree& scrollingTree, ScrollingNodeID nodeID)
{
- return adoptRef(new ScrollingTreeFrameScrollingNodeMac(scrollingTree, nodeID));
+ return adoptRef(*new ScrollingTreeFrameScrollingNodeMac(scrollingTree, nodeID));
}
ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac(ScrollingTree& scrollingTree, ScrollingNodeID nodeID)
using namespace WebCore;
-RefPtr<ScrollingTreeMac> ScrollingTreeMac::create(AsyncScrollingCoordinator* scrollingCoordinator)
+Ref<ScrollingTreeMac> ScrollingTreeMac::create(AsyncScrollingCoordinator* scrollingCoordinator)
{
- return adoptRef(new ScrollingTreeMac(scrollingCoordinator));
+ return adoptRef(*new ScrollingTreeMac(scrollingCoordinator));
}
ScrollingTreeMac::ScrollingTreeMac(AsyncScrollingCoordinator* scrollingCoordinator)
class ScrollingTreeMac : public ThreadedScrollingTree {
public:
- static RefPtr<ScrollingTreeMac> create(AsyncScrollingCoordinator*);
+ static Ref<ScrollingTreeMac> create(AsyncScrollingCoordinator*);
virtual PassRefPtr<ScrollingTreeNode> createScrollingTreeNode(ScrollingNodeType, ScrollingNodeID) override;
class ScrollingTreeStickyNode : public ScrollingTreeNode {
public:
- WEBCORE_EXPORT static PassRefPtr<ScrollingTreeStickyNode> create(ScrollingTree&, ScrollingNodeID);
+ WEBCORE_EXPORT static Ref<ScrollingTreeStickyNode> create(ScrollingTree&, ScrollingNodeID);
virtual ~ScrollingTreeStickyNode();
namespace WebCore {
-PassRefPtr<ScrollingTreeStickyNode> ScrollingTreeStickyNode::create(ScrollingTree& scrollingTree, ScrollingNodeID nodeID)
+Ref<ScrollingTreeStickyNode> ScrollingTreeStickyNode::create(ScrollingTree& scrollingTree, ScrollingNodeID nodeID)
{
- return adoptRef(new ScrollingTreeStickyNode(scrollingTree, nodeID));
+ return adoptRef(*new ScrollingTreeStickyNode(scrollingTree, nodeID));
}
ScrollingTreeStickyNode::ScrollingTreeStickyNode(ScrollingTree& scrollingTree, ScrollingNodeID nodeID)
WebViewGroup::WebViewGroup(const String& name, const String& localStorageDatabasePath)
: m_name(name)
, m_localStorageDatabasePath(localStorageDatabasePath)
- , m_userContentController(*UserContentController::create())
+ , m_userContentController(UserContentController::create())
, m_visitedLinkStore(WebVisitedLinkStore::create())
{
}
+2015-05-10 Gyuyoung Kim <gyuyoung.kim@webkit.org>
+
+ Use Ref instead of PassRefPtr in WebCore/page
+ https://bugs.webkit.org/show_bug.cgi?id=144841
+
+ Reviewed by Darin Adler.
+
+ To kill PassRefPtr, this patch replaces PassRefPtr with Ref or RefPtr
+ in WebCore/page.
+
+ (WebKit::WebUserContentController::WebUserContentController):
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::setTextIndicator):
+ * UIProcess/mac/PageClientImpl.mm:
+ (WebKit::PageClientImpl::didPerformDictionaryLookup):
+ * WebProcess/UserContent/WebUserContentController.cpp:
+ (WebKit::WebUserContentController::WebUserContentController):
+
2015-05-10 Philip Chimento <philip.chimento@gmail.com>
[GTK][SOUP] Web and Network processes don't know how to get memory size on OSX
void WebPageProxy::setTextIndicator(const TextIndicatorData& indicatorData, uint64_t lifetime)
{
- m_pageClient.setTextIndicator(*TextIndicator::create(indicatorData), static_cast<TextIndicatorLifetime>(lifetime));
+ m_pageClient.setTextIndicator(TextIndicator::create(indicatorData), static_cast<TextIndicatorLifetime>(lifetime));
}
void WebPageProxy::clearTextIndicator()
[m_wkView _prepareForDictionaryLookup];
if (canLoadLUTermOptionDisableSearchTermIndicator() && dictionaryPopupInfo.textIndicator.contentImage) {
- [m_wkView _setTextIndicator:*TextIndicator::create(dictionaryPopupInfo.textIndicator) withLifetime:TextIndicatorLifetime::Permanent];
+ [m_wkView _setTextIndicator:TextIndicator::create(dictionaryPopupInfo.textIndicator) withLifetime:TextIndicatorLifetime::Permanent];
[mutableOptions setObject:@YES forKey:getLUTermOptionDisableSearchTermIndicator()];
[getLULookupDefinitionModuleClass() showDefinitionForTerm:dictionaryPopupInfo.attributedString.string.get() atLocation:textBaselineOrigin options:mutableOptions.get()];
} else
WebUserContentController::WebUserContentController(uint64_t identifier)
: m_identifier(identifier)
- , m_userContentController(*UserContentController::create())
+ , m_userContentController(UserContentController::create())
{
WebProcess::singleton().addMessageReceiver(Messages::WebUserContentController::messageReceiverName(), m_identifier, *this);
}