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 24 matching lines...) Expand all Loading... |
35 #include "V8TextTrack.h" | 35 #include "V8TextTrack.h" |
36 #include "core/html/track/TrackBase.h" | 36 #include "core/html/track/TrackBase.h" |
37 #include "core/html/track/TrackEvent.h" | 37 #include "core/html/track/TrackEvent.h" |
38 | 38 |
39 namespace WebCore { | 39 namespace WebCore { |
40 | 40 |
41 void V8TrackEvent::trackAttrGetterCustom(v8::Local<v8::String> name, const v8::P
ropertyCallbackInfo<v8::Value>& info) | 41 void V8TrackEvent::trackAttrGetterCustom(v8::Local<v8::String> name, const v8::P
ropertyCallbackInfo<v8::Value>& info) |
42 { | 42 { |
43 TrackEvent* trackEvent = V8TrackEvent::toNative(info.Holder()); | 43 TrackEvent* trackEvent = V8TrackEvent::toNative(info.Holder()); |
44 TrackBase* track = trackEvent->track(); | 44 TrackBase* track = trackEvent->track(); |
45 | 45 |
46 if (!track) { | 46 if (!track) { |
47 v8SetReturnValueNull(info); | 47 v8SetReturnValueNull(info); |
48 return; | 48 return; |
49 } | 49 } |
50 | 50 |
51 switch (track->type()) { | 51 switch (track->type()) { |
52 case TrackBase::BaseTrack: | 52 case TrackBase::BaseTrack: |
53 // This should never happen. | 53 // This should never happen. |
54 ASSERT_NOT_REACHED(); | 54 ASSERT_NOT_REACHED(); |
55 break; | 55 break; |
56 | 56 |
57 case TrackBase::TextTrack: | 57 case TrackBase::TextTrack: |
58 v8SetReturnValue(info, toV8Fast(static_cast<TextTrack*>(track), info, tr
ackEvent)); | 58 v8SetReturnValue(info, toV8Fast(static_cast<TextTrack*>(track), info, tr
ackEvent)); |
59 return; | 59 return; |
60 | 60 |
61 case TrackBase::AudioTrack: | 61 case TrackBase::AudioTrack: |
62 case TrackBase::VideoTrack: | 62 case TrackBase::VideoTrack: |
63 // This should not happen until VideoTrack and AudioTrack are implemente
d. | 63 // This should not happen until VideoTrack and AudioTrack are implemente
d. |
64 ASSERT_NOT_REACHED(); | 64 ASSERT_NOT_REACHED(); |
65 break; | 65 break; |
66 } | 66 } |
67 | 67 |
68 v8SetReturnValueNull(info); | 68 v8SetReturnValueNull(info); |
69 } | 69 } |
70 | 70 |
71 } // namespace WebCore | 71 } // namespace WebCore |
72 | 72 |
OLD | NEW |