Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Side by Side Diff: third_party/WebKit/Source/modules/peerconnection/RTCTrackEvent.cpp

Issue 2972003002: RTCPeerConnection.ontrack event added. (Closed)
Patch Set: Le merge Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "modules/peerconnection/RTCTrackEvent.h"
6
7 #include "modules/mediastream/MediaStream.h"
8 #include "modules/mediastream/MediaStreamTrack.h"
9 #include "modules/peerconnection/RTCRtpReceiver.h"
10 #include "modules/peerconnection/RTCTrackEventInit.h"
11
12 namespace blink {
13
14 RTCTrackEvent* RTCTrackEvent::Create(const AtomicString& type,
15 const RTCTrackEventInit& eventInitDict) {
16 return new RTCTrackEvent(type, eventInitDict);
17 }
18
19 RTCTrackEvent::RTCTrackEvent(const AtomicString& type,
20 const RTCTrackEventInit& eventInitDict)
21 : Event(type, eventInitDict),
22 receiver_(eventInitDict.receiver()),
23 track_(eventInitDict.track()),
24 streams_(eventInitDict.streams()) {
25 DCHECK(receiver_);
26 DCHECK(track_);
27 }
28
29 RTCTrackEvent::RTCTrackEvent(RTCRtpReceiver* receiver,
30 MediaStreamTrack* track,
31 const HeapVector<Member<MediaStream>>& streams)
32 : Event(EventTypeNames::track, false, false),
33 receiver_(receiver),
34 track_(track),
35 streams_(streams) {
36 DCHECK(receiver_);
37 DCHECK(track_);
38 }
39
40 RTCRtpReceiver* RTCTrackEvent::receiver() const {
41 return receiver_;
42 }
43
44 MediaStreamTrack* RTCTrackEvent::track() const {
45 return track_;
46 }
47
48 HeapVector<Member<MediaStream>> RTCTrackEvent::streams() const {
49 return streams_;
50 }
51
52 DEFINE_TRACE(RTCTrackEvent) {
53 visitor->Trace(receiver_);
54 visitor->Trace(track_);
55 visitor->Trace(streams_);
56 Event::Trace(visitor);
57 }
58
59 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698