Purge PassRefPtr in WebCore/Modules
authorgyuyoung.kim@webkit.org <gyuyoung.kim@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 May 2015 07:26:55 +0000 (07:26 +0000)
committergyuyoung.kim@webkit.org <gyuyoung.kim@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 May 2015 07:26:55 +0000 (07:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=145112

Reviewed by Darin Adler.

As a step to remove PassRefPtr, this patch replaces PassRefPtr with Ref or RefPtr
depends on null of return value.

No new tests, no behavior changes.

* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::create):
* Modules/encryptedmedia/MediaKeySession.h:
* Modules/encryptedmedia/MediaKeys.cpp:
(WebCore::MediaKeys::create):
(WebCore::MediaKeys::createSession):
* Modules/encryptedmedia/MediaKeys.h:
* Modules/gamepad/Gamepad.h:
* Modules/gamepad/NavigatorGamepad.cpp:
(WebCore::NavigatorGamepad::gamepadFromPlatformGamepad):
* Modules/gamepad/deprecated/Gamepad.h:
* Modules/geolocation/GeolocationError.h:
(WebCore::GeolocationError::create):
* Modules/geolocation/GeolocationPosition.h:
(WebCore::GeolocationPosition::create):
* Modules/geolocation/Geoposition.h:
(WebCore::Geoposition::create):
* Modules/geolocation/PositionError.h:
(WebCore::PositionError::create):
* Modules/geolocation/PositionOptions.h:
(WebCore::PositionOptions::create):
* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::create):
* Modules/mediacontrols/MediaControlsHost.h:
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::create):
* Modules/mediasource/MediaSource.h:
* Modules/mediastream/RTCDataChannel.cpp:
(WebCore::RTCDataChannel::create):
* Modules/mediastream/RTCDataChannel.h:
* Modules/mediastream/RTCIceCandidate.cpp:
(WebCore::RTCIceCandidate::create):
* Modules/mediastream/RTCIceCandidate.h:
* Modules/webaudio/OfflineAudioContext.cpp:
(WebCore::OfflineAudioContext::create):
* Modules/webaudio/OfflineAudioContext.h:
* Modules/webaudio/OfflineAudioDestinationNode.h:
(WebCore::OfflineAudioDestinationNode::create):
* Modules/webaudio/OscillatorNode.cpp:
(WebCore::OscillatorNode::create):
* Modules/webaudio/OscillatorNode.h:
* Modules/webdatabase/Database.cpp:
(WebCore::Database::runTransaction):
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::originLockFor):
* Modules/webdatabase/DatabaseTracker.h:
* Modules/webdatabase/SQLError.h:
(WebCore::SQLError::create):
* Modules/webdatabase/SQLResultSet.h:
(WebCore::SQLResultSet::create):
* Modules/webdatabase/SQLResultSetRowList.h:
(WebCore::SQLResultSetRowList::create):
* Modules/webdatabase/SQLStatementBackend.cpp:
(WebCore::SQLStatementBackend::create):
* Modules/webdatabase/SQLStatementBackend.h:
* Modules/webdatabase/SQLTransactionBackend.cpp:
(WebCore::SQLTransactionBackend::create):
* Modules/webdatabase/SQLTransactionBackend.h:
* Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
(WebCore::ThreadableWebSocketChannelClientWrapper::create):
* Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::create):
* Modules/websockets/WebSocket.h:
* Modules/websockets/WebSocketChannel.h:
(WebCore::WebSocketChannel::create):
* Modules/websockets/WorkerThreadableWebSocketChannel.h:
(WebCore::WorkerThreadableWebSocketChannel::create):
(WebCore::WorkerThreadableWebSocketChannel::Bridge::create):
* editing/InsertListCommand.h:
(WebCore::InsertListCommand::create):
* workers/Worker.cpp:
(WebCore::Worker::create):
* workers/Worker.h:
* xml/XPathExpression.cpp:
(WebCore::XPathExpression::createExpression):
(WebCore::XPathExpression::evaluate):
* xml/XPathExpression.h:

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

47 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp
Source/WebCore/Modules/encryptedmedia/MediaKeySession.h
Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp
Source/WebCore/Modules/encryptedmedia/MediaKeys.h
Source/WebCore/Modules/gamepad/Gamepad.h
Source/WebCore/Modules/gamepad/NavigatorGamepad.cpp
Source/WebCore/Modules/gamepad/deprecated/Gamepad.h
Source/WebCore/Modules/geolocation/GeolocationError.h
Source/WebCore/Modules/geolocation/GeolocationPosition.h
Source/WebCore/Modules/geolocation/Geoposition.h
Source/WebCore/Modules/geolocation/PositionError.h
Source/WebCore/Modules/geolocation/PositionOptions.h
Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp
Source/WebCore/Modules/mediacontrols/MediaControlsHost.h
Source/WebCore/Modules/mediasource/MediaSource.cpp
Source/WebCore/Modules/mediasource/MediaSource.h
Source/WebCore/Modules/mediastream/RTCDataChannel.cpp
Source/WebCore/Modules/mediastream/RTCDataChannel.h
Source/WebCore/Modules/mediastream/RTCIceCandidate.cpp
Source/WebCore/Modules/mediastream/RTCIceCandidate.h
Source/WebCore/Modules/webaudio/OfflineAudioContext.cpp
Source/WebCore/Modules/webaudio/OfflineAudioContext.h
Source/WebCore/Modules/webaudio/OfflineAudioDestinationNode.h
Source/WebCore/Modules/webaudio/OscillatorNode.cpp
Source/WebCore/Modules/webaudio/OscillatorNode.h
Source/WebCore/Modules/webdatabase/Database.cpp
Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp
Source/WebCore/Modules/webdatabase/DatabaseTracker.h
Source/WebCore/Modules/webdatabase/SQLError.h
Source/WebCore/Modules/webdatabase/SQLResultSet.h
Source/WebCore/Modules/webdatabase/SQLResultSetRowList.h
Source/WebCore/Modules/webdatabase/SQLStatementBackend.cpp
Source/WebCore/Modules/webdatabase/SQLStatementBackend.h
Source/WebCore/Modules/webdatabase/SQLTransactionBackend.cpp
Source/WebCore/Modules/webdatabase/SQLTransactionBackend.h
Source/WebCore/Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp
Source/WebCore/Modules/websockets/ThreadableWebSocketChannelClientWrapper.h
Source/WebCore/Modules/websockets/WebSocket.cpp
Source/WebCore/Modules/websockets/WebSocket.h
Source/WebCore/Modules/websockets/WebSocketChannel.h
Source/WebCore/Modules/websockets/WorkerThreadableWebSocketChannel.h
Source/WebCore/editing/InsertListCommand.h
Source/WebCore/workers/Worker.cpp
Source/WebCore/workers/Worker.h
Source/WebCore/xml/XPathExpression.cpp
Source/WebCore/xml/XPathExpression.h

