https://bugs.webkit.org/show_bug.cgi?id=145304
Reviewed by Darin Adler.
As a step to remove PassRefPtr, this patch replaces PassRefPtr with Ref or RefPtr.
No new tests, no behavior changes
* Modules/mediasource/SourceBufferList.h:
* Modules/mediastream/AllAudioCapabilities.h:
(WebCore::AllAudioCapabilities::create):
* Modules/mediastream/AllVideoCapabilities.h:
(WebCore::AllVideoCapabilities::create):
* Modules/mediastream/CapabilityRange.cpp:
(WebCore::CapabilityRange::create):
* Modules/mediastream/CapabilityRange.h:
* Modules/mediastream/MediaSourceStates.cpp:
(WebCore::MediaSourceStates::create):
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::create):
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::create):
* Modules/mediastream/MediaStreamTrackSourcesRequest.cpp:
(WebCore::MediaStreamTrackSourcesRequest::create):
* Modules/mediastream/MediaTrackConstraint.cpp:
(WebCore::MediaTrackConstraint::create):
* Modules/mediastream/MediaTrackConstraint.h:
* Modules/mediastream/RTCConfiguration.h:
(WebCore::RTCConfiguration::create):
* Modules/mediastream/RTCIceServer.h:
(WebCore::RTCIceServer::create):
* Modules/mediastream/RTCSessionDescription.cpp:
(WebCore::RTCSessionDescription::create):
* Modules/mediastream/RTCSessionDescription.h:
* Modules/mediastream/RTCSessionDescriptionRequestImpl.cpp:
(WebCore::RTCSessionDescriptionRequestImpl::create):
* Modules/mediastream/RTCStatsReport.cpp:
(WebCore::RTCStatsReport::create):
* Modules/mediastream/RTCStatsReport.h:
* Modules/mediastream/RTCStatsRequestImpl.cpp:
(WebCore::RTCStatsRequestImpl::create):
* Modules/mediastream/RTCStatsRequestImpl.h:
* Modules/mediastream/RTCStatsResponse.cpp:
(WebCore::RTCStatsResponse::create):
* Modules/mediastream/RTCStatsResponse.h:
* Modules/mediastream/RTCVoidRequestImpl.cpp:
(WebCore::RTCVoidRequestImpl::create):
* Modules/mediastream/RTCVoidRequestImpl.h:
* Modules/mediastream/SourceInfo.cpp:
(WebCore::SourceInfo::create):
* Modules/mediastream/SourceInfo.h:
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::create):
* Modules/mediastream/UserMediaRequest.h:
* Modules/quota/StorageInfo.h:
(WebCore::StorageInfo::create):
* Modules/quota/StorageQuota.h:
(WebCore::StorageQuota::create):
* Modules/speech/SpeechSynthesis.cpp:
(WebCore::SpeechSynthesis::create):
* Modules/speech/SpeechSynthesis.h:
* Modules/speech/SpeechSynthesisUtterance.cpp:
(WebCore::SpeechSynthesisUtterance::create):
* Modules/speech/SpeechSynthesisUtterance.h:
* Modules/speech/SpeechSynthesisVoice.cpp:
(WebCore::SpeechSynthesisVoice::create):
* Modules/speech/SpeechSynthesisVoice.h:
* Modules/webaudio/ChannelMergerNode.cpp:
(WebCore::ChannelMergerNode::create):
* Modules/webaudio/ChannelMergerNode.h:
* Modules/webaudio/ChannelSplitterNode.cpp:
(WebCore::ChannelSplitterNode::create):
* Modules/webaudio/ChannelSplitterNode.h:
* Modules/webaudio/DefaultAudioDestinationNode.h:
(WebCore::DefaultAudioDestinationNode::create):
* Modules/webaudio/GainNode.h:
(WebCore::GainNode::create):
* Modules/webaudio/MediaElementAudioSourceNode.cpp:
(WebCore::MediaElementAudioSourceNode::create):
* Modules/webaudio/MediaElementAudioSourceNode.h:
* Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
(WebCore::MediaStreamAudioDestinationNode::create):
* Modules/webaudio/MediaStreamAudioDestinationNode.h:
* Modules/webaudio/MediaStreamAudioSource.cpp:
(WebCore::MediaStreamAudioSource::create):
* Modules/webaudio/MediaStreamAudioSource.h:
* Modules/webaudio/MediaStreamAudioSourceNode.cpp:
(WebCore::MediaStreamAudioSourceNode::create):
* Modules/webaudio/MediaStreamAudioSourceNode.h:
* Modules/webaudio/OscillatorNode.cpp:
(WebCore::OscillatorNode::setType):
* Modules/webaudio/PannerNode.h:
(WebCore::PannerNode::create):
* Modules/webaudio/PeriodicWave.cpp:
(WebCore::PeriodicWave::create):
(WebCore::PeriodicWave::createSine):
(WebCore::PeriodicWave::createSquare):
(WebCore::PeriodicWave::createSawtooth):
(WebCore::PeriodicWave::createTriangle):
* Modules/webaudio/PeriodicWave.h:
* Modules/webaudio/ScriptProcessorNode.cpp:
(WebCore::ScriptProcessorNode::create):
* Modules/webaudio/ScriptProcessorNode.h:
* Modules/webaudio/WaveShaperNode.h:
(WebCore::WaveShaperNode::create):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@184940
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2015-05-27 Gyuyoung Kim <gyuyoung.kim@webkit.org>
+
+ Purge PassRefPtr in WebCore/Modules - 2
+ https://bugs.webkit.org/show_bug.cgi?id=145304
+
+ Reviewed by Darin Adler.
+
+ As a step to remove PassRefPtr, this patch replaces PassRefPtr with Ref or RefPtr.
+
+ No new tests, no behavior changes
+
+ * Modules/mediasource/SourceBufferList.h:
+ * Modules/mediastream/AllAudioCapabilities.h:
+ (WebCore::AllAudioCapabilities::create):
+ * Modules/mediastream/AllVideoCapabilities.h:
+ (WebCore::AllVideoCapabilities::create):
+ * Modules/mediastream/CapabilityRange.cpp:
+ (WebCore::CapabilityRange::create):
+ * Modules/mediastream/CapabilityRange.h:
+ * Modules/mediastream/MediaSourceStates.cpp:
+ (WebCore::MediaSourceStates::create):
+ * Modules/mediastream/MediaStream.cpp:
+ (WebCore::MediaStream::create):
+ * Modules/mediastream/MediaStreamTrack.cpp:
+ (WebCore::MediaStreamTrack::create):
+ * Modules/mediastream/MediaStreamTrackSourcesRequest.cpp:
+ (WebCore::MediaStreamTrackSourcesRequest::create):
+ * Modules/mediastream/MediaTrackConstraint.cpp:
+ (WebCore::MediaTrackConstraint::create):
+ * Modules/mediastream/MediaTrackConstraint.h:
+ * Modules/mediastream/RTCConfiguration.h:
+ (WebCore::RTCConfiguration::create):
+ * Modules/mediastream/RTCIceServer.h:
+ (WebCore::RTCIceServer::create):
+ * Modules/mediastream/RTCSessionDescription.cpp:
+ (WebCore::RTCSessionDescription::create):
+ * Modules/mediastream/RTCSessionDescription.h:
+ * Modules/mediastream/RTCSessionDescriptionRequestImpl.cpp:
+ (WebCore::RTCSessionDescriptionRequestImpl::create):
+ * Modules/mediastream/RTCStatsReport.cpp:
+ (WebCore::RTCStatsReport::create):
+ * Modules/mediastream/RTCStatsReport.h:
+ * Modules/mediastream/RTCStatsRequestImpl.cpp:
+ (WebCore::RTCStatsRequestImpl::create):
+ * Modules/mediastream/RTCStatsRequestImpl.h:
+ * Modules/mediastream/RTCStatsResponse.cpp:
+ (WebCore::RTCStatsResponse::create):
+ * Modules/mediastream/RTCStatsResponse.h:
+ * Modules/mediastream/RTCVoidRequestImpl.cpp:
+ (WebCore::RTCVoidRequestImpl::create):
+ * Modules/mediastream/RTCVoidRequestImpl.h:
+ * Modules/mediastream/SourceInfo.cpp:
+ (WebCore::SourceInfo::create):
+ * Modules/mediastream/SourceInfo.h:
+ * Modules/mediastream/UserMediaRequest.cpp:
+ (WebCore::UserMediaRequest::create):
+ * Modules/mediastream/UserMediaRequest.h:
+ * Modules/quota/StorageInfo.h:
+ (WebCore::StorageInfo::create):
+ * Modules/quota/StorageQuota.h:
+ (WebCore::StorageQuota::create):
+ * Modules/speech/SpeechSynthesis.cpp:
+ (WebCore::SpeechSynthesis::create):
+ * Modules/speech/SpeechSynthesis.h:
+ * Modules/speech/SpeechSynthesisUtterance.cpp:
+ (WebCore::SpeechSynthesisUtterance::create):
+ * Modules/speech/SpeechSynthesisUtterance.h:
+ * Modules/speech/SpeechSynthesisVoice.cpp:
+ (WebCore::SpeechSynthesisVoice::create):
+ * Modules/speech/SpeechSynthesisVoice.h:
+ * Modules/webaudio/ChannelMergerNode.cpp:
+ (WebCore::ChannelMergerNode::create):
+ * Modules/webaudio/ChannelMergerNode.h:
+ * Modules/webaudio/ChannelSplitterNode.cpp:
+ (WebCore::ChannelSplitterNode::create):
+ * Modules/webaudio/ChannelSplitterNode.h:
+ * Modules/webaudio/DefaultAudioDestinationNode.h:
+ (WebCore::DefaultAudioDestinationNode::create):
+ * Modules/webaudio/GainNode.h:
+ (WebCore::GainNode::create):
+ * Modules/webaudio/MediaElementAudioSourceNode.cpp:
+ (WebCore::MediaElementAudioSourceNode::create):
+ * Modules/webaudio/MediaElementAudioSourceNode.h:
+ * Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
+ (WebCore::MediaStreamAudioDestinationNode::create):
+ * Modules/webaudio/MediaStreamAudioDestinationNode.h:
+ * Modules/webaudio/MediaStreamAudioSource.cpp:
+ (WebCore::MediaStreamAudioSource::create):
+ * Modules/webaudio/MediaStreamAudioSource.h:
+ * Modules/webaudio/MediaStreamAudioSourceNode.cpp:
+ (WebCore::MediaStreamAudioSourceNode::create):
+ * Modules/webaudio/MediaStreamAudioSourceNode.h:
+ * Modules/webaudio/OscillatorNode.cpp:
+ (WebCore::OscillatorNode::setType):
+ * Modules/webaudio/PannerNode.h:
+ (WebCore::PannerNode::create):
+ * Modules/webaudio/PeriodicWave.cpp:
+ (WebCore::PeriodicWave::create):
+ (WebCore::PeriodicWave::createSine):
+ (WebCore::PeriodicWave::createSquare):
+ (WebCore::PeriodicWave::createSawtooth):
+ (WebCore::PeriodicWave::createTriangle):
+ * Modules/webaudio/PeriodicWave.h:
+ * Modules/webaudio/ScriptProcessorNode.cpp:
+ (WebCore::ScriptProcessorNode::create):
+ * Modules/webaudio/ScriptProcessorNode.h:
+ * Modules/webaudio/WaveShaperNode.h:
+ (WebCore::WaveShaperNode::create):
+
2015-05-27 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r183820): webkit.org/blog/ background painting issue on reload, when the page contains videos
class SourceBufferList final : public RefCounted<SourceBufferList>, public ScriptWrappable, public EventTargetWithInlineData {
public:
- static PassRefPtr<SourceBufferList> create(ScriptExecutionContext* context)
+ static Ref<SourceBufferList> create(ScriptExecutionContext* context)
{
- return adoptRef(new SourceBufferList(context));
+ return adoptRef(*new SourceBufferList(context));
}
virtual ~SourceBufferList();
class AllAudioCapabilities : public MediaStreamCapabilities {
public:
- static RefPtr<AllAudioCapabilities> create(PassRefPtr<RealtimeMediaSourceCapabilities> capabilities)
+ static Ref<AllAudioCapabilities> create(PassRefPtr<RealtimeMediaSourceCapabilities> capabilities)
{
- return adoptRef(new AllAudioCapabilities(capabilities));
+ return adoptRef(*new AllAudioCapabilities(capabilities));
}
virtual ~AllAudioCapabilities() { }
class AllVideoCapabilities : public MediaStreamCapabilities {
public:
- static RefPtr<AllVideoCapabilities> create(PassRefPtr<RealtimeMediaSourceCapabilities> capabilities)
+ static Ref<AllVideoCapabilities> create(PassRefPtr<RealtimeMediaSourceCapabilities> capabilities)
{
- return adoptRef(new AllVideoCapabilities(capabilities));
+ return adoptRef(*new AllVideoCapabilities(capabilities));
}
virtual ~AllVideoCapabilities() { }
namespace WebCore {
-RefPtr<CapabilityRange> CapabilityRange::create(const RealtimeMediaSourceCapabilityRange& rangeInfo)
+Ref<CapabilityRange> CapabilityRange::create(const RealtimeMediaSourceCapabilityRange& rangeInfo)
{
- return adoptRef(new CapabilityRange(rangeInfo));
+ return adoptRef(*new CapabilityRange(rangeInfo));
}
CapabilityRange::CapabilityRange(const RealtimeMediaSourceCapabilityRange& rangeInfo)
public:
virtual ~CapabilityRange() { }
- static RefPtr<CapabilityRange> create(const RealtimeMediaSourceCapabilityRange&);
+ static Ref<CapabilityRange> create(const RealtimeMediaSourceCapabilityRange&);
Deprecated::ScriptValue min(JSC::ExecState*) const;
Deprecated::ScriptValue max(JSC::ExecState*) const;
namespace WebCore {
-RefPtr<MediaSourceStates> MediaSourceStates::create(const RealtimeMediaSourceStates& states)
+Ref<MediaSourceStates> MediaSourceStates::create(const RealtimeMediaSourceStates& states)
{
- return adoptRef(new MediaSourceStates(states));
+ return adoptRef(*new MediaSourceStates(states));
}
MediaSourceStates::MediaSourceStates(const RealtimeMediaSourceStates& states)
class MediaSourceStates : public RefCounted<MediaSourceStates>, public ScriptWrappable {
public:
- static RefPtr<MediaSourceStates> create(const RealtimeMediaSourceStates&);
+ static Ref<MediaSourceStates> create(const RealtimeMediaSourceStates&);
const AtomicString& sourceType() const;
const AtomicString& sourceId() const { return m_sourceStates.sourceId(); }
namespace WebCore {
-RefPtr<MediaStreamTrack> MediaStreamTrack::create(ScriptExecutionContext& context, MediaStreamTrackPrivate& privateTrack)
+Ref<MediaStreamTrack> MediaStreamTrack::create(ScriptExecutionContext& context, MediaStreamTrackPrivate& privateTrack)
{
- return adoptRef(new MediaStreamTrack(context, privateTrack));
+ return adoptRef(*new MediaStreamTrack(context, privateTrack));
}
-RefPtr<MediaStreamTrack> MediaStreamTrack::create(MediaStreamTrack& track)
+Ref<MediaStreamTrack> MediaStreamTrack::create(MediaStreamTrack& track)
{
- return adoptRef(new MediaStreamTrack(track));
+ return adoptRef(*new MediaStreamTrack(track));
}
MediaStreamTrack::MediaStreamTrack(ScriptExecutionContext& context, MediaStreamTrackPrivate& privateTrack)
virtual void trackDidEnd() = 0;
};
- static RefPtr<MediaStreamTrack> create(ScriptExecutionContext&, MediaStreamTrackPrivate&);
- static RefPtr<MediaStreamTrack> create(MediaStreamTrack&);
+ static Ref<MediaStreamTrack> create(ScriptExecutionContext&, MediaStreamTrackPrivate&);
+ static Ref<MediaStreamTrack> create(MediaStreamTrack&);
virtual ~MediaStreamTrack();
const AtomicString& kind() const;
namespace WebCore {
-PassRefPtr<MediaStreamTrackSourcesRequest> MediaStreamTrackSourcesRequest::create(ScriptExecutionContext* context, PassRefPtr<MediaStreamTrackSourcesCallback> callback)
+Ref<MediaStreamTrackSourcesRequest> MediaStreamTrackSourcesRequest::create(ScriptExecutionContext* context, PassRefPtr<MediaStreamTrackSourcesCallback> callback)
{
- return adoptRef(new MediaStreamTrackSourcesRequest(context, callback));
+ return adoptRef(*new MediaStreamTrackSourcesRequest(context, callback));
}
MediaStreamTrackSourcesRequest::MediaStreamTrackSourcesRequest(ScriptExecutionContext* context, PassRefPtr<MediaStreamTrackSourcesCallback> callback)
class MediaStreamTrackSourcesRequest : public MediaStreamTrackSourcesRequestClient {
public:
- static PassRefPtr<MediaStreamTrackSourcesRequest> create(ScriptExecutionContext*, PassRefPtr<MediaStreamTrackSourcesCallback>);
+ static Ref<MediaStreamTrackSourcesRequest> create(ScriptExecutionContext*, PassRefPtr<MediaStreamTrackSourcesCallback>);
virtual ~MediaStreamTrackSourcesRequest() { }
private:
namespace WebCore {
-RefPtr<MediaTrackConstraint> MediaTrackConstraint::create(const Dictionary& constraint)
+Ref<MediaTrackConstraint> MediaTrackConstraint::create(const Dictionary& constraint)
{
- return adoptRef(new MediaTrackConstraint(constraint));
+ return adoptRef(*new MediaTrackConstraint(constraint));
}
MediaTrackConstraint::MediaTrackConstraint(const Dictionary& constraint)
class MediaTrackConstraint : public RefCounted<MediaTrackConstraint>, public ScriptWrappable {
public:
- static RefPtr<MediaTrackConstraint> create(const Dictionary&);
+ static Ref<MediaTrackConstraint> create(const Dictionary&);
virtual ~MediaTrackConstraint();
namespace WebCore {
-RefPtr<MediaTrackConstraintSet> MediaTrackConstraintSet::create(const Dictionary& constraints)
+Ref<MediaTrackConstraintSet> MediaTrackConstraintSet::create(const Dictionary& constraints)
{
- return adoptRef(new MediaTrackConstraintSet(constraints));
+ return adoptRef(*new MediaTrackConstraintSet(constraints));
}
MediaTrackConstraintSet::MediaTrackConstraintSet(const Dictionary& constraints)
class MediaTrackConstraintSet : public RefCounted<MediaTrackConstraintSet>, public ScriptWrappable {
public:
- static RefPtr<MediaTrackConstraintSet> create(const Dictionary&);
+ static Ref<MediaTrackConstraintSet> create(const Dictionary&);
virtual ~MediaTrackConstraintSet();
namespace WebCore {
-RefPtr<MediaTrackConstraints> MediaTrackConstraints::create(PassRefPtr<MediaConstraintsImpl> constraints)
+Ref<MediaTrackConstraints> MediaTrackConstraints::create(PassRefPtr<MediaConstraintsImpl> constraints)
{
- return adoptRef(new MediaTrackConstraints(constraints));
+ return adoptRef(*new MediaTrackConstraints(constraints));
}
MediaTrackConstraints::MediaTrackConstraints(PassRefPtr<MediaConstraintsImpl> constraints)
public:
virtual ~MediaTrackConstraints() { }
- static RefPtr<MediaTrackConstraints> create(PassRefPtr<MediaConstraintsImpl>);
+ static Ref<MediaTrackConstraints> create(PassRefPtr<MediaConstraintsImpl>);
Vector<PassRefPtr<MediaTrackConstraint>> optional(bool) const;
RefPtr<MediaTrackConstraintSet> mandatory(bool) const;
class NavigatorUserMediaError : public DOMError {
public:
- static PassRefPtr<NavigatorUserMediaError> create(const String& name, const String& constraintName)
+ static Ref<NavigatorUserMediaError> create(const String& name, const String& constraintName)
{
- return adoptRef(new NavigatorUserMediaError(name, constraintName));
+ return adoptRef(*new NavigatorUserMediaError(name, constraintName));
}
virtual ~NavigatorUserMediaError() { }
class RTCConfiguration : public RefCounted<RTCConfiguration> {
public:
- static PassRefPtr<RTCConfiguration> create() { return adoptRef(new RTCConfiguration()); }
+ static Ref<RTCConfiguration> create() { return adoptRef(*new RTCConfiguration()); }
virtual ~RTCConfiguration() { }
void appendServer(PassRefPtr<RTCIceServer> server) { m_private->appendServer(server->privateServer()); }
class RTCIceServer : public RefCounted<RTCIceServer> {
public:
- static PassRefPtr<RTCIceServer> create(const Vector<String>& urls, const String& credential, const String& username)
+ static Ref<RTCIceServer> create(const Vector<String>& urls, const String& credential, const String& username)
{
- return adoptRef(new RTCIceServer(urls, credential, username));
+ return adoptRef(*new RTCIceServer(urls, credential, username));
}
- static PassRefPtr<RTCIceServer> create(PassRefPtr<RTCIceServerPrivate> server)
+ static Ref<RTCIceServer> create(PassRefPtr<RTCIceServerPrivate> server)
{
- return adoptRef(new RTCIceServer(server));
+ return adoptRef(*new RTCIceServer(server));
}
virtual ~RTCIceServer() { }
return type == "offer" || type == "pranswer" || type == "answer";
}
-PassRefPtr<RTCSessionDescription> RTCSessionDescription::create(const Dictionary& dictionary, ExceptionCode& ec)
+RefPtr<RTCSessionDescription> RTCSessionDescription::create(const Dictionary& dictionary, ExceptionCode& ec)
{
String type;
bool ok = dictionary.get("type", type);
return nullptr;
}
- return adoptRef(new RTCSessionDescription(RTCSessionDescriptionDescriptor::create(type, sdp)));
+ return adoptRef(*new RTCSessionDescription(RTCSessionDescriptionDescriptor::create(type, sdp)));
}
-PassRefPtr<RTCSessionDescription> RTCSessionDescription::create(PassRefPtr<RTCSessionDescriptionDescriptor> descriptor)
+RefPtr<RTCSessionDescription> RTCSessionDescription::create(PassRefPtr<RTCSessionDescriptionDescriptor> descriptor)
{
ASSERT(descriptor);
- return adoptRef(new RTCSessionDescription(descriptor));
+ return adoptRef(*new RTCSessionDescription(descriptor));
}
RTCSessionDescription::RTCSessionDescription(PassRefPtr<RTCSessionDescriptionDescriptor> descriptor)
class RTCSessionDescription : public RefCounted<RTCSessionDescription>, public ScriptWrappable {
public:
- static PassRefPtr<RTCSessionDescription> create(const Dictionary&, ExceptionCode&);
- static PassRefPtr<RTCSessionDescription> create(PassRefPtr<RTCSessionDescriptionDescriptor>);
+ static RefPtr<RTCSessionDescription> create(const Dictionary&, ExceptionCode&);
+ static RefPtr<RTCSessionDescription> create(PassRefPtr<RTCSessionDescriptionDescriptor>);
virtual ~RTCSessionDescription();
const String& type() const;
namespace WebCore {
-PassRefPtr<RTCSessionDescriptionRequestImpl> RTCSessionDescriptionRequestImpl::create(ScriptExecutionContext* context, PassRefPtr<RTCSessionDescriptionCallback> successCallback, PassRefPtr<RTCPeerConnectionErrorCallback> errorCallback)
+Ref<RTCSessionDescriptionRequestImpl> RTCSessionDescriptionRequestImpl::create(ScriptExecutionContext* context, PassRefPtr<RTCSessionDescriptionCallback> successCallback, PassRefPtr<RTCPeerConnectionErrorCallback> errorCallback)
{
- RefPtr<RTCSessionDescriptionRequestImpl> request = adoptRef(new RTCSessionDescriptionRequestImpl(context, successCallback, errorCallback));
+ Ref<RTCSessionDescriptionRequestImpl> request = adoptRef(*new RTCSessionDescriptionRequestImpl(context, successCallback, errorCallback));
request->suspendIfNeeded();
- return request.release();
+ return request;
}
RTCSessionDescriptionRequestImpl::RTCSessionDescriptionRequestImpl(ScriptExecutionContext* context, PassRefPtr<RTCSessionDescriptionCallback> successCallback, PassRefPtr<RTCPeerConnectionErrorCallback> errorCallback)
class RTCSessionDescriptionRequestImpl : public RTCSessionDescriptionRequest, public ActiveDOMObject {
public:
- static PassRefPtr<RTCSessionDescriptionRequestImpl> create(ScriptExecutionContext*, PassRefPtr<RTCSessionDescriptionCallback>, PassRefPtr<RTCPeerConnectionErrorCallback>);
+ static Ref<RTCSessionDescriptionRequestImpl> create(ScriptExecutionContext*, PassRefPtr<RTCSessionDescriptionCallback>, PassRefPtr<RTCPeerConnectionErrorCallback>);
virtual ~RTCSessionDescriptionRequestImpl();
virtual void requestSucceeded(PassRefPtr<RTCSessionDescriptionDescriptor>) override;
namespace WebCore {
-PassRefPtr<RTCStatsReport> RTCStatsReport::create(const String& id, const String& type, double timestamp)
+Ref<RTCStatsReport> RTCStatsReport::create(const String& id, const String& type, double timestamp)
{
- return adoptRef(new RTCStatsReport(id, type, timestamp));
+ return adoptRef(*new RTCStatsReport(id, type, timestamp));
}
RTCStatsReport::RTCStatsReport(const String& id, const String& type, double timestamp)
class RTCStatsReport : public RefCounted<RTCStatsReport>, public ScriptWrappable {
public:
- static PassRefPtr<RTCStatsReport> create(const String& id, const String& type, double timestamp);
+ static Ref<RTCStatsReport> create(const String& id, const String& type, double timestamp);
double timestamp() const { return m_timestamp; }
String id() { return m_id; }
namespace WebCore {
-PassRefPtr<RTCStatsRequestImpl> RTCStatsRequestImpl::create(ScriptExecutionContext* context, PassRefPtr<RTCStatsCallback> successCallback, PassRefPtr<RTCPeerConnectionErrorCallback> errorCallback, PassRefPtr<MediaStreamTrackPrivate> selector)
+Ref<RTCStatsRequestImpl> RTCStatsRequestImpl::create(ScriptExecutionContext* context, PassRefPtr<RTCStatsCallback> successCallback, PassRefPtr<RTCPeerConnectionErrorCallback> errorCallback, PassRefPtr<MediaStreamTrackPrivate> selector)
{
- RefPtr<RTCStatsRequestImpl> request = adoptRef(new RTCStatsRequestImpl(context, successCallback, errorCallback, selector));
+ Ref<RTCStatsRequestImpl> request = adoptRef(*new RTCStatsRequestImpl(context, successCallback, errorCallback, selector));
request->suspendIfNeeded();
- return request.release();
+ return request;
}
RTCStatsRequestImpl::RTCStatsRequestImpl(ScriptExecutionContext* context, PassRefPtr<RTCStatsCallback> successCallback, PassRefPtr<RTCPeerConnectionErrorCallback> errorCallback, PassRefPtr<MediaStreamTrackPrivate> selector)
class RTCStatsRequestImpl : public RTCStatsRequest, public ActiveDOMObject {
public:
- static PassRefPtr<RTCStatsRequestImpl> create(ScriptExecutionContext*, PassRefPtr<RTCStatsCallback>, PassRefPtr<RTCPeerConnectionErrorCallback>, PassRefPtr<MediaStreamTrackPrivate>);
+ static Ref<RTCStatsRequestImpl> create(ScriptExecutionContext*, PassRefPtr<RTCStatsCallback>, PassRefPtr<RTCPeerConnectionErrorCallback>, PassRefPtr<MediaStreamTrackPrivate>);
virtual ~RTCStatsRequestImpl();
virtual PassRefPtr<RTCStatsResponseBase> createResponse() override;
namespace WebCore {
-PassRefPtr<RTCStatsResponse> RTCStatsResponse::create()
+Ref<RTCStatsResponse> RTCStatsResponse::create()
{
- return adoptRef(new RTCStatsResponse());
+ return adoptRef(*new RTCStatsResponse());
}
RTCStatsResponse::RTCStatsResponse()
class RTCStatsResponse : public RTCStatsResponseBase, public ScriptWrappable {
public:
- static PassRefPtr<RTCStatsResponse> create();
+ static Ref<RTCStatsResponse> create();
const Vector<RefPtr<RTCStatsReport>>& result() const { return m_result; };
namespace WebCore {
-PassRefPtr<RTCVoidRequestImpl> RTCVoidRequestImpl::create(ScriptExecutionContext* context, PassRefPtr<VoidCallback> successCallback, PassRefPtr<RTCPeerConnectionErrorCallback> errorCallback)
+Ref<RTCVoidRequestImpl> RTCVoidRequestImpl::create(ScriptExecutionContext* context, PassRefPtr<VoidCallback> successCallback, PassRefPtr<RTCPeerConnectionErrorCallback> errorCallback)
{
- RefPtr<RTCVoidRequestImpl> request = adoptRef(new RTCVoidRequestImpl(context, successCallback, errorCallback));
+ Ref<RTCVoidRequestImpl> request = adoptRef(*new RTCVoidRequestImpl(context, successCallback, errorCallback));
request->suspendIfNeeded();
- return request.release();
+ return request;
}
RTCVoidRequestImpl::RTCVoidRequestImpl(ScriptExecutionContext* context, PassRefPtr<VoidCallback> successCallback, PassRefPtr<RTCPeerConnectionErrorCallback> errorCallback)
class RTCVoidRequestImpl : public RTCVoidRequest, public ActiveDOMObject {
public:
- static PassRefPtr<RTCVoidRequestImpl> create(ScriptExecutionContext*, PassRefPtr<VoidCallback>, PassRefPtr<RTCPeerConnectionErrorCallback>);
+ static Ref<RTCVoidRequestImpl> create(ScriptExecutionContext*, PassRefPtr<VoidCallback>, PassRefPtr<RTCPeerConnectionErrorCallback>);
virtual ~RTCVoidRequestImpl();
virtual void requestSucceeded() override;
namespace WebCore {
-PassRefPtr<SourceInfo> SourceInfo::create(PassRefPtr<TrackSourceInfo> trackSourceInfo)
+Ref<SourceInfo> SourceInfo::create(PassRefPtr<TrackSourceInfo> trackSourceInfo)
{
- return adoptRef(new SourceInfo(trackSourceInfo));
+ return adoptRef(*new SourceInfo(trackSourceInfo));
}
SourceInfo::SourceInfo(PassRefPtr<TrackSourceInfo> trackSourceInfo)
class SourceInfo : public RefCounted<SourceInfo>, public ScriptWrappable {
public:
- static PassRefPtr<SourceInfo> create(PassRefPtr<TrackSourceInfo>);
+ static Ref<SourceInfo> create(PassRefPtr<TrackSourceInfo>);
const AtomicString& sourceId() const { return m_trackSourceInfo->id(); }
const AtomicString& label() const { return m_trackSourceInfo->label(); }
return constraints.release();
}
-PassRefPtr<UserMediaRequest> UserMediaRequest::create(ScriptExecutionContext* context, UserMediaController* controller, const Dictionary& options, PassRefPtr<NavigatorUserMediaSuccessCallback> successCallback, PassRefPtr<NavigatorUserMediaErrorCallback> errorCallback, ExceptionCode& ec)
+RefPtr<UserMediaRequest> UserMediaRequest::create(ScriptExecutionContext* context, UserMediaController* controller, const Dictionary& options, PassRefPtr<NavigatorUserMediaSuccessCallback> successCallback, PassRefPtr<NavigatorUserMediaErrorCallback> errorCallback, ExceptionCode& ec)
{
ASSERT(successCallback);
return UserMediaRequest::create(context, controller, options, WTF::move(resolveCallback), WTF::move(rejectCallback), ec);
}
-PassRefPtr<UserMediaRequest> UserMediaRequest::create(ScriptExecutionContext* context, UserMediaController* controller, const Dictionary& options, MediaDevices::ResolveCallback resolveCallback, MediaDevices::RejectCallback rejectCallback, ExceptionCode& ec)
+RefPtr<UserMediaRequest> UserMediaRequest::create(ScriptExecutionContext* context, UserMediaController* controller, const Dictionary& options, MediaDevices::ResolveCallback resolveCallback, MediaDevices::RejectCallback rejectCallback, ExceptionCode& ec)
{
ASSERT(resolveCallback && rejectCallback);
if (!audioConstraints && !videoConstraints)
return nullptr;
- return adoptRef(new UserMediaRequest(context, controller, audioConstraints.release(), videoConstraints.release(), WTF::move(resolveCallback), WTF::move(rejectCallback)));
+ return adoptRef(*new UserMediaRequest(context, controller, audioConstraints.release(), videoConstraints.release(), WTF::move(resolveCallback), WTF::move(rejectCallback)));
}
UserMediaRequest::UserMediaRequest(ScriptExecutionContext* context, UserMediaController* controller, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints, MediaDevices::ResolveCallback resolveCallback, MediaDevices::RejectCallback rejectCallback)
class UserMediaRequest : public MediaStreamCreationClient, public ContextDestructionObserver {
public:
- static PassRefPtr<UserMediaRequest> create(ScriptExecutionContext*, UserMediaController*, const Dictionary& options, PassRefPtr<NavigatorUserMediaSuccessCallback>, PassRefPtr<NavigatorUserMediaErrorCallback>, ExceptionCode&);
- static PassRefPtr<UserMediaRequest> create(ScriptExecutionContext*, UserMediaController*, const Dictionary& options, MediaDevices::ResolveCallback, MediaDevices::RejectCallback, ExceptionCode&);
+ static RefPtr<UserMediaRequest> create(ScriptExecutionContext*, UserMediaController*, const Dictionary& options, PassRefPtr<NavigatorUserMediaSuccessCallback>, PassRefPtr<NavigatorUserMediaErrorCallback>, ExceptionCode&);
+ static RefPtr<UserMediaRequest> create(ScriptExecutionContext*, UserMediaController*, const Dictionary& options, MediaDevices::ResolveCallback, MediaDevices::RejectCallback, ExceptionCode&);
~UserMediaRequest();
WEBCORE_EXPORT SecurityOrigin* securityOrigin() const;
PERSISTENT,
};
- static PassRefPtr<StorageInfo> create()
+ static Ref<StorageInfo> create()
{
- return adoptRef(new StorageInfo());
+ return adoptRef(*new StorageInfo());
}
void queryUsageAndQuota(ScriptExecutionContext*, int storageType, PassRefPtr<StorageUsageCallback>, PassRefPtr<StorageErrorCallback>);
Persistent,
};
- static PassRefPtr<StorageQuota> create(Type type)
+ static Ref<StorageQuota> create(Type type)
{
- return adoptRef(new StorageQuota(type));
+ return adoptRef(*new StorageQuota(type));
}
void queryUsageAndQuota(ScriptExecutionContext*, PassRefPtr<StorageUsageCallback>, PassRefPtr<StorageErrorCallback>);
namespace WebCore {
-PassRefPtr<SpeechSynthesis> SpeechSynthesis::create()
+Ref<SpeechSynthesis> SpeechSynthesis::create()
{
- return adoptRef(new SpeechSynthesis);
+ return adoptRef(*new SpeechSynthesis);
}
SpeechSynthesis::SpeechSynthesis()
class SpeechSynthesis : public PlatformSpeechSynthesizerClient, public RefCounted<SpeechSynthesis> {
public:
- static PassRefPtr<SpeechSynthesis> create();
+ static Ref<SpeechSynthesis> create();
bool pending() const;
bool speaking() const;
namespace WebCore {
-PassRefPtr<SpeechSynthesisUtterance> SpeechSynthesisUtterance::create(ScriptExecutionContext& context, const String& text)
+Ref<SpeechSynthesisUtterance> SpeechSynthesisUtterance::create(ScriptExecutionContext& context, const String& text)
{
- return adoptRef(new SpeechSynthesisUtterance(context, text));
+ return adoptRef(*new SpeechSynthesisUtterance(context, text));
}
SpeechSynthesisUtterance::SpeechSynthesisUtterance(ScriptExecutionContext& context, const String& text)
class SpeechSynthesisUtterance final : public PlatformSpeechSynthesisUtteranceClient, public RefCounted<SpeechSynthesisUtterance>, public ContextDestructionObserver, public EventTargetWithInlineData {
public:
- static PassRefPtr<SpeechSynthesisUtterance> create(ScriptExecutionContext&, const String&);
+ static Ref<SpeechSynthesisUtterance> create(ScriptExecutionContext&, const String&);
~SpeechSynthesisUtterance();
namespace WebCore {
-PassRefPtr<SpeechSynthesisVoice> SpeechSynthesisVoice::create(PassRefPtr<PlatformSpeechSynthesisVoice> voice)
+Ref<SpeechSynthesisVoice> SpeechSynthesisVoice::create(PassRefPtr<PlatformSpeechSynthesisVoice> voice)
{
- return adoptRef(new SpeechSynthesisVoice(voice));
+ return adoptRef(*new SpeechSynthesisVoice(voice));
}
SpeechSynthesisVoice::SpeechSynthesisVoice(PassRefPtr<PlatformSpeechSynthesisVoice> voice)
class SpeechSynthesisVoice : public RefCounted<SpeechSynthesisVoice> {
public:
virtual ~SpeechSynthesisVoice() { }
- static PassRefPtr<SpeechSynthesisVoice> create(PassRefPtr<PlatformSpeechSynthesisVoice>);
+ static Ref<SpeechSynthesisVoice> create(PassRefPtr<PlatformSpeechSynthesisVoice>);
const String& voiceURI() const { return m_platformVoice->voiceURI(); }
const String& name() const { return m_platformVoice->name(); }
namespace WebCore {
-PassRefPtr<ChannelMergerNode> ChannelMergerNode::create(AudioContext* context, float sampleRate, unsigned numberOfInputs)
+RefPtr<ChannelMergerNode> ChannelMergerNode::create(AudioContext* context, float sampleRate, unsigned numberOfInputs)
{
if (!numberOfInputs || numberOfInputs > AudioContext::maxNumberOfChannels())
return nullptr;
- return adoptRef(new ChannelMergerNode(context, sampleRate, numberOfInputs));
+ return adoptRef(*new ChannelMergerNode(context, sampleRate, numberOfInputs));
}
ChannelMergerNode::ChannelMergerNode(AudioContext* context, float sampleRate, unsigned numberOfInputs)
class ChannelMergerNode : public AudioNode {
public:
- static PassRefPtr<ChannelMergerNode> create(AudioContext*, float sampleRate, unsigned numberOfInputs);
+ static RefPtr<ChannelMergerNode> create(AudioContext*, float sampleRate, unsigned numberOfInputs);
// AudioNode
virtual void process(size_t framesToProcess) override;
namespace WebCore {
-PassRefPtr<ChannelSplitterNode> ChannelSplitterNode::create(AudioContext* context, float sampleRate, unsigned numberOfOutputs)
+RefPtr<ChannelSplitterNode> ChannelSplitterNode::create(AudioContext* context, float sampleRate, unsigned numberOfOutputs)
{
if (!numberOfOutputs || numberOfOutputs > AudioContext::maxNumberOfChannels())
return nullptr;
- return adoptRef(new ChannelSplitterNode(context, sampleRate, numberOfOutputs));
+ return adoptRef(*new ChannelSplitterNode(context, sampleRate, numberOfOutputs));
}
ChannelSplitterNode::ChannelSplitterNode(AudioContext* context, float sampleRate, unsigned numberOfOutputs)
class ChannelSplitterNode : public AudioNode {
public:
- static PassRefPtr<ChannelSplitterNode> create(AudioContext*, float sampleRate, unsigned numberOfOutputs);
+ static RefPtr<ChannelSplitterNode> create(AudioContext*, float sampleRate, unsigned numberOfOutputs);
// AudioNode
virtual void process(size_t framesToProcess) override;
class DefaultAudioDestinationNode : public AudioDestinationNode {
public:
- static PassRefPtr<DefaultAudioDestinationNode> create(AudioContext* context)
+ static Ref<DefaultAudioDestinationNode> create(AudioContext* context)
{
- return adoptRef(new DefaultAudioDestinationNode(context));
+ return adoptRef(*new DefaultAudioDestinationNode(context));
}
virtual ~DefaultAudioDestinationNode();
class GainNode : public AudioNode {
public:
- static PassRefPtr<GainNode> create(AudioContext* context, float sampleRate)
+ static Ref<GainNode> create(AudioContext* context, float sampleRate)
{
- return adoptRef(new GainNode(context, sampleRate));
+ return adoptRef(*new GainNode(context, sampleRate));
}
// AudioNode
namespace WebCore {
-PassRefPtr<MediaElementAudioSourceNode> MediaElementAudioSourceNode::create(AudioContext* context, HTMLMediaElement* mediaElement)
+Ref<MediaElementAudioSourceNode> MediaElementAudioSourceNode::create(AudioContext* context, HTMLMediaElement* mediaElement)
{
- return adoptRef(new MediaElementAudioSourceNode(context, mediaElement));
+ return adoptRef(*new MediaElementAudioSourceNode(context, mediaElement));
}
MediaElementAudioSourceNode::MediaElementAudioSourceNode(AudioContext* context, HTMLMediaElement* mediaElement)
class MediaElementAudioSourceNode : public AudioNode, public AudioSourceProviderClient {
public:
- static PassRefPtr<MediaElementAudioSourceNode> create(AudioContext*, HTMLMediaElement*);
+ static Ref<MediaElementAudioSourceNode> create(AudioContext*, HTMLMediaElement*);
virtual ~MediaElementAudioSourceNode();
namespace WebCore {
-PassRefPtr<MediaStreamAudioDestinationNode> MediaStreamAudioDestinationNode::create(AudioContext* context, size_t numberOfChannels)
+Ref<MediaStreamAudioDestinationNode> MediaStreamAudioDestinationNode::create(AudioContext* context, size_t numberOfChannels)
{
- return adoptRef(new MediaStreamAudioDestinationNode(context, numberOfChannels));
+ return adoptRef(*new MediaStreamAudioDestinationNode(context, numberOfChannels));
}
MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode(AudioContext* context, size_t numberOfChannels)
class MediaStreamAudioDestinationNode : public AudioBasicInspectorNode {
public:
- static PassRefPtr<MediaStreamAudioDestinationNode> create(AudioContext*, size_t numberOfChannels);
+ static Ref<MediaStreamAudioDestinationNode> create(AudioContext*, size_t numberOfChannels);
virtual ~MediaStreamAudioDestinationNode();
namespace WebCore {
-RefPtr<MediaStreamAudioSource> MediaStreamAudioSource::create()
+Ref<MediaStreamAudioSource> MediaStreamAudioSource::create()
{
- return adoptRef(new MediaStreamAudioSource());
+ return adoptRef(*new MediaStreamAudioSource());
}
MediaStreamAudioSource::MediaStreamAudioSource()
class MediaStreamAudioSource : public RealtimeMediaSource {
public:
- static RefPtr<MediaStreamAudioSource> create();
+ static Ref<MediaStreamAudioSource> create();
~MediaStreamAudioSource() { }
namespace WebCore {
-PassRefPtr<MediaStreamAudioSourceNode> MediaStreamAudioSourceNode::create(AudioContext* context, MediaStream* mediaStream, MediaStreamTrack* audioTrack, AudioSourceProvider* audioSourceProvider)
+Ref<MediaStreamAudioSourceNode> MediaStreamAudioSourceNode::create(AudioContext* context, MediaStream* mediaStream, MediaStreamTrack* audioTrack, AudioSourceProvider* audioSourceProvider)
{
- return adoptRef(new MediaStreamAudioSourceNode(context, mediaStream, audioTrack, audioSourceProvider));
+ return adoptRef(*new MediaStreamAudioSourceNode(context, mediaStream, audioTrack, audioSourceProvider));
}
MediaStreamAudioSourceNode::MediaStreamAudioSourceNode(AudioContext* context, MediaStream* mediaStream, MediaStreamTrack* audioTrack, AudioSourceProvider* audioSourceProvider)
class MediaStreamAudioSourceNode : public AudioNode, public AudioSourceProviderClient {
public:
- static PassRefPtr<MediaStreamAudioSourceNode> create(AudioContext*, MediaStream*, MediaStreamTrack*, AudioSourceProvider*);
+ static Ref<MediaStreamAudioSourceNode> create(AudioContext*, MediaStream*, MediaStreamTrack*, AudioSourceProvider*);
virtual ~MediaStreamAudioSourceNode();
switch (type) {
case SINE:
if (!s_periodicWaveSine)
- s_periodicWaveSine = PeriodicWave::createSine(sampleRate).leakRef();
+ s_periodicWaveSine = &PeriodicWave::createSine(sampleRate).leakRef();
periodicWave = s_periodicWaveSine;
break;
case SQUARE:
if (!s_periodicWaveSquare)
- s_periodicWaveSquare = PeriodicWave::createSquare(sampleRate).leakRef();
+ s_periodicWaveSquare = &PeriodicWave::createSquare(sampleRate).leakRef();
periodicWave = s_periodicWaveSquare;
break;
case SAWTOOTH:
if (!s_periodicWaveSawtooth)
- s_periodicWaveSawtooth = PeriodicWave::createSawtooth(sampleRate).leakRef();
+ s_periodicWaveSawtooth = &PeriodicWave::createSawtooth(sampleRate).leakRef();
periodicWave = s_periodicWaveSawtooth;
break;
case TRIANGLE:
if (!s_periodicWaveTriangle)
- s_periodicWaveTriangle = PeriodicWave::createTriangle(sampleRate).leakRef();
+ s_periodicWaveTriangle = &PeriodicWave::createTriangle(sampleRate).leakRef();
periodicWave = s_periodicWaveTriangle;
break;
case CUSTOM:
EXPONENTIAL_DISTANCE = 2,
};
- static PassRefPtr<PannerNode> create(AudioContext* context, float sampleRate)
+ static Ref<PannerNode> create(AudioContext* context, float sampleRate)
{
- return adoptRef(new PannerNode(context, sampleRate));
+ return adoptRef(*new PannerNode(context, sampleRate));
}
virtual ~PannerNode();
using namespace VectorMath;
-PassRefPtr<PeriodicWave> PeriodicWave::create(float sampleRate, Float32Array* real, Float32Array* imag)
+RefPtr<PeriodicWave> PeriodicWave::create(float sampleRate, Float32Array* real, Float32Array* imag)
{
bool isGood = real && imag && real->length() == imag->length();
ASSERT(isGood);
return nullptr;
}
-PassRefPtr<PeriodicWave> PeriodicWave::createSine(float sampleRate)
+Ref<PeriodicWave> PeriodicWave::createSine(float sampleRate)
{
- RefPtr<PeriodicWave> waveTable = adoptRef(new PeriodicWave(sampleRate));
+ Ref<PeriodicWave> waveTable = adoptRef(*new PeriodicWave(sampleRate));
waveTable->generateBasicWaveform(OscillatorNode::SINE);
return waveTable;
}
-PassRefPtr<PeriodicWave> PeriodicWave::createSquare(float sampleRate)
+Ref<PeriodicWave> PeriodicWave::createSquare(float sampleRate)
{
- RefPtr<PeriodicWave> waveTable = adoptRef(new PeriodicWave(sampleRate));
+ Ref<PeriodicWave> waveTable = adoptRef(*new PeriodicWave(sampleRate));
waveTable->generateBasicWaveform(OscillatorNode::SQUARE);
return waveTable;
}
-PassRefPtr<PeriodicWave> PeriodicWave::createSawtooth(float sampleRate)
+Ref<PeriodicWave> PeriodicWave::createSawtooth(float sampleRate)
{
- RefPtr<PeriodicWave> waveTable = adoptRef(new PeriodicWave(sampleRate));
+ Ref<PeriodicWave> waveTable = adoptRef(*new PeriodicWave(sampleRate));
waveTable->generateBasicWaveform(OscillatorNode::SAWTOOTH);
return waveTable;
}
-PassRefPtr<PeriodicWave> PeriodicWave::createTriangle(float sampleRate)
+Ref<PeriodicWave> PeriodicWave::createTriangle(float sampleRate)
{
- RefPtr<PeriodicWave> waveTable = adoptRef(new PeriodicWave(sampleRate));
+ Ref<PeriodicWave> waveTable = adoptRef(*new PeriodicWave(sampleRate));
waveTable->generateBasicWaveform(OscillatorNode::TRIANGLE);
return waveTable;
}
class PeriodicWave : public RefCounted<PeriodicWave> {
public:
- static PassRefPtr<PeriodicWave> createSine(float sampleRate);
- static PassRefPtr<PeriodicWave> createSquare(float sampleRate);
- static PassRefPtr<PeriodicWave> createSawtooth(float sampleRate);
- static PassRefPtr<PeriodicWave> createTriangle(float sampleRate);
+ static Ref<PeriodicWave> createSine(float sampleRate);
+ static Ref<PeriodicWave> createSquare(float sampleRate);
+ static Ref<PeriodicWave> createSawtooth(float sampleRate);
+ static Ref<PeriodicWave> createTriangle(float sampleRate);
// Creates an arbitrary wave given the frequency components (Fourier coefficients).
- static PassRefPtr<PeriodicWave> create(float sampleRate, Float32Array* real, Float32Array* imag);
+ static RefPtr<PeriodicWave> create(float sampleRate, Float32Array* real, Float32Array* imag);
// Returns pointers to the lower and higher wave data for the pitch range containing
// the given fundamental frequency. These two tables are in adjacent "pitch" ranges
namespace WebCore {
-PassRefPtr<ScriptProcessorNode> ScriptProcessorNode::create(AudioContext* context, float sampleRate, size_t bufferSize, unsigned numberOfInputChannels, unsigned numberOfOutputChannels)
+RefPtr<ScriptProcessorNode> ScriptProcessorNode::create(AudioContext* context, float sampleRate, size_t bufferSize, unsigned numberOfInputChannels, unsigned numberOfOutputChannels)
{
// Check for valid buffer size.
switch (bufferSize) {
if (numberOfOutputChannels > AudioContext::maxNumberOfChannels())
return nullptr;
- return adoptRef(new ScriptProcessorNode(context, sampleRate, bufferSize, numberOfInputChannels, numberOfOutputChannels));
+ return adoptRef(*new ScriptProcessorNode(context, sampleRate, bufferSize, numberOfInputChannels, numberOfOutputChannels));
}
ScriptProcessorNode::ScriptProcessorNode(AudioContext* context, float sampleRate, size_t bufferSize, unsigned numberOfInputChannels, unsigned numberOfOutputChannels)
// This value controls how frequently the onaudioprocess event handler is called and how many sample-frames need to be processed each call.
// Lower numbers for bufferSize will result in a lower (better) latency. Higher numbers will be necessary to avoid audio breakup and glitches.
// The value chosen must carefully balance between latency and audio quality.
- static PassRefPtr<ScriptProcessorNode> create(AudioContext*, float sampleRate, size_t bufferSize, unsigned numberOfInputChannels, unsigned numberOfOutputChannels);
+ static RefPtr<ScriptProcessorNode> create(AudioContext*, float sampleRate, size_t bufferSize, unsigned numberOfInputChannels, unsigned numberOfOutputChannels);
virtual ~ScriptProcessorNode();
class WaveShaperNode : public AudioBasicProcessorNode {
public:
- static PassRefPtr<WaveShaperNode> create(AudioContext* context)
+ static Ref<WaveShaperNode> create(AudioContext* context)
{
- return adoptRef(new WaveShaperNode(context));
+ return adoptRef(*new WaveShaperNode(context));
}
// setCurve() is called on the main thread.