Source/WebCore/ChangeLog

 12016-07-30 Gyuyoung Kim <gyuyoung.kim@webkit.org>
 2
 3 Purge all uses of PassRefPtr in WebCore/Modules
 4 https://bugs.webkit.org/show_bug.cgi?id=159965
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Final clean up in Modules directory.
 9
 10 No new tests, no behavior changes.
 11
 12 * Modules/gamepad/deprecated/GamepadList.cpp:
 13 (WebCore::GamepadList::set):
 14 * Modules/gamepad/deprecated/GamepadList.h:
 15 * Modules/indexeddb/IDBGetResult.h:
 16 (WebCore::IDBGetResult::IDBGetResult):
 17 * Modules/indieui/UIRequestEvent.cpp:
 18 (WebCore::UIRequestEvent::create):
 19 (WebCore::UIRequestEvent::UIRequestEvent):
 20 * Modules/indieui/UIRequestEvent.h:
 21 (WebCore::UIRequestEvent::receiver):
 22 * Modules/mediasource/MediaSourceRegistry.h:
 23 * Modules/mediasource/SampleMap.cpp:
 24 (WebCore::SampleMap::addSample):
 25 * Modules/mediasource/SampleMap.h:
 26 (WebCore::SampleMap::addRange):
 27 * Modules/mediasource/SourceBuffer.cpp:
 28 (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
 29 (WebCore::SourceBuffer::textTrackAddCue):
 30 (WebCore::SourceBuffer::textTrackRemoveCue):
 31 * Modules/mediasource/SourceBuffer.h:
 32 * Modules/mediastream/CaptureDeviceManager.cpp:
 33 (CaptureDeviceManager::bestSourcesForTypeAndConstraints):
 34 * Modules/mediastream/CaptureDeviceManager.h:
 35 * Modules/mediastream/MediaDevicesRequest.h:
 36 * Modules/mediastream/MediaStream.cpp:
 37 (WebCore::MediaStream::internalAddTrack):
 38 (WebCore::MediaStream::internalRemoveTrack):
 39 * Modules/mediastream/MediaStreamRegistry.h:
 40 * Modules/mediastream/MediaStreamTrackEvent.cpp:
 41 (WebCore::MediaStreamTrackEvent::create):
 42 (WebCore::MediaStreamTrackEvent::MediaStreamTrackEvent):
 43 (WebCore::MediaStreamTrackEvent::track):
 44 * Modules/mediastream/MediaStreamTrackEvent.h:
 45 * Modules/mediastream/MediaTrackConstraints.cpp:
 46 (WebCore::MediaTrackConstraints::create):
 47 (WebCore::MediaTrackConstraints::MediaTrackConstraints):
 48 (WebCore::MediaTrackConstraints::optional):
 49 * Modules/mediastream/MediaTrackConstraints.h:
 50 * Modules/mediastream/RTCDTMFSender.cpp:
 51 (WebCore::RTCDTMFSender::create):
 52 (WebCore::RTCDTMFSender::RTCDTMFSender):
 53 * Modules/mediastream/RTCDTMFSender.h:
 54 * Modules/mediastream/RTCDataChannelEvent.cpp:
 55 (WebCore::RTCDataChannelEvent::create):
 56 (WebCore::RTCDataChannelEvent::RTCDataChannelEvent):
 57 (WebCore::RTCDataChannelEvent::channel):
 58 * Modules/mediastream/RTCDataChannelEvent.h:
 59 * Modules/mediastream/RTCIceServer.h:
 60 * Modules/mediastream/RTCStatsReport.h:
 61 * Modules/mediastream/SourceInfo.cpp:
 62 (WebCore::SourceInfo::create):
 63 (WebCore::SourceInfo::SourceInfo):
 64 * Modules/mediastream/SourceInfo.h:
 65 * Modules/mediastream/UserMediaClient.h:
 66 * Modules/mediastream/UserMediaRequest.cpp:
 67 (WebCore::UserMediaRequest::UserMediaRequest):
 68 (WebCore::UserMediaRequest::didCreateStream):
 69 * Modules/mediastream/UserMediaRequest.h:
 70 * Modules/webdatabase/Database.cpp:
 71 (WebCore::Database::~Database):
 72 * html/HTMLMediaElement.cpp:
 73 (WebCore::HTMLMediaElement::textTrackAddCue):
 74 (WebCore::HTMLMediaElement::textTrackRemoveCue):
 75 * html/HTMLMediaElement.h:
 76 * html/HTMLTrackElement.cpp:
 77 (WebCore::HTMLTrackElement::textTrackAddCue):
 78 (WebCore::HTMLTrackElement::textTrackRemoveCue):
 79 * html/HTMLTrackElement.h:
 80 * html/track/TextTrack.h:
 81 * platform/graphics/SourceBufferPrivateClient.h:
 82 * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
 83 (WebCore::SourceBufferPrivateAVFObjC::processCodedFrame):
 84 * platform/mediastream/MediaStreamCreationClient.h:
 85 * platform/mediastream/mac/AVCaptureDeviceManager.h:
 86 * platform/mediastream/mac/AVCaptureDeviceManager.mm:
 87 (WebCore::AVCaptureDeviceManager::bestSourcesForTypeAndConstraints):
 88 * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
 89 (WebCore::RealtimeMediaSourceCenterMac::validateRequestConstraints):
 90 * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
 91 (WebCore::MockSourceBufferPrivate::didReceiveSample):
 92
1932016-08-04 Michael Catanzaro <mcatanzaro@igalia.com>
294
395 [Fontconfig] Segmentation fault in WebCore::FontCache::lastResortFallbackFont

Source/WebCore/Modules/gamepad/deprecated/GamepadList.cpp

@@GamepadList::~GamepadList()
3636{
3737}
3838
39 void GamepadList::set(unsigned index, PassRefPtr<Gamepad> gamepad)
 39void GamepadList::set(unsigned index, RefPtr<Gamepad>&& gamepad)
4040{
4141 if (index >= kMaximumGamepads)
4242 return;
43  m_items[index] = gamepad;
 43 m_items[index] = WTFMove(gamepad);
4444}
4545
4646unsigned GamepadList::length() const

Source/WebCore/Modules/gamepad/deprecated/GamepadList.h

2929#if ENABLE(GAMEPAD_DEPRECATED)
3030
3131#include "Gamepad.h"
32 #include <wtf/PassRefPtr.h>
3332#include <wtf/RefCounted.h>
3433#include <wtf/Vector.h>
3534

@@public:
4241 static Ref<GamepadList> create() { return adoptRef(*new GamepadList); }
4342 ~GamepadList();
4443
45  void set(unsigned index, PassRefPtr<Gamepad>);
 44 void set(unsigned index, RefPtr<Gamepad>&&);
4645 Gamepad* item(unsigned index);
4746 unsigned length() const;
4847

Source/WebCore/Modules/indexeddb/IDBGetResult.h

@@public:
5959 {
6060 }
6161
62  IDBGetResult(PassRefPtr<IDBKey> key)
63  : m_keyData(key.get())
 62 IDBGetResult(IDBKey& key)
 63 : m_keyData(&key)
6464 {
6565 }
6666

@@public:
6969 {
7070 }
7171
72  IDBGetResult(PassRefPtr<SharedBuffer> buffer, PassRefPtr<IDBKey> key, const IDBKeyPath& path)
73  : m_keyData(key.get())
 72 IDBGetResult(SharedBuffer* buffer, IDBKey& key, const IDBKeyPath& path)
 73 : m_keyData(&key)
7474 , m_keyPath(path)
7575 {
7676 if (buffer)

Source/WebCore/Modules/indieui/UIRequestEvent.cpp

@@Ref<UIRequestEvent> UIRequestEvent::createForBindings(const AtomicString& type,
3535 return adoptRef(*new UIRequestEvent(type, initializer));
3636}
3737
38 Ref<UIRequestEvent> UIRequestEvent::create(const AtomicString& type, bool bubbles, bool cancelable, AbstractView* view, int detail, PassRefPtr<EventTarget> receiver)
 38Ref<UIRequestEvent> UIRequestEvent::create(const AtomicString& type, bool bubbles, bool cancelable, AbstractView* view, int detail, RefPtr<EventTarget>&& receiver)
3939{
40  return adoptRef(*new UIRequestEvent(type, bubbles, cancelable, view, detail, receiver));
 40 return adoptRef(*new UIRequestEvent(type, bubbles, cancelable, view, detail, WTFMove(receiver)));
4141}
4242
4343UIRequestEvent::UIRequestEvent(const AtomicString& type, const UIRequestEventInit& initializer)

@@UIRequestEvent::UIRequestEvent(const AtomicString& type, const UIRequestEventIni
4646{
4747}
4848
49 UIRequestEvent::UIRequestEvent(const AtomicString& type, bool bubbles, bool cancelable, AbstractView* view, int detail, PassRefPtr<EventTarget> receiver)
 49UIRequestEvent::UIRequestEvent(const AtomicString& type, bool bubbles, bool cancelable, AbstractView* view, int detail, RefPtr<EventTarget>&& receiver)
5050 : UIEvent(type, bubbles, cancelable, view, detail)
51  , m_receiver(receiver)
 51 , m_receiver(WTFMove(receiver))
5252{
5353}
5454

Source/WebCore/Modules/indieui/UIRequestEvent.h

@@struct UIRequestEventInit : public UIEventInit {
3939
4040class UIRequestEvent : public UIEvent {
4141public:
42  static Ref<UIRequestEvent> create(const AtomicString& type, bool bubbles, bool cancelable, AbstractView*, int detail, PassRefPtr<EventTarget> receiver);
 42 static Ref<UIRequestEvent> create(const AtomicString& type, bool bubbles, bool cancelable, AbstractView*, int detail, RefPtr<EventTarget>&& receiver);
4343 static Ref<UIRequestEvent> createForBindings(const AtomicString& eventType, const UIRequestEventInit&);
4444
4545 virtual ~UIRequestEvent();

@@public:
4747 EventTarget* receiver() const { return m_receiver.get(); }
4848
4949protected:
50  UIRequestEvent(const AtomicString& type, bool bubbles, bool cancelable, AbstractView*, int detail, PassRefPtr<EventTarget> receiver);
 50 UIRequestEvent(const AtomicString& type, bool bubbles, bool cancelable, AbstractView*, int detail, RefPtr<EventTarget>&& receiver);
5151
5252 UIRequestEvent(const AtomicString& type, const UIRequestEventInit&);
5353

Source/WebCore/Modules/mediasource/MediaSourceRegistry.h

3636#include "URLRegistry.h"
3737#include <wtf/HashMap.h>
3838#include <wtf/NeverDestroyed.h>
39 #include <wtf/PassRefPtr.h>
4039#include <wtf/text/StringHash.h>
4140
4241namespace WebCore {

Source/WebCore/Modules/mediasource/SampleMap.cpp

@@void SampleMap::clear()
108108 m_totalSize = 0;
109109}
110110
111 void SampleMap::addSample(PassRefPtr<MediaSample> prpSample)
 111void SampleMap::addSample(MediaSample& sample)
112112{
113  RefPtr<MediaSample> sample = prpSample;
114  ASSERT(sample);
115 
116  MediaTime presentationTime = sample->presentationTime();
 113 MediaTime presentationTime = sample.presentationTime();
117114
118  presentationOrder().m_samples.insert(PresentationOrderSampleMap::MapType::value_type(presentationTime, sample));
 115 presentationOrder().m_samples.insert(PresentationOrderSampleMap::MapType::value_type(presentationTime, &sample));
119116
120  auto decodeKey = DecodeOrderSampleMap::KeyType(sample->decodeTime(), presentationTime);
121  decodeOrder().m_samples.insert(DecodeOrderSampleMap::MapType::value_type(decodeKey, sample));
 117 auto decodeKey = DecodeOrderSampleMap::KeyType(sample.decodeTime(), presentationTime);
 118 decodeOrder().m_samples.insert(DecodeOrderSampleMap::MapType::value_type(decodeKey, &sample));
122119
123  m_totalSize += sample->sizeInBytes();
 120 m_totalSize += sample.sizeInBytes();
124121}
125122
126123void SampleMap::removeSample(MediaSample* sample)

Source/WebCore/Modules/mediasource/SampleMap.h

@@public:
9999
100100 bool empty() const;
101101 void clear();
102  void addSample(PassRefPtr<MediaSample>);
 102 void addSample(MediaSample&);
103103 void removeSample(MediaSample*);
104104 size_t sizeInBytes() const { return m_totalSize; }
105105

@@template<typename I>
120120void SampleMap::addRange(I begin, I end)
121121{
122122 for (I iter = begin; iter != end; ++iter)
123  addSample(iter->second);
 123 addSample(*iter->second);
124124}
125125
126126}

Source/WebCore/Modules/mediasource/SourceBuffer.cpp

@@void SourceBuffer::appendError(bool decodeErrorParam)
13011301 m_source->streamEndedWithError(MediaSource::EndOfStreamError::Decode);
13021302}
13031303
1304 void SourceBuffer::sourceBufferPrivateDidReceiveSample(SourceBufferPrivate*, PassRefPtr<MediaSample> prpSample)
 1304void SourceBuffer::sourceBufferPrivateDidReceiveSample(SourceBufferPrivate*, MediaSample& sample)
13051305{
13061306 if (isRemoved())
13071307 return;

@@void SourceBuffer::sourceBufferPrivateDidReceiveSample(SourceBufferPrivate*, Pas
13171317 return;
13181318 }
13191319
1320  RefPtr<MediaSample> sample = prpSample;
1321 
13221320 // 3.5.8 Coded Frame Processing
13231321 // http://www.w3.org/TR/media-source/#sourcebuffer-coded-frame-processing
13241322

@@void SourceBuffer::sourceBufferPrivateDidReceiveSample(SourceBufferPrivate*, Pas
13411339 // ↳ Otherwise:
13421340 // 1. Let presentation timestamp be a double precision floating point representation of
13431341 // the coded frame's presentation timestamp in seconds.
1344  presentationTimestamp = sample->presentationTime();
 1342 presentationTimestamp = sample.presentationTime();
13451343
13461344 // 2. Let decode timestamp be a double precision floating point representation of the coded frame's
13471345 // decode timestamp in seconds.
1348  decodeTimestamp = sample->decodeTime();
 1346 decodeTimestamp = sample.decodeTime();
13491347 }
13501348
13511349 // 1.2 Let frame duration be a double precision floating point representation of the coded frame's
13521350 // duration in seconds.
1353  MediaTime frameDuration = sample->duration();
 1351 MediaTime frameDuration = sample.duration();
13541352
13551353 // 1.3 If mode equals "sequence" and group start timestamp is set, then run the following steps:
13561354 if (m_mode == AppendMode::Sequence && m_groupStartTimestamp.isValid()) {

@@void SourceBuffer::sourceBufferPrivateDidReceiveSample(SourceBufferPrivate*, Pas
13781376 }
13791377
13801378 // 1.5 Let track buffer equal the track buffer that the coded frame will be added to.
1381  AtomicString trackID = sample->trackID();
 1379 AtomicString trackID = sample.trackID();
13821380 auto it = m_trackBufferMap.find(trackID);
13831381 if (it == m_trackBufferMap.end())
13841382 it = m_trackBufferMap.add(trackID, TrackBuffer()).iterator;

@@void SourceBuffer::sourceBufferPrivateDidReceiveSample(SourceBufferPrivate*, Pas
14201418
14211419 if (m_mode == AppendMode::Sequence) {
14221420 // Use the generated timestamps instead of the sample's timestamps.
1423  sample->setTimestamps(presentationTimestamp, decodeTimestamp);
 1421 sample.setTimestamps(presentationTimestamp, decodeTimestamp);
14241422 } else if (m_timestampOffset) {
14251423 // Reflect the timestamp offset into the sample.
1426  sample->offsetTimestampsBy(m_timestampOffset);
 1424 sample.offsetTimestampsBy(m_timestampOffset);
14271425 }
14281426
14291427 // 1.7 Let frame end timestamp equal the sum of presentation timestamp and frame duration.

@@void SourceBuffer::sourceBufferPrivateDidReceiveSample(SourceBufferPrivate*, Pas
14571455 if (trackBuffer.needRandomAccessFlag) {
14581456 // 1.11.1 If the coded frame is not a random access point, then drop the coded frame and jump
14591457 // to the top of the loop to start processing the next coded frame.
1460  if (!sample->isSync()) {
 1458 if (!sample.isSync()) {
14611459 didDropSample();
14621460 return;
14631461 }

@@void SourceBuffer::sourceBufferPrivateDidReceiveSample(SourceBufferPrivate*, Pas
15001498 // 1.14.2.3 If the presentation timestamp is less than the remove window timestamp,
15011499 // then remove overlapped frame and any coded frames that depend on it from track buffer.
15021500 if (presentationTimestamp < removeWindowTimestamp)
1503  erasedSamples.addSample(iter->second);
 1501 erasedSamples.addSample(*iter->second);
15041502 }
15051503
15061504 // If track buffer contains timed text coded frames:

@@void SourceBuffer::sourceBufferPrivateDidReceiveSample(SourceBufferPrivate*, Pas
15891587
15901588 if (trackBuffer.lastEnqueuedDecodeEndTime.isInvalid() || decodeTimestamp >= trackBuffer.lastEnqueuedDecodeEndTime) {
15911589 DecodeOrderSampleMap::KeyType decodeKey(decodeTimestamp, presentationTimestamp);
1592  trackBuffer.decodeQueue.insert(DecodeOrderSampleMap::MapType::value_type(decodeKey, sample));
 1590 trackBuffer.decodeQueue.insert(DecodeOrderSampleMap::MapType::value_type(decodeKey, &sample));
15931591 }
15941592
15951593 // 1.18 Set last decode timestamp for track buffer to decode timestamp.

@@void SourceBuffer::textTrackModeChanged(TextTrack* track)
17321730 m_source->mediaElement()->textTrackModeChanged(track);
17331731}
17341732
1735 void SourceBuffer::textTrackAddCue(TextTrack* track, WTF::PassRefPtr<TextTrackCue> cue)
 1733void SourceBuffer::textTrackAddCue(TextTrack* track, TextTrackCue& cue)
17361734{
17371735 if (!isRemoved())
17381736 m_source->mediaElement()->textTrackAddCue(track, cue);

@@void SourceBuffer::textTrackAddCues(TextTrack* track, TextTrackCueList const* cu
17441742 m_source->mediaElement()->textTrackAddCues(track, cueList);
17451743}
17461744
1747 void SourceBuffer::textTrackRemoveCue(TextTrack* track, WTF::PassRefPtr<TextTrackCue> cue)
 1745void SourceBuffer::textTrackRemoveCue(TextTrack* track, TextTrackCue& cue)
17481746{
17491747 if (!isRemoved())
17501748 m_source->mediaElement()->textTrackRemoveCue(track, cue);

Source/WebCore/Modules/mediasource/SourceBuffer.h

4444#include "Timer.h"
4545#include "VideoTrack.h"
4646#include <runtime/ArrayBufferView.h>
47 #include <wtf/PassRefPtr.h>
4847#include <wtf/RefCounted.h>
4948#include <wtf/text/WTFString.h>
5049

@@private:
143142
144143 // SourceBufferPrivateClient
145144 void sourceBufferPrivateDidReceiveInitializationSegment(SourceBufferPrivate*, const InitializationSegment&) override;
146  void sourceBufferPrivateDidReceiveSample(SourceBufferPrivate*, PassRefPtr<MediaSample>) override;
 145 void sourceBufferPrivateDidReceiveSample(SourceBufferPrivate*, MediaSample&) override;
147146 bool sourceBufferPrivateHasAudio(const SourceBufferPrivate*) const override;
148147 bool sourceBufferPrivateHasVideo(const SourceBufferPrivate*) const override;
149148 void sourceBufferPrivateDidBecomeReadyForMoreSamples(SourceBufferPrivate*, AtomicString trackID) override;

@@private:
162161 void textTrackModeChanged(TextTrack*) override;
163162 void textTrackAddCues(TextTrack*, const TextTrackCueList*) override;
164163 void textTrackRemoveCues(TextTrack*, const TextTrackCueList*) override;
165  void textTrackAddCue(TextTrack*, PassRefPtr<TextTrackCue>) override;
166  void textTrackRemoveCue(TextTrack*, PassRefPtr<TextTrackCue>) override;
 164 void textTrackAddCue(TextTrack*, TextTrackCue&) override;
 165 void textTrackRemoveCue(TextTrack*, TextTrackCue&) override;
167166
168167 bool isRemoved() const;
169168 void scheduleEvent(const AtomicString& eventName);

Source/WebCore/Modules/mediastream/CaptureDeviceManager.cpp

@@bool CaptureDeviceManager::verifyConstraintsForMediaType(RealtimeMediaSource::Ty
8888 return true;
8989}
9090
91 Vector<RefPtr<RealtimeMediaSource>> CaptureDeviceManager::bestSourcesForTypeAndConstraints(RealtimeMediaSource::Type type, PassRefPtr<MediaConstraints> constraints)
 91Vector<RefPtr<RealtimeMediaSource>> CaptureDeviceManager::bestSourcesForTypeAndConstraints(RealtimeMediaSource::Type type, MediaConstraints& constraints)
9292{
9393 Vector<RefPtr<RealtimeMediaSource>> bestSourcesList;
9494

@@Vector<RefPtr<RealtimeMediaSource>> CaptureDeviceManager::bestSourcesForTypeAndC
103103 if (!captureDevice.m_enabled || captureDevice.m_sourceId.isEmpty() || captureDevice.m_sourceType == RealtimeMediaSource::None)
104104 continue;
105105
106  if (RefPtr<RealtimeMediaSource> captureSource = sourceWithUID(captureDevice.m_persistentDeviceID, type, constraints.get()))
 106 if (RefPtr<RealtimeMediaSource> captureSource = sourceWithUID(captureDevice.m_persistentDeviceID, type, &constraints))
107107 bestSourcesList.append(captureSource.leakRef());
108108 }
109109 std::sort(bestSourcesList.begin(), bestSourcesList.end(), sortBasedOnFitnessScore);

Source/WebCore/Modules/mediastream/CaptureDeviceManager.h

@@public:
4040 virtual Vector<CaptureDeviceInfo>& captureDeviceList() = 0;
4141 virtual void refreshCaptureDeviceList() { }
4242 virtual TrackSourceInfoVector getSourcesInfo(const String&);
43  virtual Vector<RefPtr<RealtimeMediaSource>> bestSourcesForTypeAndConstraints(RealtimeMediaSource::Type, PassRefPtr<MediaConstraints>);
 43 virtual Vector<RefPtr<RealtimeMediaSource>> bestSourcesForTypeAndConstraints(RealtimeMediaSource::Type, MediaConstraints&);
4444 virtual RefPtr<RealtimeMediaSource> sourceWithUID(const String&, RealtimeMediaSource::Type, MediaConstraints*);
4545
4646 virtual bool verifyConstraintsForMediaType(RealtimeMediaSource::Type, MediaConstraints*, const CaptureSessionInfo*, String&);

Source/WebCore/Modules/mediastream/MediaDevicesRequest.h

3434#include "MediaStreamCreationClient.h"
3535#include "MediaStreamTrackSourcesRequestClient.h"
3636#include "UserMediaPermissionCheck.h"
37 #include <wtf/PassRefPtr.h>
3837#include <wtf/RefCounted.h>
3938#include <wtf/text/WTFString.h>
4039

Source/WebCore/Modules/mediastream/MediaStreamRegistry.h

3030
3131#include "URLRegistry.h"
3232#include <wtf/HashMap.h>
33 #include <wtf/PassRefPtr.h>
3433#include <wtf/text/StringHash.h>
3534
3635namespace WebCore {

Source/WebCore/Modules/mediastream/MediaStreamTrackEvent.cpp

3232
3333namespace WebCore {
3434
35 Ref<MediaStreamTrackEvent> MediaStreamTrackEvent::create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<MediaStreamTrack> track)
 35Ref<MediaStreamTrackEvent> MediaStreamTrackEvent::create(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<MediaStreamTrack>&& track)
3636{
37  return adoptRef(*new MediaStreamTrackEvent(type, canBubble, cancelable, track));
 37 return adoptRef(*new MediaStreamTrackEvent(type, canBubble, cancelable, WTFMove(track)));
3838}
3939
4040Ref<MediaStreamTrackEvent> MediaStreamTrackEvent::createForBindings(const AtomicString& type, const MediaStreamTrackEventInit& initializer)

@@Ref<MediaStreamTrackEvent> MediaStreamTrackEvent::createForBindings(const Atomic
4242 return adoptRef(*new MediaStreamTrackEvent(type, initializer));
4343}
4444
45 MediaStreamTrackEvent::MediaStreamTrackEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<MediaStreamTrack> track)
 45MediaStreamTrackEvent::MediaStreamTrackEvent(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<MediaStreamTrack>&& track)
4646 : Event(type, canBubble, cancelable)
47  , m_track(track)
 47 , m_track(WTFMove(track))
4848{
4949}
5050

Source/WebCore/Modules/mediastream/MediaStreamTrackEvent.h

@@class MediaStreamTrackEvent : public Event {
4242public:
4343 virtual ~MediaStreamTrackEvent();
4444
45  static Ref<MediaStreamTrackEvent> create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<MediaStreamTrack>);
 45 static Ref<MediaStreamTrackEvent> create(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<MediaStreamTrack>&&);
4646 static Ref<MediaStreamTrackEvent> createForBindings(const AtomicString& type, const MediaStreamTrackEventInit& initializer);
4747
4848 MediaStreamTrack* track() const;

@@public:
5151 EventInterface eventInterface() const override;
5252
5353private:
54  MediaStreamTrackEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<MediaStreamTrack>);
 54 MediaStreamTrackEvent(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<MediaStreamTrack>&&);
5555 MediaStreamTrackEvent(const AtomicString& type, const MediaStreamTrackEventInit&);
5656
5757 RefPtr<MediaStreamTrack> m_track;

Source/WebCore/Modules/mediastream/MediaTrackConstraints.cpp

@@using namespace JSC;
3838
3939namespace WebCore {
4040
41 Ref<MediaTrackConstraints> MediaTrackConstraints::create(PassRefPtr<MediaConstraintsImpl> constraints)
 41Ref<MediaTrackConstraints> MediaTrackConstraints::create(MediaConstraintsImpl& constraints)
4242{
4343 return adoptRef(*new MediaTrackConstraints(constraints));
4444}
4545
46 MediaTrackConstraints::MediaTrackConstraints(PassRefPtr<MediaConstraintsImpl> constraints)
 46MediaTrackConstraints::MediaTrackConstraints(MediaConstraintsImpl& constraints)
4747 : m_constraints(constraints)
4848{
4949}
5050
51 Vector<PassRefPtr<MediaTrackConstraint>> MediaTrackConstraints::optional() const
 51Vector<RefPtr<MediaTrackConstraint>> MediaTrackConstraints::optional() const
5252{
5353 // https://bugs.webkit.org/show_bug.cgi?id=121954
5454 notImplemented();
55  return Vector<PassRefPtr<MediaTrackConstraint>>();
 55 return { };
5656}
5757
5858MediaTrackConstraintSet* MediaTrackConstraints::mandatory() const

Source/WebCore/Modules/mediastream/MediaTrackConstraints.h

@@class MediaTrackConstraints : public RefCounted<MediaTrackConstraints>, public S
4242public:
4343 virtual ~MediaTrackConstraints() { }
4444
45  static Ref<MediaTrackConstraints> create(PassRefPtr<MediaConstraintsImpl>);
 45 static Ref<MediaTrackConstraints> create(MediaConstraintsImpl&);
4646
47  Vector<PassRefPtr<MediaTrackConstraint>> optional() const;
 47 Vector<RefPtr<MediaTrackConstraint>> optional() const;
4848 MediaTrackConstraintSet* mandatory() const;
4949
5050private:
51  explicit MediaTrackConstraints(PassRefPtr<MediaConstraintsImpl>);
 51 explicit MediaTrackConstraints(MediaConstraintsImpl&);
5252
53  RefPtr<MediaConstraintsImpl> m_constraints;
 53 Ref<MediaConstraintsImpl> m_constraints;
5454};
5555
5656} // namespace WebCore

Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp

@@static const long maxToneDurationMs = 6000;
4444static const long minInterToneGapMs = 30;
4545static const long defaultInterToneGapMs = 70;
4646
47 RefPtr<RTCDTMFSender> RTCDTMFSender::create(ScriptExecutionContext* context, RTCPeerConnectionHandler* peerConnectionHandler, PassRefPtr<MediaStreamTrack> prpTrack, ExceptionCode& ec)
 47RefPtr<RTCDTMFSender> RTCDTMFSender::create(ScriptExecutionContext* context, RTCPeerConnectionHandler* peerConnectionHandler, RefPtr<MediaStreamTrack>&& track, ExceptionCode& ec)
4848{
49  RefPtr<MediaStreamTrack> track = prpTrack;
5049 std::unique_ptr<RTCDTMFSenderHandler> handler = peerConnectionHandler->createDTMFSender(&track->source());
5150 if (!handler) {
5251 ec = NOT_SUPPORTED_ERR;
5352 return nullptr;
5453 }
5554
56  RefPtr<RTCDTMFSender> dtmfSender = adoptRef(new RTCDTMFSender(context, track, WTFMove(handler)));
 55 RefPtr<RTCDTMFSender> dtmfSender = adoptRef(new RTCDTMFSender(context, WTFMove(track), WTFMove(handler)));
5756 dtmfSender->suspendIfNeeded();
5857 return dtmfSender;
5958}
6059
61 RTCDTMFSender::RTCDTMFSender(ScriptExecutionContext* context, PassRefPtr<MediaStreamTrack> track, std::unique_ptr<RTCDTMFSenderHandler> handler)
 60RTCDTMFSender::RTCDTMFSender(ScriptExecutionContext* context, RefPtr<MediaStreamTrack>&& track, std::unique_ptr<RTCDTMFSenderHandler> handler)
6261 : ActiveDOMObject(context)
63  , m_track(track)
 62 , m_track(WTFMove(track))
6463 , m_duration(defaultToneDurationMs)
6564 , m_interToneGap(defaultInterToneGapMs)
6665 , m_handler(WTFMove(handler))

Source/WebCore/Modules/mediastream/RTCDTMFSender.h

@@class RTCDTMFSenderHandler;
4343
4444class RTCDTMFSender final : public RefCounted<RTCDTMFSender>, public EventTargetWithInlineData, public RTCDTMFSenderHandlerClient, public ActiveDOMObject {
4545public:
46  static RefPtr<RTCDTMFSender> create(ScriptExecutionContext*, RTCPeerConnectionHandler*, PassRefPtr<MediaStreamTrack>, ExceptionCode&);
 46 static RefPtr<RTCDTMFSender> create(ScriptExecutionContext*, RTCPeerConnectionHandler*, RefPtr<MediaStreamTrack>&&, ExceptionCode&);
4747 ~RTCDTMFSender();
4848
4949 bool canInsertDTMF() const;

@@public:
6262 using RefCounted<RTCDTMFSender>::deref;
6363
6464private:
65  RTCDTMFSender(ScriptExecutionContext*, PassRefPtr<MediaStreamTrack>, std::unique_ptr<RTCDTMFSenderHandler>);
 65 RTCDTMFSender(ScriptExecutionContext*, RefPtr<MediaStreamTrack>&&, std::unique_ptr<RTCDTMFSenderHandler>);
6666
6767 // ActiveDOMObject
6868 void stop() override;

Source/WebCore/Modules/mediastream/RTCDataChannelEvent.cpp

3232
3333namespace WebCore {
3434
35 Ref<RTCDataChannelEvent> RTCDataChannelEvent::create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<RTCDataChannel> channel)
 35Ref<RTCDataChannelEvent> RTCDataChannelEvent::create(const AtomicString& type, bool canBubble, bool cancelable, RTCDataChannel& channel)
3636{
3737 return adoptRef(*new RTCDataChannelEvent(type, canBubble, cancelable, channel));
3838}
3939
40 RTCDataChannelEvent::RTCDataChannelEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<RTCDataChannel> channel)
 40RTCDataChannelEvent::RTCDataChannelEvent(const AtomicString& type, bool canBubble, bool cancelable, RTCDataChannel& channel)
4141 : Event(type, canBubble, cancelable)
4242 , m_channel(channel)
4343{

@@RTCDataChannelEvent::~RTCDataChannelEvent()
4949
5050RTCDataChannel* RTCDataChannelEvent::channel() const
5151{
52  return m_channel.get();
 52 return const_cast<RTCDataChannel*>(m_channel.ptr());
5353}
5454
5555EventInterface RTCDataChannelEvent::eventInterface() const

Source/WebCore/Modules/mediastream/RTCDataChannelEvent.h

@@class RTCDataChannelEvent : public Event {
3737public:
3838 virtual ~RTCDataChannelEvent();
3939
40  static Ref<RTCDataChannelEvent> create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<RTCDataChannel>);
 40 static Ref<RTCDataChannelEvent> create(const AtomicString& type, bool canBubble, bool cancelable, RTCDataChannel&);
4141
4242 RTCDataChannel* channel() const;
4343
4444 virtual EventInterface eventInterface() const;
4545
4646private:
47  RTCDataChannelEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<RTCDataChannel>);
 47 RTCDataChannelEvent(const AtomicString& type, bool canBubble, bool cancelable, RTCDataChannel&);
4848
49  RefPtr<RTCDataChannel> m_channel;
 49 Ref<RTCDataChannel> m_channel;
5050};
5151
5252} // namespace WebCore

Source/WebCore/Modules/mediastream/RTCIceServer.h

2828
2929#if ENABLE(WEB_RTC)
3030
31 #include <wtf/PassRefPtr.h>
3231#include <wtf/RefCounted.h>
3332#include <wtf/Vector.h>
3433#include <wtf/text/WTFString.h>

Source/WebCore/Modules/mediastream/RTCStatsReport.h

2727
2828#include "ScriptWrappable.h"
2929#include <wtf/HashMap.h>
30 #include <wtf/PassRefPtr.h>
3130#include <wtf/RefCounted.h>
3231#include <wtf/Vector.h>
3332#include <wtf/text/WTFString.h>

Source/WebCore/Modules/mediastream/SourceInfo.cpp

3333
3434namespace WebCore {
3535
36 Ref<SourceInfo> SourceInfo::create(PassRefPtr<TrackSourceInfo> trackSourceInfo)
 36Ref<SourceInfo> SourceInfo::create(Ref<TrackSourceInfo>&& trackSourceInfo)
3737{
38  return adoptRef(*new SourceInfo(trackSourceInfo));
 38 return adoptRef(*new SourceInfo(WTFMove(trackSourceInfo)));
3939}
4040
41 SourceInfo::SourceInfo(PassRefPtr<TrackSourceInfo> trackSourceInfo)
42  : m_trackSourceInfo(trackSourceInfo)
 41SourceInfo::SourceInfo(Ref<TrackSourceInfo>&& trackSourceInfo)
 42 : m_trackSourceInfo(WTFMove(trackSourceInfo))
4343{
4444}
4545

Source/WebCore/Modules/mediastream/SourceInfo.h

@@namespace WebCore {
4040
4141class SourceInfo : public RefCounted<SourceInfo>, public ScriptWrappable {
4242public:
43  static Ref<SourceInfo> create(PassRefPtr<TrackSourceInfo>);
 43 static Ref<SourceInfo> create(Ref<TrackSourceInfo>&&);
4444
4545 const AtomicString& sourceId() const { return m_trackSourceInfo->id(); }
4646 const AtomicString& label() const { return m_trackSourceInfo->label(); }
4747 const AtomicString& kind() const;
4848
4949private:
50  SourceInfo(PassRefPtr<TrackSourceInfo>);
 50 SourceInfo(Ref<TrackSourceInfo>&&);
5151
52  RefPtr<TrackSourceInfo> m_trackSourceInfo;
 52 Ref<TrackSourceInfo> m_trackSourceInfo;
5353};
5454
5555} // namespace WebCore

Source/WebCore/Modules/mediastream/UserMediaClient.h

3333
3434#if ENABLE(MEDIA_STREAM)
3535
36 #include <wtf/PassRefPtr.h>
37 
3836namespace WebCore {
3937
4038class Page;

Source/WebCore/Modules/mediastream/UserMediaRequest.cpp

@@void UserMediaRequest::start(Document* document, const Dictionary& options, Medi
9292 request->start();
9393}
9494
95 UserMediaRequest::UserMediaRequest(ScriptExecutionContext* context, UserMediaController* controller, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints, MediaDevices::Promise&& promise)
 95UserMediaRequest::UserMediaRequest(ScriptExecutionContext* context, UserMediaController* controller, RefPtr<MediaConstraints>&& audioConstraints, RefPtr<MediaConstraints>&& videoConstraints, MediaDevices::Promise&& promise)
9696 : ContextDestructionObserver(context)
97  , m_audioConstraints(audioConstraints)
98  , m_videoConstraints(videoConstraints)
 97 , m_audioConstraints(WTFMove(audioConstraints))
 98 , m_videoConstraints(WTFMove(videoConstraints))
9999 , m_controller(controller)
100100 , m_promise(WTFMove(promise))
101101{

@@void UserMediaRequest::constraintsInvalid(const String& constraintName)
163163 failedToCreateStreamWithConstraintsError(constraintName);
164164}
165165
166 void UserMediaRequest::didCreateStream(PassRefPtr<MediaStreamPrivate> privateStream)
 166void UserMediaRequest::didCreateStream(RefPtr<MediaStreamPrivate>&& privateStream)
167167{
168168 if (!m_scriptExecutionContext)
169169 return;
170170
171171 // 4 - Create the MediaStream and pass it to the success callback.
172  Ref<MediaStream> stream = MediaStream::create(*m_scriptExecutionContext, privateStream);
 172 Ref<MediaStream> stream = MediaStream::create(*m_scriptExecutionContext, WTFMove(privateStream));
173173 if (m_audioConstraints) {
174174 for (auto& track : stream->getAudioTracks()) {
175175 track->applyConstraints(*m_audioConstraints);

Source/WebCore/Modules/mediastream/UserMediaRequest.h

3838#include "ActiveDOMObject.h"
3939#include "MediaDevices.h"
4040#include "MediaStreamCreationClient.h"
41 #include <wtf/PassRefPtr.h>
4241#include <wtf/RefCounted.h>
4342#include <wtf/text/WTFString.h>
4443

@@public:
7473 const String& allowedVideoDeviceUID() const { return m_allowedVideoDeviceUID; }
7574
7675private:
77  UserMediaRequest(ScriptExecutionContext*, UserMediaController*, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints, MediaDevices::Promise&&);
 76 UserMediaRequest(ScriptExecutionContext*, UserMediaController*, RefPtr<MediaConstraints>&& audioConstraints, RefPtr<MediaConstraints>&& videoConstraints, MediaDevices::Promise&&);
7877
7978 // MediaStreamCreationClient
8079 void constraintsValidated(const Vector<RefPtr<RealtimeMediaSource>>& audioTracks, const Vector<RefPtr<RealtimeMediaSource>>& videoTracks) final;
8180 void constraintsInvalid(const String& constraintName) final;
82  void didCreateStream(PassRefPtr<MediaStreamPrivate>) final;
 81 void didCreateStream(RefPtr<MediaStreamPrivate>&&) final;
8382 void failedToCreateStreamWithConstraintsError(const String& constraintName) final;
8483 void failedToCreateStreamWithPermissionError() final;
8584

Source/WebCore/Modules/webdatabase/Database.cpp

5454#include "SecurityOrigin.h"
5555#include "VoidCallback.h"
5656#include <wtf/NeverDestroyed.h>
57 #include <wtf/PassRefPtr.h>
5857#include <wtf/RefPtr.h>
5958#include <wtf/StdLibExtras.h>
6059#include <wtf/text/CString.h>

@@Database::~Database()
246245 if (!m_scriptExecutionContext->isContextThread()) {
247246 // Grab a pointer to the script execution here because we're releasing it when we pass it to
248247 // DerefContextTask::create.
249  PassRefPtr<ScriptExecutionContext> passedContext = m_scriptExecutionContext.release();
 248 RefPtr<ScriptExecutionContext> passedContext = WTFMove(m_scriptExecutionContext);
250249 passedContext->postTask({ScriptExecutionContext::Task::CleanupTask, [passedContext] (ScriptExecutionContext& context) {
251250 ASSERT_UNUSED(context, &context == passedContext);
252251 RefPtr<ScriptExecutionContext> scriptExecutionContext(passedContext);

Source/WebCore/html/HTMLMediaElement.cpp

@@void HTMLMediaElement::textTrackAddCues(TextTrack* track, const TextTrackCueList
18371837
18381838 TrackDisplayUpdateScope scope(this);
18391839 for (size_t i = 0; i < cues->length(); ++i)
1840  textTrackAddCue(track, cues->item(i));
 1840 textTrackAddCue(track, *cues->item(i));
18411841}
18421842
18431843void HTMLMediaElement::textTrackRemoveCues(TextTrack*, const TextTrackCueList* cues)
18441844{
18451845 TrackDisplayUpdateScope scope(this);
18461846 for (size_t i = 0; i < cues->length(); ++i)
1847  textTrackRemoveCue(cues->item(i)->track(), cues->item(i));
 1847 textTrackRemoveCue(cues->item(i)->track(), *cues->item(i));
18481848}
18491849
1850 void HTMLMediaElement::textTrackAddCue(TextTrack* track, PassRefPtr<TextTrackCue> prpCue)
 1850void HTMLMediaElement::textTrackAddCue(TextTrack* track, TextTrackCue& cue)
18511851{
18521852 if (track->mode() == TextTrack::Mode::Disabled)
18531853 return;
18541854
1855  RefPtr<TextTrackCue> cue = prpCue;
1856 
18571855 // Negative duration cues need be treated in the interval tree as
18581856 // zero-length cues.
1859  MediaTime endTime = std::max(cue->startMediaTime(), cue->endMediaTime());
 1857 MediaTime endTime = std::max(cue.startMediaTime(), cue.endMediaTime());
18601858
1861  CueInterval interval = m_cueTree.createInterval(cue->startMediaTime(), endTime, cue.get());
 1859 CueInterval interval = m_cueTree.createInterval(cue.startMediaTime(), endTime, &cue);
18621860 if (!m_cueTree.contains(interval))
18631861 m_cueTree.add(interval);
18641862 updateActiveTextTrackCues(currentMediaTime());
18651863}
18661864
1867 void HTMLMediaElement::textTrackRemoveCue(TextTrack*, PassRefPtr<TextTrackCue> prpCue)
 1865void HTMLMediaElement::textTrackRemoveCue(TextTrack*, TextTrackCue& cue)
18681866{
1869  RefPtr<TextTrackCue> cue = prpCue;
18701867 // Negative duration cues need to be treated in the interval tree as
18711868 // zero-length cues.
1872  MediaTime endTime = std::max(cue->startMediaTime(), cue->endMediaTime());
 1869 MediaTime endTime = std::max(cue.startMediaTime(), cue.endMediaTime());
18731870
1874  CueInterval interval = m_cueTree.createInterval(cue->startMediaTime(), endTime, cue.get());
 1871 CueInterval interval = m_cueTree.createInterval(cue.startMediaTime(), endTime, &cue);
18751872 m_cueTree.remove(interval);
18761873
18771874 // Since the cue will be removed from the media element and likely the
18781875 // TextTrack might also be destructed, notifying the region of the cue
18791876 // removal shouldn't be done.
1880  if (cue->isRenderable())
1881  toVTTCue(cue.get())->notifyRegionWhenRemovingDisplayTree(false);
 1877 if (cue.isRenderable())
 1878 toVTTCue(&cue)->notifyRegionWhenRemovingDisplayTree(false);
18821879
18831880 size_t index = m_currentlyActiveCues.find(interval);
18841881 if (index != notFound) {
1885  cue->setIsActive(false);
 1882 cue.setIsActive(false);
18861883 m_currentlyActiveCues.remove(index);
18871884 }
18881885
1889  if (cue->isRenderable())
1890  toVTTCue(cue.get())->removeDisplayTree();
 1886 if (cue.isRenderable())
 1887 toVTTCue(&cue)->removeDisplayTree();
18911888 updateActiveTextTrackCues(currentMediaTime());
18921889
1893  if (cue->isRenderable())
1894  toVTTCue(cue.get())->notifyRegionWhenRemovingDisplayTree(true);
 1890 if (cue.isRenderable())
 1891 toVTTCue(&cue)->notifyRegionWhenRemovingDisplayTree(true);
18951892}
18961893
18971894#endif

Source/WebCore/html/HTMLMediaElement.h

@@public:
333333 void textTrackModeChanged(TextTrack*) override;
334334 void textTrackAddCues(TextTrack*, const TextTrackCueList*) override;
335335 void textTrackRemoveCues(TextTrack*, const TextTrackCueList*) override;
336  void textTrackAddCue(TextTrack*, PassRefPtr<TextTrackCue>) override;
337  void textTrackRemoveCue(TextTrack*, PassRefPtr<TextTrackCue>) override;
 336 void textTrackAddCue(TextTrack*, TextTrackCue&) override;
 337 void textTrackRemoveCue(TextTrack*, TextTrackCue&) override;
338338
339339 // VideoTrackClient
340340 void videoTrackSelectedChanged(VideoTrack*) override;

Source/WebCore/html/HTMLTrackElement.cpp

@@void HTMLTrackElement::textTrackRemoveCues(TextTrack* track, const TextTrackCueL
306306 return parent->textTrackRemoveCues(track, cues);
307307}
308308
309 void HTMLTrackElement::textTrackAddCue(TextTrack* track, PassRefPtr<TextTrackCue> cue)
 309void HTMLTrackElement::textTrackAddCue(TextTrack* track, TextTrackCue& cue)
310310{
311311 if (HTMLMediaElement* parent = mediaElement())
312312 return parent->textTrackAddCue(track, cue);
313313}
314314
315 void HTMLTrackElement::textTrackRemoveCue(TextTrack* track, PassRefPtr<TextTrackCue> cue)
 315void HTMLTrackElement::textTrackRemoveCue(TextTrack* track, TextTrackCue& cue)
316316{
317317 if (HTMLMediaElement* parent = mediaElement())
318318 return parent->textTrackRemoveCue(track, cue);

Source/WebCore/html/HTMLTrackElement.h

@@private:
7878 void textTrackKindChanged(TextTrack*) final;
7979 void textTrackAddCues(TextTrack*, const TextTrackCueList*) final;
8080 void textTrackRemoveCues(TextTrack*, const TextTrackCueList*) final;
81  void textTrackAddCue(TextTrack*, PassRefPtr<TextTrackCue>) final;
82  void textTrackRemoveCue(TextTrack*, PassRefPtr<TextTrackCue>) final;
 81 void textTrackAddCue(TextTrack*, TextTrackCue&) final;
 82 void textTrackRemoveCue(TextTrack*, TextTrackCue&) final;
8383
8484 LoadableTextTrack& ensureTrack();
8585 bool canLoadURL(const URL&);

Source/WebCore/html/track/TextTrack.cpp

@@void TextTrack::addCue(PassRefPtr<TextTrackCue> prpCue, ExceptionCode& ec)
326326 ensureTextTrackCueList().add(cue);
327327
328328 if (m_client)
329  m_client->textTrackAddCue(this, cue.get());
 329 m_client->textTrackAddCue(this, *cue);
330330}
331331
332332void TextTrack::removeCue(TextTrackCue* cue, ExceptionCode& ec)

@@void TextTrack::removeCue(TextTrackCue* cue, ExceptionCode& ec)
353353
354354 cue->setTrack(0);
355355 if (m_client)
356  m_client->textTrackRemoveCue(this, cue);
 356 m_client->textTrackRemoveCue(this, *cue);
357357}
358358
359359VTTRegionList& TextTrack::ensureVTTRegionList()

@@void TextTrack::cueWillChange(TextTrackCue* cue)
434434
435435 // The cue may need to be repositioned in the media element's interval tree, may need to
436436 // be re-rendered, etc, so remove it before the modification...
437  m_client->textTrackRemoveCue(this, cue);
 437 m_client->textTrackRemoveCue(this, *cue);
438438}
439439
440440void TextTrack::cueDidChange(TextTrackCue* cue)

@@void TextTrack::cueDidChange(TextTrackCue* cue)
446446 ensureTextTrackCueList().updateCueIndex(cue);
447447
448448 // ... and add it back again.
449  m_client->textTrackAddCue(this, cue);
 449 m_client->textTrackAddCue(this, *cue);
450450}
451451
452452int TextTrack::trackIndex()

Source/WebCore/html/track/TextTrack.h

@@public:
4949 virtual void textTrackModeChanged(TextTrack*) = 0;
5050 virtual void textTrackAddCues(TextTrack*, const TextTrackCueList*) = 0;
5151 virtual void textTrackRemoveCues(TextTrack*, const TextTrackCueList*) = 0;
52  virtual void textTrackAddCue(TextTrack*, PassRefPtr<TextTrackCue>) = 0;
53  virtual void textTrackRemoveCue(TextTrack*, PassRefPtr<TextTrackCue>) = 0;
 52 virtual void textTrackAddCue(TextTrack*, TextTrackCue&) = 0;
 53 virtual void textTrackRemoveCue(TextTrack*, TextTrackCue&) = 0;
5454};
5555
5656class TextTrack : public TrackBase, public EventTargetWithInlineData {

Source/WebCore/platform/efl/GamepadsEfl.cpp

@@void GamepadsEfl::updateGamepadList(GamepadList* into)
224224 gamepad->axes(gamepadDevice->axesCount(), gamepadDevice->axesData());
225225 gamepad->buttons(gamepadDevice->buttonsCount(), gamepadDevice->buttonsData());
226226
227  into->set(i, gamepad);
 227 into->set(i, WTFMove(gamepad));
228228 } else
229  into->set(i, 0);
 229 into->set(i, nullptr);
230230 }
231231}
232232

Source/WebCore/platform/graphics/SourceBufferPrivateClient.h

@@public:
6666 Vector<TextTrackInformation> textTracks;
6767 };
6868 virtual void sourceBufferPrivateDidReceiveInitializationSegment(SourceBufferPrivate*, const InitializationSegment&) = 0;
69  virtual void sourceBufferPrivateDidReceiveSample(SourceBufferPrivate*, PassRefPtr<MediaSample>) = 0;
 69 virtual void sourceBufferPrivateDidReceiveSample(SourceBufferPrivate*, MediaSample&) = 0;
7070 virtual bool sourceBufferPrivateHasAudio(const SourceBufferPrivate*) const = 0;
7171 virtual bool sourceBufferPrivateHasVideo(const SourceBufferPrivate*) const = 0;
7272

Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm

@@bool SourceBufferPrivateAVFObjC::processCodedFrame(int trackID, CMSampleBufferRe
568568
569569
570570 if (m_client) {
571  RefPtr<MediaSample> mediaSample = MediaSampleAVFObjC::create(sampleBuffer, trackID);
572  LOG(MediaSourceSamples, "SourceBufferPrivateAVFObjC::processCodedFrame(%p) - sample(%s)", this, toString(*mediaSample).utf8().data());
573  m_client->sourceBufferPrivateDidReceiveSample(this, WTFMove(mediaSample));
 571 Ref<MediaSample> mediaSample = MediaSampleAVFObjC::create(sampleBuffer, trackID);
 572 LOG(MediaSourceSamples, "SourceBufferPrivateAVFObjC::processCodedFrame(%p) - sample(%s)", this, toString(mediaSample.get()).utf8().data());
 573 m_client->sourceBufferPrivateDidReceiveSample(this, mediaSample);
574574 }
575575
576576 return true;

Source/WebCore/platform/mediastream/MediaStreamCreationClient.h

@@public:
4242 virtual void constraintsValidated(const Vector<RefPtr<RealtimeMediaSource>>& audioTracks, const Vector<RefPtr<RealtimeMediaSource>>& videoTracks) = 0;
4343 virtual void constraintsInvalid(const String& constraintName) = 0;
4444
45  virtual void didCreateStream(PassRefPtr<MediaStreamPrivate>) = 0;
 45 virtual void didCreateStream(RefPtr<MediaStreamPrivate>&&) = 0;
4646 virtual void failedToCreateStreamWithConstraintsError(const String& constraintName) = 0;
4747 virtual void failedToCreateStreamWithPermissionError() = 0;
4848};

Source/WebCore/platform/mediastream/mac/AVCaptureDeviceManager.h

@@public:
6161 static AVCaptureDeviceManager& singleton();
6262
6363 RefPtr<RealtimeMediaSource> sourceWithUID(const String&, RealtimeMediaSource::Type, MediaConstraints*) override;
64  Vector<RefPtr<RealtimeMediaSource>> bestSourcesForTypeAndConstraints(RealtimeMediaSource::Type, PassRefPtr<MediaConstraints>) override;
 64 Vector<RefPtr<RealtimeMediaSource>> bestSourcesForTypeAndConstraints(RealtimeMediaSource::Type, MediaConstraints&) override;
6565
6666 TrackSourceInfoVector getSourcesInfo(const String&) override;
6767 bool verifyConstraintsForMediaType(RealtimeMediaSource::Type, MediaConstraints*, const CaptureSessionInfo*, String&) override;

Source/WebCore/platform/mediastream/mac/AVCaptureDeviceManager.mm

@@AVCaptureDeviceManager::~AVCaptureDeviceManager()
224224 [m_objcObserver disconnect];
225225}
226226
227 Vector<RefPtr<RealtimeMediaSource>> AVCaptureDeviceManager::bestSourcesForTypeAndConstraints(RealtimeMediaSource::Type type, PassRefPtr<MediaConstraints> constraints)
 227Vector<RefPtr<RealtimeMediaSource>> AVCaptureDeviceManager::bestSourcesForTypeAndConstraints(RealtimeMediaSource::Type type, MediaConstraints& constraints)
228228{
229229 if (!isAvailable())
230230 return Vector<RefPtr<RealtimeMediaSource>>();

Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp

@@void RealtimeMediaSourceCenterMac::validateRequestConstraints(MediaStreamCreatio
8282 return;
8383 }
8484
85  audioSources = AVCaptureDeviceManager::singleton().bestSourcesForTypeAndConstraints(RealtimeMediaSource::Type::Audio, audioConstraints);
 85 audioSources = AVCaptureDeviceManager::singleton().bestSourcesForTypeAndConstraints(RealtimeMediaSource::Type::Audio, *audioConstraints);
8686 }
8787
8888 if (videoConstraints) {

@@void RealtimeMediaSourceCenterMac::validateRequestConstraints(MediaStreamCreatio
9393 return;
9494 }
9595
96  videoSources = AVCaptureDeviceManager::singleton().bestSourcesForTypeAndConstraints(RealtimeMediaSource::Type::Video, videoConstraints);
 96 videoSources = AVCaptureDeviceManager::singleton().bestSourcesForTypeAndConstraints(RealtimeMediaSource::Type::Video, *videoConstraints);
9797 }
9898 client->constraintsValidated(audioSources, videoSources);
9999}

@@void RealtimeMediaSourceCenterMac::createMediaStream(PassRefPtr<MediaStreamCreat
116116 }
117117 // FIXME: Consider the constraints when choosing among multiple devices. For now just select the first available
118118 // device of the appropriate type.
119  auto audioSource = AVCaptureDeviceManager::singleton().bestSourcesForTypeAndConstraints(RealtimeMediaSource::Audio, audioConstraints.get()).at(0);
 119 auto audioSource = AVCaptureDeviceManager::singleton().bestSourcesForTypeAndConstraints(RealtimeMediaSource::Audio, *audioConstraints).at(0);
120120 ASSERT(audioSource);
121121
122122 audioSources.append(WTFMove(audioSource));

@@void RealtimeMediaSourceCenterMac::createMediaStream(PassRefPtr<MediaStreamCreat
131131 }
132132 // FIXME: Consider the constraints when choosing among multiple devices. For now just select the first available
133133 // device of the appropriate type.
134  auto videoSource = AVCaptureDeviceManager::singleton().bestSourcesForTypeAndConstraints(RealtimeMediaSource::Video, videoConstraints.get()).at(0);
 134 auto videoSource = AVCaptureDeviceManager::singleton().bestSourcesForTypeAndConstraints(RealtimeMediaSource::Video, *videoConstraints).at(0);
135135 ASSERT(videoSource);
136136
137137 videoSources.append(WTFMove(videoSource));

Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp

@@namespace WebCore {
4444
4545class MockMediaSample final : public MediaSample {
4646public:
47  static RefPtr<MockMediaSample> create(const MockSampleBox& box) { return adoptRef(new MockMediaSample(box)); }
 47 static Ref<MockMediaSample> create(const MockSampleBox& box) { return adoptRef(*new MockMediaSample(box)); }
4848 virtual ~MockMediaSample() { }
4949
5050private:

@@void MockSourceBufferPrivate::didReceiveSample(const MockSampleBox& sampleBox)
192192 if (!m_client)
193193 return;
194194
195  m_client->sourceBufferPrivateDidReceiveSample(this, MockMediaSample::create(sampleBox));
 195 m_client->sourceBufferPrivateDidReceiveSample(this, MockMediaSample::create(sampleBox).get());
196196}
197197
198198void MockSourceBufferPrivate::abort()