index 3f5d943..a892001 100644 (file)
@@ -1,3 +1,94 @@
+2015-05-21  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
+
+        Purge PassRefPtr in WebCore/Modules
+        https://bugs.webkit.org/show_bug.cgi?id=145112
+
+        Reviewed by Darin Adler.
+
+        As a step to remove PassRefPtr, this patch replaces PassRefPtr with Ref or RefPtr
+        depends on null of return value.
+
+        No new tests, no behavior changes.
+
+        * Modules/encryptedmedia/MediaKeySession.cpp:
+        (WebCore::MediaKeySession::create):
+        * Modules/encryptedmedia/MediaKeySession.h:
+        * Modules/encryptedmedia/MediaKeys.cpp:
+        (WebCore::MediaKeys::create):
+        (WebCore::MediaKeys::createSession):
+        * Modules/encryptedmedia/MediaKeys.h:
+        * Modules/gamepad/Gamepad.h:
+        * Modules/gamepad/NavigatorGamepad.cpp:
+        (WebCore::NavigatorGamepad::gamepadFromPlatformGamepad):
+        * Modules/gamepad/deprecated/Gamepad.h:
+        * Modules/geolocation/GeolocationError.h:
+        (WebCore::GeolocationError::create):
+        * Modules/geolocation/GeolocationPosition.h:
+        (WebCore::GeolocationPosition::create):
+        * Modules/geolocation/Geoposition.h:
+        (WebCore::Geoposition::create):
+        * Modules/geolocation/PositionError.h:
+        (WebCore::PositionError::create):
+        * Modules/geolocation/PositionOptions.h:
+        (WebCore::PositionOptions::create):
+        * Modules/mediacontrols/MediaControlsHost.cpp:
+        (WebCore::MediaControlsHost::create):
+        * Modules/mediacontrols/MediaControlsHost.h:
+        * Modules/mediasource/MediaSource.cpp:
+        (WebCore::MediaSource::create):
+        * Modules/mediasource/MediaSource.h:
+        * Modules/mediastream/RTCDataChannel.cpp:
+        (WebCore::RTCDataChannel::create):
+        * Modules/mediastream/RTCDataChannel.h:
+        * Modules/mediastream/RTCIceCandidate.cpp:
+        (WebCore::RTCIceCandidate::create):
+        * Modules/mediastream/RTCIceCandidate.h:
+        * Modules/webaudio/OfflineAudioContext.cpp:
+        (WebCore::OfflineAudioContext::create):
+        * Modules/webaudio/OfflineAudioContext.h:
+        * Modules/webaudio/OfflineAudioDestinationNode.h:
+        (WebCore::OfflineAudioDestinationNode::create):
+        * Modules/webaudio/OscillatorNode.cpp:
+        (WebCore::OscillatorNode::create):
+        * Modules/webaudio/OscillatorNode.h:
+        * Modules/webdatabase/Database.cpp:
+        (WebCore::Database::runTransaction):
+        * Modules/webdatabase/DatabaseTracker.cpp:
+        (WebCore::DatabaseTracker::originLockFor):
+        * Modules/webdatabase/DatabaseTracker.h:
+        * Modules/webdatabase/SQLError.h:
+        (WebCore::SQLError::create):
+        * Modules/webdatabase/SQLResultSet.h:
+        (WebCore::SQLResultSet::create):
+        * Modules/webdatabase/SQLResultSetRowList.h:
+        (WebCore::SQLResultSetRowList::create):
+        * Modules/webdatabase/SQLStatementBackend.cpp:
+        (WebCore::SQLStatementBackend::create):
+        * Modules/webdatabase/SQLStatementBackend.h:
+        * Modules/webdatabase/SQLTransactionBackend.cpp:
+        (WebCore::SQLTransactionBackend::create):
+        * Modules/webdatabase/SQLTransactionBackend.h:
+        * Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
+        (WebCore::ThreadableWebSocketChannelClientWrapper::create):
+        * Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
+        * Modules/websockets/WebSocket.cpp:
+        (WebCore::WebSocket::create):
+        * Modules/websockets/WebSocket.h:
+        * Modules/websockets/WebSocketChannel.h:
+        (WebCore::WebSocketChannel::create):
+        * Modules/websockets/WorkerThreadableWebSocketChannel.h:
+        (WebCore::WorkerThreadableWebSocketChannel::create):
+        (WebCore::WorkerThreadableWebSocketChannel::Bridge::create):
+        * editing/InsertListCommand.h:
+        (WebCore::InsertListCommand::create):
+        * workers/Worker.cpp:
+        (WebCore::Worker::create):
+        * workers/Worker.h:
+        * xml/XPathExpression.cpp:
+        (WebCore::XPathExpression::createExpression):
+        (WebCore::XPathExpression::evaluate):
+        * xml/XPathExpression.h:
+
 2015-05-20  Commit Queue  <commit-queue@webkit.org>
 
         Unreviewed, rolling out r184667 and r184682.
