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 | 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 // task source must run the following steps: | 229 // task source must run the following steps: |
230 // 1. Change the text track readiness state to loaded. | 230 // 1. Change the text track readiness state to loaded. |
231 setReadyState(HTMLTrackElement::LOADED); | 231 setReadyState(HTMLTrackElement::LOADED); |
232 | 232 |
233 // 2. If the file was successfully processed, fire a simple event named
load at the | 233 // 2. If the file was successfully processed, fire a simple event named
load at the |
234 // track element. | 234 // track element. |
235 dispatchEvent(Event::create(EventTypeNames::load), IGNORE_EXCEPTION); | 235 dispatchEvent(Event::create(EventTypeNames::load), IGNORE_EXCEPTION); |
236 } | 236 } |
237 | 237 |
238 // NOTE: The values in the TextTrack::ReadinessState enum must stay in sync with
those in HTMLTrackElement::ReadyState. | 238 // NOTE: The values in the TextTrack::ReadinessState enum must stay in sync with
those in HTMLTrackElement::ReadyState. |
239 COMPILE_ASSERT(HTMLTrackElement::NONE == static_cast<HTMLTrackElement::ReadyStat
e>(TextTrack::NotLoaded), TextTrackEnumNotLoaded_Is_Wrong_Should_Be_HTMLTrackEle
mentEnumNONE); | 239 static_assert(HTMLTrackElement::NONE == static_cast<HTMLTrackElement::ReadyState
>(TextTrack::NotLoaded), "HTMLTrackElement::NONE should be in sync with TextTrac
k::NotLoaded"); |
240 COMPILE_ASSERT(HTMLTrackElement::LOADING == static_cast<HTMLTrackElement::ReadyS
tate>(TextTrack::Loading), TextTrackEnumLoadingIsWrong_ShouldBe_HTMLTrackElement
EnumLOADING); | 240 static_assert(HTMLTrackElement::LOADING == static_cast<HTMLTrackElement::ReadySt
ate>(TextTrack::Loading), "HTMLTrackElement::LOADING should be in sync with Text
Track::Loading"); |
241 COMPILE_ASSERT(HTMLTrackElement::LOADED == static_cast<HTMLTrackElement::ReadySt
ate>(TextTrack::Loaded), TextTrackEnumLoaded_Is_Wrong_Should_Be_HTMLTrackElement
EnumLOADED); | 241 static_assert(HTMLTrackElement::LOADED == static_cast<HTMLTrackElement::ReadySta
te>(TextTrack::Loaded), "HTMLTrackElement::LOADED should be in sync with TextTra
ck::Loaded"); |
242 COMPILE_ASSERT(HTMLTrackElement::TRACK_ERROR == static_cast<HTMLTrackElement::Re
adyState>(TextTrack::FailedToLoad), TextTrackEnumFailedToLoad_Is_Wrong_Should_Be
_HTMLTrackElementEnumTRACK_ERROR); | 242 static_assert(HTMLTrackElement::TRACK_ERROR == static_cast<HTMLTrackElement::Rea
dyState>(TextTrack::FailedToLoad), "HTMLTrackElement::TRACK_ERROR should be in s
ync with TextTrack::FailedToLoad"); |
243 | 243 |
244 void HTMLTrackElement::setReadyState(ReadyState state) | 244 void HTMLTrackElement::setReadyState(ReadyState state) |
245 { | 245 { |
246 ensureTrack()->setReadinessState(static_cast<TextTrack::ReadinessState>(stat
e)); | 246 ensureTrack()->setReadinessState(static_cast<TextTrack::ReadinessState>(stat
e)); |
247 if (HTMLMediaElement* parent = mediaElement()) | 247 if (HTMLMediaElement* parent = mediaElement()) |
248 return parent->textTrackReadyStateChanged(m_track.get()); | 248 return parent->textTrackReadyStateChanged(m_track.get()); |
249 } | 249 } |
250 | 250 |
251 HTMLTrackElement::ReadyState HTMLTrackElement::readyState() | 251 HTMLTrackElement::ReadyState HTMLTrackElement::readyState() |
252 { | 252 { |
(...skipping 16 matching lines...) Expand all Loading... |
269 return nullptr; | 269 return nullptr; |
270 } | 270 } |
271 | 271 |
272 void HTMLTrackElement::trace(Visitor* visitor) | 272 void HTMLTrackElement::trace(Visitor* visitor) |
273 { | 273 { |
274 visitor->trace(m_track); | 274 visitor->trace(m_track); |
275 HTMLElement::trace(visitor); | 275 HTMLElement::trace(visitor); |
276 } | 276 } |
277 | 277 |
278 } | 278 } |
OLD | NEW |