OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 13 matching lines...) Expand all Loading... |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "V8TrackEvent.h" | 32 #include "V8TrackEvent.h" |
33 | 33 |
| 34 #include "V8AudioTrack.h" |
34 #include "V8TextTrack.h" | 35 #include "V8TextTrack.h" |
| 36 #include "V8VideoTrack.h" |
35 #include "core/html/track/TrackBase.h" | 37 #include "core/html/track/TrackBase.h" |
36 #include "core/html/track/TrackEvent.h" | 38 #include "core/html/track/TrackEvent.h" |
37 | 39 |
38 namespace WebCore { | 40 namespace WebCore { |
39 | 41 |
40 void V8TrackEvent::trackAttributeGetterCustom(const v8::PropertyCallbackInfo<v8:
:Value>& info) | 42 void V8TrackEvent::trackAttributeGetterCustom(const v8::PropertyCallbackInfo<v8:
:Value>& info) |
41 { | 43 { |
42 TrackEvent* trackEvent = V8TrackEvent::toNative(info.Holder()); | 44 TrackEvent* trackEvent = V8TrackEvent::toNative(info.Holder()); |
43 TrackBase* track = trackEvent->track(); | 45 TrackBase* track = trackEvent->track(); |
44 | 46 |
45 if (!track) { | 47 if (!track) { |
46 v8SetReturnValueNull(info); | 48 v8SetReturnValueNull(info); |
47 return; | 49 return; |
48 } | 50 } |
49 | 51 |
50 switch (track->type()) { | 52 switch (track->type()) { |
51 case TrackBase::TextTrack: | 53 case TrackBase::TextTrack: |
52 v8SetReturnValueFast(info, static_cast<TextTrack*>(track), trackEvent); | 54 v8SetReturnValueFast(info, static_cast<TextTrack*>(track), trackEvent); |
53 return; | 55 return; |
54 | 56 |
55 case TrackBase::AudioTrack: | 57 case TrackBase::AudioTrack: |
| 58 v8SetReturnValueFast(info, static_cast<AudioTrack*>(track), trackEvent); |
| 59 return; |
| 60 |
56 case TrackBase::VideoTrack: | 61 case TrackBase::VideoTrack: |
57 // This should not happen until VideoTrack and AudioTrack are implemente
d. | 62 v8SetReturnValueFast(info, static_cast<VideoTrack*>(track), trackEvent); |
58 ASSERT_NOT_REACHED(); | 63 return; |
59 break; | |
60 } | 64 } |
61 | 65 |
62 v8SetReturnValueNull(info); | 66 v8SetReturnValueNull(info); |
63 } | 67 } |
64 | 68 |
65 } // namespace WebCore | 69 } // namespace WebCore |
OLD | NEW |