index deb1c03..1e4286c 100644 (file)
@@ -40,9 +40,9 @@
 
 namespace WebCore {
 
-PassRefPtr<MediaKeySession> MediaKeySession::create(ScriptExecutionContext* context, MediaKeys* keys, const String& keySystem)
+Ref<MediaKeySession> MediaKeySession::create(ScriptExecutionContext* context, MediaKeys* keys, const String& keySystem)
 {
-    auto session = adoptRef(new MediaKeySession(context, keys, keySystem));
+    auto session = adoptRef(*new MediaKeySession(context, keys, keySystem));
     session->suspendIfNeeded();
     return session;
 }
index 34e8e63..98246c2 100644 (file)
@@ -47,7 +47,7 @@ class MediaKeys;
 
 class MediaKeySession final : public RefCounted<MediaKeySession>, public EventTargetWithInlineData, public ActiveDOMObject, public CDMSessionClient {
 public:
-    static PassRefPtr<MediaKeySession> create(ScriptExecutionContext*, MediaKeys*, const String& keySystem);
+    static Ref<MediaKeySession> create(ScriptExecutionContext*, MediaKeys*, const String& keySystem);
     ~MediaKeySession();
 
     const String& keySystem() const { return m_keySystem; }
index 02e8429..ca3db0b 100644 (file)
@@ -38,7 +38,7 @@
 
 namespace WebCore {
 
-PassRefPtr<MediaKeys> MediaKeys::create(const String& keySystem, ExceptionCode& ec)
+RefPtr<MediaKeys> MediaKeys::create(const String& keySystem, ExceptionCode& ec)
 {
     // From <http://dvcs.w3.org/hg/html-media/raw-file/tip/encrypted-media/encrypted-media.html#dom-media-keys-constructor>:
     // The MediaKeys(keySystem) constructor must run the following steps:
@@ -46,13 +46,13 @@ PassRefPtr<MediaKeys> MediaKeys::create(const String& keySystem, ExceptionCode&
     // 1. If keySystem is null or an empty string, throw an INVALID_ACCESS_ERR exception and abort these steps.
     if (keySystem.isNull() || keySystem.isEmpty()) {
         ec = INVALID_ACCESS_ERR;
-        return 0;
+        return nullptr;
     }
 
     // 2. If keySystem is not one of the user agent's supported Key Systems, throw a NOT_SUPPORTED_ERR and abort these steps.
     if (!CDM::supportsKeySystem(keySystem)) {
         ec = NOT_SUPPORTED_ERR;
-        return 0;
+        return nullptr;
     }
 
     // 3. Let cdm be the content decryption module corresponding to keySystem.
@@ -62,7 +62,7 @@ PassRefPtr<MediaKeys> MediaKeys::create(const String& keySystem, ExceptionCode&
     // 5. Create a new MediaKeys object.
     // 5.1 Let the keySystem attribute be keySystem.
     // 6. Return the new object to the caller.
-    return adoptRef(new MediaKeys(keySystem, WTF::move(cdm)));
+    return adoptRef(*new MediaKeys(keySystem, WTF::move(cdm)));
 }
 
 MediaKeys::MediaKeys(const String& keySystem, std::unique_ptr<CDM> cdm)
@@ -83,7 +83,7 @@ MediaKeys::~MediaKeys()
     }
 }
 
-PassRefPtr<MediaKeySession> MediaKeys::createSession(ScriptExecutionContext* context, const String& type, Uint8Array* initData, ExceptionCode& ec)
+RefPtr<MediaKeySession> MediaKeys::createSession(ScriptExecutionContext* context, const String& type, Uint8Array* initData, ExceptionCode& ec)
 {
     // From <http://www.w3.org/TR/2014/WD-encrypted-media-20140218/#dom-createsession>:
     // The createSession(type, initData) method must run the following steps:
@@ -92,20 +92,20 @@ PassRefPtr<MediaKeySession> MediaKeys::createSession(ScriptExecutionContext* con
     // 1. If contentType is null or an empty string, throw an INVALID_ACCESS_ERR exception and abort these steps.
     if (type.isEmpty()) {
         ec = INVALID_ACCESS_ERR;
-        return 0;
+        return nullptr;
     }
 
     // 2. If initData is null or an empty array, throw an INVALID_ACCESS_ERR exception and abort these steps.
     if (!initData || !initData->length()) {
         ec = INVALID_ACCESS_ERR;
-        return 0;
+        return nullptr;
     }
 
     // 3. If type contains a MIME type that is not supported or is not supported by the keySystem, throw
     // a NOT_SUPPORTED_ERR exception and abort these steps.
     if (!type.isNull() && !type.isEmpty() && !m_cdm->supportsMIMEType(type)) {
         ec = NOT_SUPPORTED_ERR;
-        return 0;
+        return nullptr;
     }
 
     // 4. Create a new MediaKeySession object.
@@ -119,7 +119,7 @@ PassRefPtr<MediaKeySession> MediaKeys::createSession(ScriptExecutionContext* con
     session->generateKeyRequest(type, initData);
 
     // 6. Return the new object to the caller.
-    return session;
+    return WTF::move(session);
 }
 
 bool MediaKeys::isTypeSupported(const String& keySystem, const String& mimeType)
index f8d6d2e..34fca8f 100644 (file)
@@ -44,10 +44,10 @@ class HTMLMediaElement;
 
 class MediaKeys : public RefCounted<MediaKeys>, public CDMClient {
 public:
-    static PassRefPtr<MediaKeys> create(const String& keySystem, ExceptionCode&);
+    static RefPtr<MediaKeys> create(const String& keySystem, ExceptionCode&);
     virtual ~MediaKeys();
 
-    PassRefPtr<MediaKeySession> createSession(ScriptExecutionContext*, const String& mimeType, Uint8Array* initData, ExceptionCode&);
+    RefPtr<MediaKeySession> createSession(ScriptExecutionContext*, const String& mimeType, Uint8Array* initData, ExceptionCode&);
 
     static bool isTypeSupported(const String& keySystem, const String& mimeType);
 
index 9dc1fdc..6461aba 100644 (file)
@@ -39,9 +39,9 @@ class PlatformGamepad;
 
 class Gamepad: public RefCounted<Gamepad> {
 public:
-    static PassRefPtr<Gamepad> create(const PlatformGamepad& platformGamepad)
+    static Ref<Gamepad> create(const PlatformGamepad& platformGamepad)
     {
-        return adoptRef(new Gamepad(platformGamepad));
+        return adoptRef(*new Gamepad(platformGamepad));
     }
     ~Gamepad();
 
index 18f1b4e..94f445e 100644 (file)
@@ -76,7 +76,7 @@ Ref<Gamepad> NavigatorGamepad::gamepadFromPlatformGamepad(PlatformGamepad& platf
 {
     unsigned index = platformGamepad.index();
     if (index >= m_gamepads.size() || !m_gamepads[index])
-        return adoptRef(*Gamepad::create(platformGamepad).leakRef());
+        return Gamepad::create(platformGamepad);
 
     return *m_gamepads[index];
 }
index 0701184..6026a06 100644 (file)
@@ -36,9 +36,9 @@ namespace WebCore {
 
 class Gamepad: public RefCounted<Gamepad> {
 public:
-    static PassRefPtr<Gamepad> create()
+    static Ref<Gamepad> create()
     {
-        return adoptRef(new Gamepad);
+        return adoptRef(*new Gamepad);
     }
     ~Gamepad();
 
index bfb61aa..0554e87 100644 (file)
@@ -40,7 +40,7 @@ public:
         PositionUnavailable
     };
 
-    static PassRefPtr<GeolocationError> create(ErrorCode code, const String& message) { return adoptRef(new GeolocationError(code, message)); }
+    static Ref<GeolocationError> create(ErrorCode code, const String& message) { return adoptRef(*new GeolocationError(code, message)); }
 
     ErrorCode code() const { return m_code; }
     const String& message() const { return m_message; }
index 7b15648..8d1e930 100644 (file)
@@ -34,9 +34,15 @@ namespace WebCore {
 
 class GeolocationPosition : public RefCounted<GeolocationPosition> {
 public:
-    static PassRefPtr<GeolocationPosition> create(double timestamp, double latitude, double longitude, double accuracy) { return adoptRef(new GeolocationPosition(timestamp, latitude, longitude, accuracy)); }
+    static Ref<GeolocationPosition> create(double timestamp, double latitude, double longitude, double accuracy)
+    {
+        return adoptRef(*new GeolocationPosition(timestamp, latitude, longitude, accuracy));
+    }
 
-    static PassRefPtr<GeolocationPosition> create(double timestamp, double latitude, double longitude, double accuracy, bool providesAltitude, double altitude, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed) { return adoptRef(new GeolocationPosition(timestamp, latitude, longitude, accuracy, providesAltitude, altitude, providesAltitudeAccuracy, altitudeAccuracy, providesHeading, heading, providesSpeed, speed)); }
+    static Ref<GeolocationPosition> create(double timestamp, double latitude, double longitude, double accuracy, bool providesAltitude, double altitude, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed)
+    {
+        return adoptRef(*new GeolocationPosition(timestamp, latitude, longitude, accuracy, providesAltitude, altitude, providesAltitudeAccuracy, altitudeAccuracy, providesHeading, heading, providesSpeed, speed));
+    }
 
     double timestamp() const { return m_timestamp; }
 
index 27064dd..78dc36a 100644 (file)
@@ -35,9 +35,9 @@ namespace WebCore {
 
 class Geoposition : public RefCounted<Geoposition> {
 public:
-    static PassRefPtr<Geoposition> create(PassRefPtr<Coordinates> coordinates, DOMTimeStamp timestamp)
+    static Ref<Geoposition> create(PassRefPtr<Coordinates> coordinates, DOMTimeStamp timestamp)
     {
-        return adoptRef(new Geoposition(coordinates, timestamp));
+        return adoptRef(*new Geoposition(coordinates, timestamp));
     }
 
     PassRefPtr<Geoposition> isolatedCopy() const
index aa51c6a..138df96 100644 (file)
@@ -40,7 +40,7 @@ public:
         TIMEOUT = 3
     };
     
-    static PassRefPtr<PositionError> create(ErrorCode code, const String& message) { return adoptRef(new PositionError(code, message)); }
+    static Ref<PositionError> create(ErrorCode code, const String& message) { return adoptRef(*new PositionError(code, message)); }
 
     ErrorCode code() const { return m_code; }
     const String& message() const { return m_message; }
index 5cb66f7..e455921 100644 (file)
@@ -33,7 +33,7 @@ namespace WebCore {
     
 class PositionOptions : public RefCounted<PositionOptions> {
 public:
-    static PassRefPtr<PositionOptions> create() { return adoptRef(new PositionOptions()); }
+    static Ref<PositionOptions> create() { return adoptRef(*new PositionOptions()); }
 
     bool enableHighAccuracy() const { return m_highAccuracy; }
     void setEnableHighAccuracy(bool enable) { m_highAccuracy = enable; }
index 4464171..4fac252 100644 (file)
@@ -61,9 +61,9 @@ const AtomicString& MediaControlsHost::alwaysOnKeyword()
     return alwaysOn;
 }
 
-PassRefPtr<MediaControlsHost> MediaControlsHost::create(HTMLMediaElement* mediaElement)
+Ref<MediaControlsHost> MediaControlsHost::create(HTMLMediaElement* mediaElement)
 {
-    return adoptRef(new MediaControlsHost(mediaElement));
+    return adoptRef(*new MediaControlsHost(mediaElement));
 }
 
 MediaControlsHost::MediaControlsHost(HTMLMediaElement* mediaElement)
index c64e47c..d81eef6 100644 (file)
@@ -46,7 +46,7 @@ class TextTrackList;
 
 class MediaControlsHost : public RefCounted<MediaControlsHost> {
 public:
-    static PassRefPtr<MediaControlsHost> create(HTMLMediaElement*);
+    static Ref<MediaControlsHost> create(HTMLMediaElement*);
     ~MediaControlsHost();
 
     static const AtomicString& automaticKeyword();
index f0a1cbb..8946036 100644 (file)
@@ -67,11 +67,11 @@ void MediaSource::setRegistry(URLRegistry* registry)
     s_registry = registry;
 }
 
-PassRefPtr<MediaSource> MediaSource::create(ScriptExecutionContext& context)
+Ref<MediaSource> MediaSource::create(ScriptExecutionContext& context)
 {
-    RefPtr<MediaSource> mediaSource(adoptRef(new MediaSource(context)));
+    Ref<MediaSource> mediaSource(adoptRef(*new MediaSource(context)));
     mediaSource->suspendIfNeeded();
-    return mediaSource.release();
+    return mediaSource;
 }
 
 MediaSource::MediaSource(ScriptExecutionContext& context)
index 7fe2323..0599ef0 100644 (file)
@@ -58,7 +58,7 @@ public:
     static const AtomicString& closedKeyword();
     static const AtomicString& endedKeyword();
 
-    static PassRefPtr<MediaSource> create(ScriptExecutionContext&);
+    static Ref<MediaSource> create(ScriptExecutionContext&);
     virtual ~MediaSource();
 
     void addedToRegistry();
index 81a6822..90d06c7 100644 (file)
@@ -54,7 +54,7 @@ static const AtomicString& arraybufferKeyword()
     return arraybuffer;
 }
 
-PassRefPtr<RTCDataChannel> RTCDataChannel::create(ScriptExecutionContext* context, RTCPeerConnectionHandler* peerConnectionHandler, const String& label, const Dictionary& options, ExceptionCode& ec)
+RefPtr<RTCDataChannel> RTCDataChannel::create(ScriptExecutionContext* context, RTCPeerConnectionHandler* peerConnectionHandler, const String& label, const Dictionary& options, ExceptionCode& ec)
 {
     RTCDataChannelInit initData;
     String maxRetransmitsStr;
@@ -80,13 +80,13 @@ PassRefPtr<RTCDataChannel> RTCDataChannel::create(ScriptExecutionContext* contex
         ec = NOT_SUPPORTED_ERR;
         return nullptr;
     }
-    return adoptRef(new RTCDataChannel(context, WTF::move(handler)));
+    return adoptRef(*new RTCDataChannel(context, WTF::move(handler)));
 }
 
-PassRefPtr<RTCDataChannel> RTCDataChannel::create(ScriptExecutionContext* context, std::unique_ptr<RTCDataChannelHandler> handler)
+Ref<RTCDataChannel> RTCDataChannel::create(ScriptExecutionContext* context, std::unique_ptr<RTCDataChannelHandler> handler)
 {
     ASSERT(handler);
-    return adoptRef(new RTCDataChannel(context, WTF::move(handler)));
+    return adoptRef(*new RTCDataChannel(context, WTF::move(handler)));
 }
 
 RTCDataChannel::RTCDataChannel(ScriptExecutionContext* context, std::unique_ptr<RTCDataChannelHandler> handler)
index 5372e78..88e74ae 100644 (file)
@@ -47,8 +47,8 @@ class RTCPeerConnectionHandler;
 
 class RTCDataChannel final : public RefCounted<RTCDataChannel>, public ScriptWrappable, public EventTargetWithInlineData, public RTCDataChannelHandlerClient {
 public:
-    static PassRefPtr<RTCDataChannel> create(ScriptExecutionContext*, std::unique_ptr<RTCDataChannelHandler>);
-    static PassRefPtr<RTCDataChannel> create(ScriptExecutionContext*, RTCPeerConnectionHandler*, const String& , const Dictionary&, ExceptionCode&);
+    static Ref<RTCDataChannel> create(ScriptExecutionContext*, std::unique_ptr<RTCDataChannelHandler>);
+    static RefPtr<RTCDataChannel> create(ScriptExecutionContext*, RTCPeerConnectionHandler*, const String& label, const Dictionary& options, ExceptionCode&);
     ~RTCDataChannel();
 
     String label() const;
index 353e309..b29189f 100644 (file)
@@ -41,7 +41,7 @@
 
 namespace WebCore {
 
-PassRefPtr<RTCIceCandidate> RTCIceCandidate::create(const Dictionary& dictionary, ExceptionCode& ec)
+RefPtr<RTCIceCandidate> RTCIceCandidate::create(const Dictionary& dictionary, ExceptionCode& ec)
 {
     String candidate;
     bool ok = dictionary.get("candidate", candidate);
@@ -71,12 +71,12 @@ PassRefPtr<RTCIceCandidate> RTCIceCandidate::create(const Dictionary& dictionary
         }
     }
 
-    return adoptRef(new RTCIceCandidate(RTCIceCandidateDescriptor::create(candidate, sdpMid, sdpMLineIndex)));
+    return adoptRef(*new RTCIceCandidate(RTCIceCandidateDescriptor::create(candidate, sdpMid, sdpMLineIndex)));
 }
 
-PassRefPtr<RTCIceCandidate> RTCIceCandidate::create(PassRefPtr<RTCIceCandidateDescriptor> descriptor)
+Ref<RTCIceCandidate> RTCIceCandidate::create(PassRefPtr<RTCIceCandidateDescriptor> descriptor)
 {
-    return adoptRef(new RTCIceCandidate(descriptor));
+    return adoptRef(*new RTCIceCandidate(descriptor));
 }
 
 RTCIceCandidate::RTCIceCandidate(PassRefPtr<RTCIceCandidateDescriptor> descriptor)
index 0dad25c..65fa3ba 100644 (file)
@@ -47,8 +47,8 @@ class RTCIceCandidateDescriptor;
 
 class RTCIceCandidate : public RefCounted<RTCIceCandidate>, public ScriptWrappable {
 public:
-    static PassRefPtr<RTCIceCandidate> create(const Dictionary&, ExceptionCode&);
-    static PassRefPtr<RTCIceCandidate> create(PassRefPtr<RTCIceCandidateDescriptor>);
+    static RefPtr<RTCIceCandidate> create(const Dictionary&, ExceptionCode&);
+    static Ref<RTCIceCandidate> create(PassRefPtr<RTCIceCandidateDescriptor>);
     virtual ~RTCIceCandidate();
 
     const String& candidate() const;
index e913cdc..e5ed948 100644 (file)
@@ -34,7 +34,7 @@
 
 namespace WebCore {
 
-PassRefPtr<OfflineAudioContext> OfflineAudioContext::create(ScriptExecutionContext& context, unsigned numberOfChannels, size_t numberOfFrames, float sampleRate, ExceptionCode& ec)
+RefPtr<OfflineAudioContext> OfflineAudioContext::create(ScriptExecutionContext& context, unsigned numberOfChannels, size_t numberOfFrames, float sampleRate, ExceptionCode& ec)
 {
     // FIXME: add support for workers.
     if (!is<Document>(context)) {
@@ -51,7 +51,7 @@ PassRefPtr<OfflineAudioContext> OfflineAudioContext::create(ScriptExecutionConte
 
     RefPtr<OfflineAudioContext> audioContext(adoptRef(new OfflineAudioContext(document, numberOfChannels, numberOfFrames, sampleRate)));
     audioContext->suspendIfNeeded();
-    return audioContext.release();
+    return WTF::move(audioContext);
 }
 
 OfflineAudioContext::OfflineAudioContext(Document& document, unsigned numberOfChannels, size_t numberOfFrames, float sampleRate)
index 35bbc96..8466b3a 100644 (file)
@@ -31,7 +31,7 @@ namespace WebCore {
 
 class OfflineAudioContext : public AudioContext {
 public:
-    static PassRefPtr<OfflineAudioContext> create(ScriptExecutionContext&, unsigned numberOfChannels, size_t numberOfFrames, float sampleRate, ExceptionCode&);
+    static RefPtr<OfflineAudioContext> create(ScriptExecutionContext&, unsigned numberOfChannels, size_t numberOfFrames, float sampleRate, ExceptionCode&);
 
     virtual ~OfflineAudioContext();
 
index eb0ca42..953ae90 100644 (file)
@@ -38,9 +38,9 @@ class AudioContext;
     
 class OfflineAudioDestinationNode : public AudioDestinationNode {
 public:
-    static PassRefPtr<OfflineAudioDestinationNode> create(AudioContext* context, AudioBuffer* renderTarget)
+    static Ref<OfflineAudioDestinationNode> create(AudioContext* context, AudioBuffer* renderTarget)
     {
-        return adoptRef(new OfflineAudioDestinationNode(context, renderTarget));     
+        return adoptRef(*new OfflineAudioDestinationNode(context, renderTarget));     
     }
 
     virtual ~OfflineAudioDestinationNode();
index 070dc9e..a4ef9ca 100644 (file)
@@ -46,9 +46,9 @@ PeriodicWave* OscillatorNode::s_periodicWaveSquare = 0;
 PeriodicWave* OscillatorNode::s_periodicWaveSawtooth = 0;
 PeriodicWave* OscillatorNode::s_periodicWaveTriangle = 0;
 
-PassRefPtr<OscillatorNode> OscillatorNode::create(AudioContext* context, float sampleRate)
+Ref<OscillatorNode> OscillatorNode::create(AudioContext* context, float sampleRate)
 {
-    return adoptRef(new OscillatorNode(context, sampleRate));
+    return adoptRef(*new OscillatorNode(context, sampleRate));
 }
 
 OscillatorNode::OscillatorNode(AudioContext* context, float sampleRate)
index 0596926..701db42 100644 (file)
@@ -51,7 +51,7 @@ public:
         CUSTOM = 4
     };
 
-    static PassRefPtr<OscillatorNode> create(AudioContext*, float sampleRate);
+    static Ref<OscillatorNode> create(AudioContext*, float sampleRate);
 
     virtual ~OscillatorNode();
     
index a265c74..5e0a616 100644 (file)
@@ -296,7 +296,7 @@ void Database::runTransaction(RefPtr<SQLTransactionCallback>&& callback, RefPtr<
     if (!transactionBackend && errorCallback) {
         WTF::RefPtr<SQLTransactionErrorCallback> errorCallbackProtector = WTF::move(errorCallback);
         m_scriptExecutionContext->postTask([errorCallbackProtector](ScriptExecutionContext&) {
-            errorCallbackProtector->handleEvent(SQLError::create(SQLError::UNKNOWN_ERR, "database has been closed").get());
+            errorCallbackProtector->handleEvent(SQLError::create(SQLError::UNKNOWN_ERR, "database has been closed").ptr());
         });
     }
 }
index 38b7e91..64c6014 100644 (file)
@@ -662,7 +662,7 @@ void DatabaseTracker::getOpenDatabases(SecurityOrigin* origin, const String& nam
         databases->add(*it);
 }
 
-PassRefPtr<OriginLock> DatabaseTracker::originLockFor(SecurityOrigin* origin)
+RefPtr<OriginLock> DatabaseTracker::originLockFor(SecurityOrigin* origin)
 {
     MutexLocker lockDatabase(m_databaseGuard);
     String databaseIdentifier = origin->databaseIdentifier();
@@ -680,11 +680,11 @@ PassRefPtr<OriginLock> DatabaseTracker::originLockFor(SecurityOrigin* origin)
         return addResult.iterator->value;
 
     String path = originPath(origin);
-    RefPtr<OriginLock> lock = adoptRef(new OriginLock(path));
+    RefPtr<OriginLock> lock = adoptRef(*new OriginLock(path));
     ASSERT(lock);
     addResult.iterator->value = lock;
 
-    return lock.release();
+    return WTF::move(lock);
 }
 
 void DatabaseTracker::deleteOriginLockFor(SecurityOrigin* origin)
index eaa4fb4..18d1fe3 100644 (file)
@@ -95,7 +95,7 @@ public:
     unsigned long long usageForOrigin(SecurityOrigin*);
     unsigned long long quotaForOrigin(SecurityOrigin*);
     void setQuota(SecurityOrigin*, unsigned long long);
-    PassRefPtr<OriginLock> originLockFor(SecurityOrigin*);
+    RefPtr<OriginLock> originLockFor(SecurityOrigin*);
 
     void deleteAllDatabases();
     WEBCORE_EXPORT void deleteDatabasesModifiedSince(std::chrono::system_clock::time_point);
index 22e92f5..8b5f5b9 100644 (file)
@@ -36,12 +36,12 @@ namespace WebCore {
 
 class SQLError : public ThreadSafeRefCounted<SQLError> {
 public:
-    static PassRefPtr<SQLError> create(unsigned code, const String& message) { return adoptRef(new SQLError(code, message)); }
-    static PassRefPtr<SQLError> create(unsigned code, const char* message, int sqliteCode)
+    static Ref<SQLError> create(unsigned code, const String& message) { return adoptRef(*new SQLError(code, message)); }
+    static Ref<SQLError> create(unsigned code, const char* message, int sqliteCode)
     {
         return create(code, String::format("%s (%d)", message, sqliteCode));
     }
-    static PassRefPtr<SQLError> create(unsigned code, const char* message, int sqliteCode, const char* sqliteMessage)
+    static Ref<SQLError> create(unsigned code, const char* message, int sqliteCode, const char* sqliteMessage)
     {
         return create(code, String::format("%s (%d %s)", message, sqliteCode, sqliteMessage));
     }
index 2c1f53d..74d8cd9 100644 (file)
@@ -37,7 +37,7 @@ namespace WebCore {
 
 class SQLResultSet : public ThreadSafeRefCounted<SQLResultSet> {
 public:
-    static PassRefPtr<SQLResultSet> create() { return adoptRef(new SQLResultSet); }
+    static Ref<SQLResultSet> create() { return adoptRef(*new SQLResultSet); }
 
     SQLResultSetRowList* rows() const;
 
index af20d19..eef148d 100644 (file)
@@ -37,7 +37,7 @@ namespace WebCore {
 
 class SQLResultSetRowList : public RefCounted<SQLResultSetRowList> {
 public:
-    static PassRefPtr<SQLResultSetRowList> create() { return adoptRef(new SQLResultSetRowList); }
+    static Ref<SQLResultSetRowList> create() { return adoptRef(*new SQLResultSetRowList); }
 
     const Vector<String>& columnNames() const { return m_columns; }
     const Vector<SQLValue>& values() const { return m_result; }
index 067dcba..48f3cbf 100644 (file)
 
 namespace WebCore {
 
-PassRefPtr<SQLStatementBackend> SQLStatementBackend::create(std::unique_ptr<SQLStatement> frontend,
+Ref<SQLStatementBackend> SQLStatementBackend::create(std::unique_ptr<SQLStatement> frontend,
     const String& statement, const Vector<SQLValue>& arguments, int permissions)
 {
-    return adoptRef(new SQLStatementBackend(WTF::move(frontend), statement, arguments, permissions));
+    return adoptRef(*new SQLStatementBackend(WTF::move(frontend), statement, arguments, permissions));
 }
 
 SQLStatementBackend::SQLStatementBackend(std::unique_ptr<SQLStatement> frontend,
index 20d4317..4928758 100644 (file)
@@ -43,7 +43,7 @@ class SQLTransactionBackend;
 
 class SQLStatementBackend : public ThreadSafeRefCounted<SQLStatementBackend> {
 public:
-    static PassRefPtr<SQLStatementBackend> create(std::unique_ptr<SQLStatement>,
+    static Ref<SQLStatementBackend> create(std::unique_ptr<SQLStatement>,
         const String& sqlStatement, const Vector<SQLValue>& arguments, int permissions);
     virtual ~SQLStatementBackend();
 
index 2d6e77c..b5c02f3 100644 (file)
 
 namespace WebCore {
 
-PassRefPtr<SQLTransactionBackend> SQLTransactionBackend::create(Database* db, PassRefPtr<SQLTransaction> frontend, PassRefPtr<SQLTransactionWrapper> wrapper, bool readOnly)
+Ref<SQLTransactionBackend> SQLTransactionBackend::create(Database* db, PassRefPtr<SQLTransaction> frontend, PassRefPtr<SQLTransactionWrapper> wrapper, bool readOnly)
 {
-    return adoptRef(new SQLTransactionBackend(db, frontend, wrapper, readOnly));
+    return adoptRef(*new SQLTransactionBackend(db, frontend, wrapper, readOnly));
 }
 
 SQLTransactionBackend::SQLTransactionBackend(Database* db, PassRefPtr<SQLTransaction> frontend, PassRefPtr<SQLTransactionWrapper> wrapper, bool readOnly)
index 1117e1c..a93206d 100644 (file)
@@ -59,7 +59,7 @@ public:
 
 class SQLTransactionBackend : public ThreadSafeRefCounted<SQLTransactionBackend>, public SQLTransactionStateMachine<SQLTransactionBackend> {
 public:
-    static PassRefPtr<SQLTransactionBackend> create(Database*, PassRefPtr<SQLTransaction>, PassRefPtr<SQLTransactionWrapper>, bool readOnly);
+    static Ref<SQLTransactionBackend> create(Database*, PassRefPtr<SQLTransaction>, PassRefPtr<SQLTransactionWrapper>, bool readOnly);
 
     virtual ~SQLTransactionBackend();
 
index ea73a03..4746845 100644 (file)
@@ -52,9 +52,9 @@ ThreadableWebSocketChannelClientWrapper::ThreadableWebSocketChannelClientWrapper
 {
 }
 
-PassRefPtr<ThreadableWebSocketChannelClientWrapper> ThreadableWebSocketChannelClientWrapper::create(ScriptExecutionContext* context, WebSocketChannelClient* client)
+Ref<ThreadableWebSocketChannelClientWrapper> ThreadableWebSocketChannelClientWrapper::create(ScriptExecutionContext* context, WebSocketChannelClient* client)
 {
-    return adoptRef(new ThreadableWebSocketChannelClientWrapper(context, client));
+    return adoptRef(*new ThreadableWebSocketChannelClientWrapper(context, client));
 }
 
 void ThreadableWebSocketChannelClientWrapper::clearSyncMethodDone()
index d8cfd94..a3894c9 100644 (file)
@@ -50,7 +50,7 @@ class WebSocketChannelClient;
 
 class ThreadableWebSocketChannelClientWrapper : public ThreadSafeRefCounted<ThreadableWebSocketChannelClientWrapper> {
 public:
-    static PassRefPtr<ThreadableWebSocketChannelClientWrapper> create(ScriptExecutionContext*, WebSocketChannelClient*);
+    static Ref<ThreadableWebSocketChannelClientWrapper> create(ScriptExecutionContext*, WebSocketChannelClient*);
 
     void clearSyncMethodDone();
     void setSyncMethodDone();
index 7f03498..e359b3b 100644 (file)
@@ -156,37 +156,37 @@ WebSocket::~WebSocket()
         m_channel->disconnect();
 }
 
-PassRefPtr<WebSocket> WebSocket::create(ScriptExecutionContext& context)
+Ref<WebSocket> WebSocket::create(ScriptExecutionContext& context)
 {
-    RefPtr<WebSocket> webSocket(adoptRef(new WebSocket(context)));
+    Ref<WebSocket> webSocket(adoptRef(*new WebSocket(context)));
     webSocket->suspendIfNeeded();
-    return webSocket.release();
+    return webSocket;
 }
 
-PassRefPtr<WebSocket> WebSocket::create(ScriptExecutionContext& context, const String& url, ExceptionCode& ec)
+RefPtr<WebSocket> WebSocket::create(ScriptExecutionContext& context, const String& url, ExceptionCode& ec)
 {
     Vector<String> protocols;
     return WebSocket::create(context, url, protocols, ec);
 }
 
-PassRefPtr<WebSocket> WebSocket::create(ScriptExecutionContext& context, const String& url, const Vector<String>& protocols, ExceptionCode& ec)
+RefPtr<WebSocket> WebSocket::create(ScriptExecutionContext& context, const String& url, const Vector<String>& protocols, ExceptionCode& ec)
 {
     if (url.isNull()) {
         ec = SYNTAX_ERR;
-        return 0;
+        return nullptr;
     }
 
-    RefPtr<WebSocket> webSocket(adoptRef(new WebSocket(context)));
+    RefPtr<WebSocket> webSocket(adoptRef(*new WebSocket(context)));
     webSocket->suspendIfNeeded();
 
     webSocket->connect(context.completeURL(url), protocols, ec);
     if (ec)
-        return 0;
+        return nullptr;
 
-    return webSocket.release();
+    return WTF::move(webSocket);
 }
 
-PassRefPtr<WebSocket> WebSocket::create(ScriptExecutionContext& context, const String& url, const String& protocol, ExceptionCode& ec)
+RefPtr<WebSocket> WebSocket::create(ScriptExecutionContext& context, const String& url, const String& protocol, ExceptionCode& ec)
 {
     Vector<String> protocols;
     protocols.append(protocol);
index 68e3083..40e9dd0 100644 (file)
@@ -54,10 +54,10 @@ public:
     static void setIsAvailable(bool);
     static bool isAvailable();
     static const char* subProtocolSeperator();
-    static PassRefPtr<WebSocket> create(ScriptExecutionContext&);
-    static PassRefPtr<WebSocket> create(ScriptExecutionContext&, const String& url, ExceptionCode&);
-    static PassRefPtr<WebSocket> create(ScriptExecutionContext&, const String& url, const String& protocol, ExceptionCode&);
-    static PassRefPtr<WebSocket> create(ScriptExecutionContext&, const String& url, const Vector<String>& protocols, ExceptionCode&);
+    static Ref<WebSocket> create(ScriptExecutionContext&);
+    static RefPtr<WebSocket> create(ScriptExecutionContext&, const String& url, ExceptionCode&);
+    static RefPtr<WebSocket> create(ScriptExecutionContext&, const String& url, const String& protocol, ExceptionCode&);
+    static RefPtr<WebSocket> create(ScriptExecutionContext&, const String& url, const Vector<String>& protocols, ExceptionCode&);
     virtual ~WebSocket();
 
     enum State {
index 9a7f8c4..043dc0f 100644 (file)
@@ -59,7 +59,7 @@ class WebSocketChannel : public RefCounted<WebSocketChannel>, public SocketStrea
 {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    static PassRefPtr<WebSocketChannel> create(Document* document, WebSocketChannelClient* client) { return adoptRef(new WebSocketChannel(document, client)); }
+    static Ref<WebSocketChannel> create(Document* document, WebSocketChannelClient* client) { return adoptRef(*new WebSocketChannel(document, client)); }
     virtual ~WebSocketChannel();
 
     bool send(const char* data, int length);
index 078b106..62ed3cd 100644 (file)
@@ -55,9 +55,9 @@ class WorkerRunLoop;
 class WorkerThreadableWebSocketChannel : public RefCounted<WorkerThreadableWebSocketChannel>, public ThreadableWebSocketChannel {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    static PassRefPtr<ThreadableWebSocketChannel> create(WorkerGlobalScope* workerGlobalScope, WebSocketChannelClient* client, const String& taskMode)
+    static Ref<ThreadableWebSocketChannel> create(WorkerGlobalScope* workerGlobalScope, WebSocketChannelClient* client, const String& taskMode)
     {
-        return adoptRef(new WorkerThreadableWebSocketChannel(workerGlobalScope, client, taskMode));
+        return adoptRef(*new WorkerThreadableWebSocketChannel(workerGlobalScope, client, taskMode));
     }
     virtual ~WorkerThreadableWebSocketChannel();
 
@@ -126,9 +126,9 @@ private:
     // Bridge for Peer.  Running on the worker thread.
     class Bridge : public RefCounted<Bridge> {
     public:
-        static PassRefPtr<Bridge> create(PassRefPtr<ThreadableWebSocketChannelClientWrapper> workerClientWrapper, PassRefPtr<WorkerGlobalScope> workerGlobalScope, const String& taskMode)
+        static Ref<Bridge> create(PassRefPtr<ThreadableWebSocketChannelClientWrapper> workerClientWrapper, PassRefPtr<WorkerGlobalScope> workerGlobalScope, const String& taskMode)
         {
-            return adoptRef(new Bridge(workerClientWrapper, workerGlobalScope, taskMode));
+            return adoptRef(*new Bridge(workerClientWrapper, workerGlobalScope, taskMode));
         }
         ~Bridge();
         void initialize();
index 6b0fc29..d938c34 100644 (file)
@@ -37,9 +37,9 @@ class InsertListCommand : public CompositeEditCommand {
 public:
     enum Type { OrderedList, UnorderedList };
 
-    static RefPtr<InsertListCommand> create(Document& document, Type listType)
+    static Ref<InsertListCommand> create(Document& document, Type listType)
     {
-        return adoptRef(new InsertListCommand(document, listType));
+        return adoptRef(*new InsertListCommand(document, listType));
     }
 
     static RefPtr<HTMLElement> insertList(Document&, Type);
index 02379a8..ce0f651 100644 (file)
@@ -72,28 +72,28 @@ inline Worker::Worker(ScriptExecutionContext& context)
     ASSERT_UNUSED(addResult, addResult.isNewEntry);
 }
 
-PassRefPtr<Worker> Worker::create(ScriptExecutionContext& context, const String& url, ExceptionCode& ec)
+RefPtr<Worker> Worker::create(ScriptExecutionContext& context, const String& url, ExceptionCode& ec)
 {
     ASSERT(isMainThread());
 
     // We don't currently support nested workers, so workers can only be created from documents.
     ASSERT_WITH_SECURITY_IMPLICATION(context.isDocument());
 
-    RefPtr<Worker> worker = adoptRef(new Worker(context));
+    Ref<Worker> worker = adoptRef(*new Worker(context));
 
     worker->suspendIfNeeded();
 
     URL scriptURL = worker->resolveURL(url, ec);
     if (scriptURL.isEmpty())
-        return 0;
+        return nullptr;
 
     // The worker context does not exist while loading, so we must ensure that the worker object is not collected, nor are its event listeners.
-    worker->setPendingActivity(worker.get());
+    worker->setPendingActivity(worker.ptr());
 
     worker->m_scriptLoader = WorkerScriptLoader::create();
-    worker->m_scriptLoader->loadAsynchronously(&context, scriptURL, DenyCrossOriginRequests, worker.get());
+    worker->m_scriptLoader->loadAsynchronously(&context, scriptURL, DenyCrossOriginRequests, worker.ptr());
 
-    return worker.release();
+    return WTF::move(worker);
 }
 
 Worker::~Worker()
index 73b3eab..d9dba4b 100644 (file)
@@ -48,7 +48,7 @@ namespace WebCore {
 
     class Worker final : public AbstractWorker, public ActiveDOMObject, private WorkerScriptLoaderClient {
     public:
-        static PassRefPtr<Worker> create(ScriptExecutionContext&, const String& url, ExceptionCode&);
+        static RefPtr<Worker> create(ScriptExecutionContext&, const String& url, ExceptionCode&);
         virtual ~Worker();
 
         virtual EventTargetInterface eventTargetInterface() const override { return WorkerEventTargetInterfaceType; }
index 764a30f..fdfb8ae 100644 (file)
@@ -45,24 +45,24 @@ inline XPathExpression::XPathExpression(std::unique_ptr<XPath::Expression> expre
 {
 }
 
-PassRefPtr<XPathExpression> XPathExpression::createExpression(const String& expression, XPathNSResolver* resolver, ExceptionCode& ec)
+RefPtr<XPathExpression> XPathExpression::createExpression(const String& expression, XPathNSResolver* resolver, ExceptionCode& ec)
 {
     auto parsedExpression = Parser::parseStatement(expression, resolver, ec);
     if (!parsedExpression)
         return nullptr;
 
-    return adoptRef(new XPathExpression(WTF::move(parsedExpression)));
+    return adoptRef(*new XPathExpression(WTF::move(parsedExpression)));
 }
 
 XPathExpression::~XPathExpression()
 {
 }
 
-PassRefPtr<XPathResult> XPathExpression::evaluate(Node* contextNode, unsigned short type, XPathResult*, ExceptionCode& ec)
+RefPtr<XPathResult> XPathExpression::evaluate(Node* contextNode, unsigned short type, XPathResult*, ExceptionCode& ec)
 {
     if (!isValidContextNode(contextNode)) {
         ec = NOT_SUPPORTED_ERR;
-        return 0;
+        return nullptr;
     }
 
     EvaluationContext& evaluationContext = Expression::evaluationContext();
@@ -87,7 +87,7 @@ PassRefPtr<XPathResult> XPathExpression::evaluate(Node* contextNode, unsigned sh
             return nullptr;
     }
 
-    return result;
+    return WTF::move(result);
 }
 
 }
index 8fd2a3e..90da675 100644 (file)
@@ -44,10 +44,10 @@ namespace WebCore {
 
     class XPathExpression : public RefCounted<XPathExpression> {
     public:
-        static PassRefPtr<XPathExpression> createExpression(const String& expression, XPathNSResolver*, ExceptionCode&);
+        static RefPtr<XPathExpression> createExpression(const String& expression, XPathNSResolver*, ExceptionCode&);
         ~XPathExpression();
         
-        PassRefPtr<XPathResult> evaluate(Node* contextNode, unsigned short type, XPathResult*, ExceptionCode&);
+        RefPtr<XPathResult> evaluate(Node* contextNode, unsigned short type, XPathResult*, ExceptionCode&);
             
     private:
         explicit XPathExpression(std::unique_ptr<XPath::Expression>);