OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 return; | 44 return; |
45 | 45 |
46 const VideoTrackOrAudioTrackOrTextTrack& track = initializer.track(); | 46 const VideoTrackOrAudioTrackOrTextTrack& track = initializer.track(); |
47 if (track.isVideoTrack()) | 47 if (track.isVideoTrack()) |
48 m_track = track.getAsVideoTrack(); | 48 m_track = track.getAsVideoTrack(); |
49 else if (track.isAudioTrack()) | 49 else if (track.isAudioTrack()) |
50 m_track = track.getAsAudioTrack(); | 50 m_track = track.getAsAudioTrack(); |
51 else if (track.isTextTrack()) | 51 else if (track.isTextTrack()) |
52 m_track = track.getAsTextTrack(); | 52 m_track = track.getAsTextTrack(); |
53 else | 53 else |
54 ASSERT_NOT_REACHED(); | 54 NOTREACHED(); |
55 } | 55 } |
56 | 56 |
57 TrackEvent::~TrackEvent() | 57 TrackEvent::~TrackEvent() |
58 { | 58 { |
59 } | 59 } |
60 | 60 |
61 const AtomicString& TrackEvent::interfaceName() const | 61 const AtomicString& TrackEvent::interfaceName() const |
62 { | 62 { |
63 return EventNames::TrackEvent; | 63 return EventNames::TrackEvent; |
64 } | 64 } |
65 | 65 |
66 void TrackEvent::track(VideoTrackOrAudioTrackOrTextTrack& returnValue) | 66 void TrackEvent::track(VideoTrackOrAudioTrackOrTextTrack& returnValue) |
67 { | 67 { |
68 if (!m_track) | 68 if (!m_track) |
69 return; | 69 return; |
70 | 70 |
71 switch (m_track->type()) { | 71 switch (m_track->type()) { |
72 case WebMediaPlayer::TextTrack: | 72 case WebMediaPlayer::TextTrack: |
73 returnValue.setTextTrack(toTextTrack(m_track.get())); | 73 returnValue.setTextTrack(toTextTrack(m_track.get())); |
74 break; | 74 break; |
75 case WebMediaPlayer::AudioTrack: | 75 case WebMediaPlayer::AudioTrack: |
76 returnValue.setAudioTrack(toAudioTrack(m_track.get())); | 76 returnValue.setAudioTrack(toAudioTrack(m_track.get())); |
77 break; | 77 break; |
78 case WebMediaPlayer::VideoTrack: | 78 case WebMediaPlayer::VideoTrack: |
79 returnValue.setVideoTrack(toVideoTrack(m_track.get())); | 79 returnValue.setVideoTrack(toVideoTrack(m_track.get())); |
80 break; | 80 break; |
81 default: | 81 default: |
82 ASSERT_NOT_REACHED(); | 82 NOTREACHED(); |
83 } | 83 } |
84 } | 84 } |
85 | 85 |
86 DEFINE_TRACE(TrackEvent) | 86 DEFINE_TRACE(TrackEvent) |
87 { | 87 { |
88 visitor->trace(m_track); | 88 visitor->trace(m_track); |
89 Event::trace(visitor); | 89 Event::trace(visitor); |
90 } | 90 } |
91 | 91 |
92 } // namespace blink | 92 } // namespace blink |
93 | 93 |
OLD | NEW |