| Index: Source/modules/mediastream/MediaStream.cpp
|
| diff --git a/Source/modules/mediastream/MediaStream.cpp b/Source/modules/mediastream/MediaStream.cpp
|
| index 5d2ead7ab3ab2db473c81e5e1a60c45136a8c904..50dd4d92aad62ccdebd5d7e9c8d0b78a0582a30b 100644
|
| --- a/Source/modules/mediastream/MediaStream.cpp
|
| +++ b/Source/modules/mediastream/MediaStream.cpp
|
| @@ -36,6 +36,8 @@
|
|
|
| namespace WebCore {
|
|
|
| +DEFINE_GC_INFO(MediaStream);
|
| +
|
| static bool containsSource(MediaStreamSourceVector& sourceVector, MediaStreamSource* source)
|
| {
|
| for (size_t i = 0; i < sourceVector.size(); ++i) {
|
| @@ -55,7 +57,7 @@ static void processTrack(MediaStreamTrack* track, MediaStreamSourceVector& sourc
|
| sourceVector.append(source);
|
| }
|
|
|
| -static PassRefPtr<MediaStream> createFromSourceVectors(ExecutionContext* context, const MediaStreamSourceVector& audioSources, const MediaStreamSourceVector& videoSources)
|
| +static PassRefPtrWillBeRawPtr<MediaStream> createFromSourceVectors(ExecutionContext* context, const MediaStreamSourceVector& audioSources, const MediaStreamSourceVector& videoSources)
|
| {
|
| RefPtr<MediaStreamDescriptor> descriptor = MediaStreamDescriptor::create(audioSources, videoSources);
|
| MediaStreamCenter::instance().didCreateMediaStream(descriptor.get());
|
| @@ -63,7 +65,7 @@ static PassRefPtr<MediaStream> createFromSourceVectors(ExecutionContext* context
|
| return MediaStream::create(context, descriptor.release());
|
| }
|
|
|
| -PassRefPtr<MediaStream> MediaStream::create(ExecutionContext* context)
|
| +PassRefPtrWillBeRawPtr<MediaStream> MediaStream::create(ExecutionContext* context)
|
| {
|
| MediaStreamSourceVector audioSources;
|
| MediaStreamSourceVector videoSources;
|
| @@ -71,7 +73,7 @@ PassRefPtr<MediaStream> MediaStream::create(ExecutionContext* context)
|
| return createFromSourceVectors(context, audioSources, videoSources);
|
| }
|
|
|
| -PassRefPtr<MediaStream> MediaStream::create(ExecutionContext* context, PassRefPtr<MediaStream> stream)
|
| +PassRefPtrWillBeRawPtr<MediaStream> MediaStream::create(ExecutionContext* context, PassRefPtrWillBeRawPtr<MediaStream> stream)
|
| {
|
| ASSERT(stream);
|
|
|
| @@ -87,7 +89,7 @@ PassRefPtr<MediaStream> MediaStream::create(ExecutionContext* context, PassRefPt
|
| return createFromSourceVectors(context, audioSources, videoSources);
|
| }
|
|
|
| -PassRefPtr<MediaStream> MediaStream::create(ExecutionContext* context, const MediaStreamTrackVector& tracks)
|
| +PassRefPtrWillBeRawPtr<MediaStream> MediaStream::create(ExecutionContext* context, const MediaStreamTrackVector& tracks)
|
| {
|
| MediaStreamSourceVector audioSources;
|
| MediaStreamSourceVector videoSources;
|
| @@ -98,9 +100,9 @@ PassRefPtr<MediaStream> MediaStream::create(ExecutionContext* context, const Med
|
| return createFromSourceVectors(context, audioSources, videoSources);
|
| }
|
|
|
| -PassRefPtr<MediaStream> MediaStream::create(ExecutionContext* context, PassRefPtr<MediaStreamDescriptor> streamDescriptor)
|
| +PassRefPtrWillBeRawPtr<MediaStream> MediaStream::create(ExecutionContext* context, PassRefPtr<MediaStreamDescriptor> streamDescriptor)
|
| {
|
| - return adoptRef(new MediaStream(context, streamDescriptor));
|
| + return adoptRefCountedWillBeRefCountedGarbageCollected(new MediaStream(context, streamDescriptor));
|
| }
|
|
|
| MediaStream::MediaStream(ExecutionContext* context, PassRefPtr<MediaStreamDescriptor> streamDescriptor)
|
| @@ -133,7 +135,7 @@ bool MediaStream::ended() const
|
| return m_stopped || m_descriptor->ended();
|
| }
|
|
|
| -void MediaStream::addTrack(PassRefPtr<MediaStreamTrack> prpTrack, ExceptionState& exceptionState)
|
| +void MediaStream::addTrack(PassRefPtrWillBeRawPtr<MediaStreamTrack> prpTrack, ExceptionState& exceptionState)
|
| {
|
| if (ended()) {
|
| exceptionState.throwDOMException(InvalidStateError, "The MediaStream is finished.");
|
| @@ -145,13 +147,13 @@ void MediaStream::addTrack(PassRefPtr<MediaStreamTrack> prpTrack, ExceptionState
|
| return;
|
| }
|
|
|
| - RefPtr<MediaStreamTrack> track = prpTrack;
|
| + RefPtrWillBeRawPtr<MediaStreamTrack> track = prpTrack;
|
|
|
| if (getTrackById(track->id()))
|
| return;
|
|
|
| RefPtr<MediaStreamComponent> component = MediaStreamComponent::create(m_descriptor.get(), track->component()->source());
|
| - RefPtr<MediaStreamTrack> newTrack = MediaStreamTrack::create(executionContext(), component.get());
|
| + RefPtrWillBeRawPtr<MediaStreamTrack> newTrack = MediaStreamTrack::create(executionContext(), component.get());
|
|
|
| switch (component->source()->type()) {
|
| case MediaStreamSource::TypeAudio:
|
| @@ -167,7 +169,7 @@ void MediaStream::addTrack(PassRefPtr<MediaStreamTrack> prpTrack, ExceptionState
|
| MediaStreamCenter::instance().didAddMediaStreamTrack(m_descriptor.get(), newTrack->component());
|
| }
|
|
|
| -void MediaStream::removeTrack(PassRefPtr<MediaStreamTrack> prpTrack, ExceptionState& exceptionState)
|
| +void MediaStream::removeTrack(PassRefPtrWillBeRawPtr<MediaStreamTrack> prpTrack, ExceptionState& exceptionState)
|
| {
|
| if (ended()) {
|
| exceptionState.throwDOMException(InvalidStateError, "The MediaStream is finished.");
|
| @@ -179,7 +181,7 @@ void MediaStream::removeTrack(PassRefPtr<MediaStreamTrack> prpTrack, ExceptionSt
|
| return;
|
| }
|
|
|
| - RefPtr<MediaStreamTrack> track = prpTrack;
|
| + RefPtrWillBeRawPtr<MediaStreamTrack> track = prpTrack;
|
|
|
| size_t pos = kNotFound;
|
| switch (track->component()->source()->type()) {
|
| @@ -277,7 +279,7 @@ void MediaStream::addRemoteTrack(MediaStreamComponent* component)
|
|
|
| component->setStream(descriptor());
|
|
|
| - RefPtr<MediaStreamTrack> track = MediaStreamTrack::create(executionContext(), component);
|
| + RefPtrWillBeRawPtr<MediaStreamTrack> track = MediaStreamTrack::create(executionContext(), component);
|
| switch (component->source()->type()) {
|
| case MediaStreamSource::TypeAudio:
|
| m_audioTracks.append(track);
|
| @@ -318,7 +320,7 @@ void MediaStream::removeRemoteTrack(MediaStreamComponent* component)
|
|
|
| m_descriptor->removeComponent(component);
|
|
|
| - RefPtr<MediaStreamTrack> track = (*tracks)[index];
|
| + RefPtrWillBeRawPtr<MediaStreamTrack> track = (*tracks)[index];
|
| tracks->remove(index);
|
| scheduleDispatchEvent(MediaStreamTrackEvent::create(EventTypeNames::removetrack, false, false, track));
|
| }
|
|
|