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

Side by Side Diff: third_party/WebKit/Source/modules/mediastream/MediaStreamTrackEvent.cpp

Issue 2347103003: Implement the MediaStreamTrackEvent constructor (Closed)
Patch Set: update webexposed Created 4 years, 2 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
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 10 matching lines...) Expand all
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */ 23 */
24 24
25 #include "modules/mediastream/MediaStreamTrackEvent.h" 25 #include "modules/mediastream/MediaStreamTrackEvent.h"
26 26
27 #include "modules/mediastream/MediaStreamTrack.h" 27 #include "modules/mediastream/MediaStreamTrack.h"
28 28
29 namespace blink { 29 namespace blink {
30 30
31 MediaStreamTrackEvent* MediaStreamTrackEvent::create(const AtomicString& type, b ool canBubble, bool cancelable, MediaStreamTrack* track) 31 MediaStreamTrackEvent* MediaStreamTrackEvent::create(const AtomicString& type, M ediaStreamTrack* track)
32 { 32 {
33 return new MediaStreamTrackEvent(type, canBubble, cancelable, track); 33 return new MediaStreamTrackEvent(type, track);
34 } 34 }
35 35
36 MediaStreamTrackEvent::MediaStreamTrackEvent(const AtomicString& type, bool canB ubble, bool cancelable, MediaStreamTrack* track) 36 MediaStreamTrackEvent::MediaStreamTrackEvent(const AtomicString& type, MediaStre amTrack* track)
37 : Event(type, canBubble, cancelable) 37 : Event(type, false, false)
38 , m_track(track) 38 , m_track(track)
39 { 39 {
40 DCHECK(m_track);
41 }
42
43 MediaStreamTrackEvent* MediaStreamTrackEvent::create(const AtomicString& type, c onst MediaStreamTrackEventInit& initializer)
44 {
45 return new MediaStreamTrackEvent(type, initializer);
46 }
47
48 MediaStreamTrackEvent::MediaStreamTrackEvent(const AtomicString& type, const Med iaStreamTrackEventInit& initializer)
49 : Event(type, initializer)
50 , m_track(initializer.track())
51 {
52 DCHECK(m_track);
40 } 53 }
41 54
42 MediaStreamTrackEvent::~MediaStreamTrackEvent() 55 MediaStreamTrackEvent::~MediaStreamTrackEvent()
43 { 56 {
44 } 57 }
45 58
46 MediaStreamTrack* MediaStreamTrackEvent::track() const 59 MediaStreamTrack* MediaStreamTrackEvent::track() const
47 { 60 {
48 return m_track.get(); 61 return m_track.get();
49 } 62 }
50 63
51 const AtomicString& MediaStreamTrackEvent::interfaceName() const 64 const AtomicString& MediaStreamTrackEvent::interfaceName() const
52 { 65 {
53 return EventNames::MediaStreamTrackEvent; 66 return EventNames::MediaStreamTrackEvent;
54 } 67 }
55 68
56 DEFINE_TRACE(MediaStreamTrackEvent) 69 DEFINE_TRACE(MediaStreamTrackEvent)
57 { 70 {
58 visitor->trace(m_track); 71 visitor->trace(m_track);
59 Event::trace(visitor); 72 Event::trace(visitor);
60 } 73 }
61 74
62 } // namespace blink 75 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698