Diff
Modified: trunk/Source/WebCore/ChangeLog (184708 => 184709)
--- trunk/Source/WebCore/ChangeLog 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/ChangeLog 2015-05-21 07:26:55 UTC (rev 184709)
@@ -1,3 +1,94 @@
+2015-05-21 Gyuyoung Kim <gyuyoung....@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-qu...@webkit.org>
Unreviewed, rolling out r184667 and r184682.
Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp (184708 => 184709)
--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp 2015-05-21 07:26:55 UTC (rev 184709)
@@ -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;
}
Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h (184708 => 184709)
--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.h 2015-05-21 07:26:55 UTC (rev 184709)
@@ -47,7 +47,7 @@
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; }
Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp (184708 => 184709)
--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp 2015-05-21 07:26:55 UTC (rev 184709)
@@ -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 @@
// 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 @@
// 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 @@
}
}
-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 @@
// 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 @@
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)
Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.h (184708 => 184709)
--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.h 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.h 2015-05-21 07:26:55 UTC (rev 184709)
@@ -44,10 +44,10 @@
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);
Modified: trunk/Source/WebCore/Modules/gamepad/Gamepad.h (184708 => 184709)
--- trunk/Source/WebCore/Modules/gamepad/Gamepad.h 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/gamepad/Gamepad.h 2015-05-21 07:26:55 UTC (rev 184709)
@@ -39,9 +39,9 @@
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();
Modified: trunk/Source/WebCore/Modules/gamepad/NavigatorGamepad.cpp (184708 => 184709)
--- trunk/Source/WebCore/Modules/gamepad/NavigatorGamepad.cpp 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/gamepad/NavigatorGamepad.cpp 2015-05-21 07:26:55 UTC (rev 184709)
@@ -76,7 +76,7 @@
{
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];
}
Modified: trunk/Source/WebCore/Modules/gamepad/deprecated/Gamepad.h (184708 => 184709)
--- trunk/Source/WebCore/Modules/gamepad/deprecated/Gamepad.h 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/gamepad/deprecated/Gamepad.h 2015-05-21 07:26:55 UTC (rev 184709)
@@ -36,9 +36,9 @@
class Gamepad: public RefCounted<Gamepad> {
public:
- static PassRefPtr<Gamepad> create()
+ static Ref<Gamepad> create()
{
- return adoptRef(new Gamepad);
+ return adoptRef(*new Gamepad);
}
~Gamepad();
Modified: trunk/Source/WebCore/Modules/geolocation/GeolocationError.h (184708 => 184709)
--- trunk/Source/WebCore/Modules/geolocation/GeolocationError.h 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/geolocation/GeolocationError.h 2015-05-21 07:26:55 UTC (rev 184709)
@@ -40,7 +40,7 @@
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; }
Modified: trunk/Source/WebCore/Modules/geolocation/GeolocationPosition.h (184708 => 184709)
--- trunk/Source/WebCore/Modules/geolocation/GeolocationPosition.h 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/geolocation/GeolocationPosition.h 2015-05-21 07:26:55 UTC (rev 184709)
@@ -34,9 +34,15 @@
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; }
Modified: trunk/Source/WebCore/Modules/geolocation/Geoposition.h (184708 => 184709)
--- trunk/Source/WebCore/Modules/geolocation/Geoposition.h 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/geolocation/Geoposition.h 2015-05-21 07:26:55 UTC (rev 184709)
@@ -35,9 +35,9 @@
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
Modified: trunk/Source/WebCore/Modules/geolocation/PositionError.h (184708 => 184709)
--- trunk/Source/WebCore/Modules/geolocation/PositionError.h 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/geolocation/PositionError.h 2015-05-21 07:26:55 UTC (rev 184709)
@@ -40,7 +40,7 @@
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; }
Modified: trunk/Source/WebCore/Modules/geolocation/PositionOptions.h (184708 => 184709)
--- trunk/Source/WebCore/Modules/geolocation/PositionOptions.h 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/geolocation/PositionOptions.h 2015-05-21 07:26:55 UTC (rev 184709)
@@ -33,7 +33,7 @@
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; }
Modified: trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp (184708 => 184709)
--- trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp 2015-05-21 07:26:55 UTC (rev 184709)
@@ -61,9 +61,9 @@
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)
Modified: trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.h (184708 => 184709)
--- trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.h 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.h 2015-05-21 07:26:55 UTC (rev 184709)
@@ -46,7 +46,7 @@
class MediaControlsHost : public RefCounted<MediaControlsHost> {
public:
- static PassRefPtr<MediaControlsHost> create(HTMLMediaElement*);
+ static Ref<MediaControlsHost> create(HTMLMediaElement*);
~MediaControlsHost();
static const AtomicString& automaticKeyword();
Modified: trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp (184708 => 184709)
--- trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp 2015-05-21 07:26:55 UTC (rev 184709)
@@ -67,11 +67,11 @@
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)
Modified: trunk/Source/WebCore/Modules/mediasource/MediaSource.h (184708 => 184709)
--- trunk/Source/WebCore/Modules/mediasource/MediaSource.h 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/mediasource/MediaSource.h 2015-05-21 07:26:55 UTC (rev 184709)
@@ -58,7 +58,7 @@
static const AtomicString& closedKeyword();
static const AtomicString& endedKeyword();
- static PassRefPtr<MediaSource> create(ScriptExecutionContext&);
+ static Ref<MediaSource> create(ScriptExecutionContext&);
virtual ~MediaSource();
void addedToRegistry();
Modified: trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.cpp (184708 => 184709)
--- trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.cpp 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.cpp 2015-05-21 07:26:55 UTC (rev 184709)
@@ -54,7 +54,7 @@
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 @@
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)
Modified: trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.h (184708 => 184709)
--- trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.h 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.h 2015-05-21 07:26:55 UTC (rev 184709)
@@ -47,8 +47,8 @@
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;
Modified: trunk/Source/WebCore/Modules/mediastream/RTCIceCandidate.cpp (184708 => 184709)
--- trunk/Source/WebCore/Modules/mediastream/RTCIceCandidate.cpp 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/mediastream/RTCIceCandidate.cpp 2015-05-21 07:26:55 UTC (rev 184709)
@@ -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 @@
}
}
- 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)
Modified: trunk/Source/WebCore/Modules/mediastream/RTCIceCandidate.h (184708 => 184709)
--- trunk/Source/WebCore/Modules/mediastream/RTCIceCandidate.h 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/mediastream/RTCIceCandidate.h 2015-05-21 07:26:55 UTC (rev 184709)
@@ -47,8 +47,8 @@
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;
Modified: trunk/Source/WebCore/Modules/webaudio/OfflineAudioContext.cpp (184708 => 184709)
--- trunk/Source/WebCore/Modules/webaudio/OfflineAudioContext.cpp 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/webaudio/OfflineAudioContext.cpp 2015-05-21 07:26:55 UTC (rev 184709)
@@ -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 @@
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)
Modified: trunk/Source/WebCore/Modules/webaudio/OfflineAudioContext.h (184708 => 184709)
--- trunk/Source/WebCore/Modules/webaudio/OfflineAudioContext.h 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/webaudio/OfflineAudioContext.h 2015-05-21 07:26:55 UTC (rev 184709)
@@ -31,7 +31,7 @@
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();
Modified: trunk/Source/WebCore/Modules/webaudio/OfflineAudioDestinationNode.h (184708 => 184709)
--- trunk/Source/WebCore/Modules/webaudio/OfflineAudioDestinationNode.h 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/webaudio/OfflineAudioDestinationNode.h 2015-05-21 07:26:55 UTC (rev 184709)
@@ -38,9 +38,9 @@
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();
Modified: trunk/Source/WebCore/Modules/webaudio/OscillatorNode.cpp (184708 => 184709)
--- trunk/Source/WebCore/Modules/webaudio/OscillatorNode.cpp 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/webaudio/OscillatorNode.cpp 2015-05-21 07:26:55 UTC (rev 184709)
@@ -46,9 +46,9 @@
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)
Modified: trunk/Source/WebCore/Modules/webaudio/OscillatorNode.h (184708 => 184709)
--- trunk/Source/WebCore/Modules/webaudio/OscillatorNode.h 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/webaudio/OscillatorNode.h 2015-05-21 07:26:55 UTC (rev 184709)
@@ -51,7 +51,7 @@
CUSTOM = 4
};
- static PassRefPtr<OscillatorNode> create(AudioContext*, float sampleRate);
+ static Ref<OscillatorNode> create(AudioContext*, float sampleRate);
virtual ~OscillatorNode();
Modified: trunk/Source/WebCore/Modules/webdatabase/Database.cpp (184708 => 184709)
--- trunk/Source/WebCore/Modules/webdatabase/Database.cpp 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/webdatabase/Database.cpp 2015-05-21 07:26:55 UTC (rev 184709)
@@ -296,7 +296,7 @@
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());
});
}
}
Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp (184708 => 184709)
--- trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp 2015-05-21 07:26:55 UTC (rev 184709)
@@ -662,7 +662,7 @@
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 @@
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)
Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.h (184708 => 184709)
--- trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.h 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.h 2015-05-21 07:26:55 UTC (rev 184709)
@@ -95,7 +95,7 @@
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);
Modified: trunk/Source/WebCore/Modules/webdatabase/SQLError.h (184708 => 184709)
--- trunk/Source/WebCore/Modules/webdatabase/SQLError.h 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLError.h 2015-05-21 07:26:55 UTC (rev 184709)
@@ -36,12 +36,12 @@
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));
}
Modified: trunk/Source/WebCore/Modules/webdatabase/SQLResultSet.h (184708 => 184709)
--- trunk/Source/WebCore/Modules/webdatabase/SQLResultSet.h 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLResultSet.h 2015-05-21 07:26:55 UTC (rev 184709)
@@ -37,7 +37,7 @@
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;
Modified: trunk/Source/WebCore/Modules/webdatabase/SQLResultSetRowList.h (184708 => 184709)
--- trunk/Source/WebCore/Modules/webdatabase/SQLResultSetRowList.h 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLResultSetRowList.h 2015-05-21 07:26:55 UTC (rev 184709)
@@ -37,7 +37,7 @@
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; }
Modified: trunk/Source/WebCore/Modules/webdatabase/SQLStatementBackend.cpp (184708 => 184709)
--- trunk/Source/WebCore/Modules/webdatabase/SQLStatementBackend.cpp 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLStatementBackend.cpp 2015-05-21 07:26:55 UTC (rev 184709)
@@ -75,10 +75,10 @@
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,
Modified: trunk/Source/WebCore/Modules/webdatabase/SQLStatementBackend.h (184708 => 184709)
--- trunk/Source/WebCore/Modules/webdatabase/SQLStatementBackend.h 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLStatementBackend.h 2015-05-21 07:26:55 UTC (rev 184709)
@@ -43,7 +43,7 @@
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();
Modified: trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.cpp (184708 => 184709)
--- trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.cpp 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.cpp 2015-05-21 07:26:55 UTC (rev 184709)
@@ -344,9 +344,9 @@
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)
Modified: trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.h (184708 => 184709)
--- trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.h 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.h 2015-05-21 07:26:55 UTC (rev 184709)
@@ -59,7 +59,7 @@
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();
Modified: trunk/Source/WebCore/Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp (184708 => 184709)
--- trunk/Source/WebCore/Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp 2015-05-21 07:26:55 UTC (rev 184709)
@@ -52,9 +52,9 @@
{
}
-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()
Modified: trunk/Source/WebCore/Modules/websockets/ThreadableWebSocketChannelClientWrapper.h (184708 => 184709)
--- trunk/Source/WebCore/Modules/websockets/ThreadableWebSocketChannelClientWrapper.h 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/websockets/ThreadableWebSocketChannelClientWrapper.h 2015-05-21 07:26:55 UTC (rev 184709)
@@ -50,7 +50,7 @@
class ThreadableWebSocketChannelClientWrapper : public ThreadSafeRefCounted<ThreadableWebSocketChannelClientWrapper> {
public:
- static PassRefPtr<ThreadableWebSocketChannelClientWrapper> create(ScriptExecutionContext*, WebSocketChannelClient*);
+ static Ref<ThreadableWebSocketChannelClientWrapper> create(ScriptExecutionContext*, WebSocketChannelClient*);
void clearSyncMethodDone();
void setSyncMethodDone();
Modified: trunk/Source/WebCore/Modules/websockets/WebSocket.cpp (184708 => 184709)
--- trunk/Source/WebCore/Modules/websockets/WebSocket.cpp 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/websockets/WebSocket.cpp 2015-05-21 07:26:55 UTC (rev 184709)
@@ -156,37 +156,37 @@
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);
Modified: trunk/Source/WebCore/Modules/websockets/WebSocket.h (184708 => 184709)
--- trunk/Source/WebCore/Modules/websockets/WebSocket.h 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/websockets/WebSocket.h 2015-05-21 07:26:55 UTC (rev 184709)
@@ -54,10 +54,10 @@
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 {
Modified: trunk/Source/WebCore/Modules/websockets/WebSocketChannel.h (184708 => 184709)
--- trunk/Source/WebCore/Modules/websockets/WebSocketChannel.h 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/websockets/WebSocketChannel.h 2015-05-21 07:26:55 UTC (rev 184709)
@@ -59,7 +59,7 @@
{
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);
Modified: trunk/Source/WebCore/Modules/websockets/WorkerThreadableWebSocketChannel.h (184708 => 184709)
--- trunk/Source/WebCore/Modules/websockets/WorkerThreadableWebSocketChannel.h 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/Modules/websockets/WorkerThreadableWebSocketChannel.h 2015-05-21 07:26:55 UTC (rev 184709)
@@ -55,9 +55,9 @@
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 @@
// 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();
Modified: trunk/Source/WebCore/editing/InsertListCommand.h (184708 => 184709)
--- trunk/Source/WebCore/editing/InsertListCommand.h 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/editing/InsertListCommand.h 2015-05-21 07:26:55 UTC (rev 184709)
@@ -37,9 +37,9 @@
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);
Modified: trunk/Source/WebCore/workers/Worker.cpp (184708 => 184709)
--- trunk/Source/WebCore/workers/Worker.cpp 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/workers/Worker.cpp 2015-05-21 07:26:55 UTC (rev 184709)
@@ -72,28 +72,28 @@
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()
Modified: trunk/Source/WebCore/workers/Worker.h (184708 => 184709)
--- trunk/Source/WebCore/workers/Worker.h 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/workers/Worker.h 2015-05-21 07:26:55 UTC (rev 184709)
@@ -48,7 +48,7 @@
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; }
Modified: trunk/Source/WebCore/xml/XPathExpression.cpp (184708 => 184709)
--- trunk/Source/WebCore/xml/XPathExpression.cpp 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/xml/XPathExpression.cpp 2015-05-21 07:26:55 UTC (rev 184709)
@@ -45,24 +45,24 @@
{
}
-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 @@
return nullptr;
}
- return result;
+ return WTF::move(result);
}
}
Modified: trunk/Source/WebCore/xml/XPathExpression.h (184708 => 184709)
--- trunk/Source/WebCore/xml/XPathExpression.h 2015-05-21 07:26:50 UTC (rev 184708)
+++ trunk/Source/WebCore/xml/XPathExpression.h 2015-05-21 07:26:55 UTC (rev 184709)
@@ -44,10 +44,10 @@
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_>);