| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 #if !ENABLE(OILPAN) | 54 #if !ENABLE(OILPAN) |
| 55 void LoadableTextTrack::clearTrackElement() | 55 void LoadableTextTrack::clearTrackElement() |
| 56 { | 56 { |
| 57 m_trackElement = nullptr; | 57 m_trackElement = nullptr; |
| 58 } | 58 } |
| 59 #endif | 59 #endif |
| 60 | 60 |
| 61 void LoadableTextTrack::setMode(const AtomicString& mode) | 61 void LoadableTextTrack::setMode(const AtomicString& mode) |
| 62 { | 62 { |
| 63 TextTrack::setMode(mode); | 63 TextTrack::setMode(mode); |
| 64 #if !ENABLE(OILPAN) |
| 64 if (!m_trackElement) | 65 if (!m_trackElement) |
| 65 return; | 66 return; |
| 67 #endif |
| 66 | 68 |
| 67 if (m_trackElement->readyState() == HTMLTrackElement::NONE) | 69 if (m_trackElement->readyState() == HTMLTrackElement::NONE) |
| 68 m_trackElement->scheduleLoad(); | 70 m_trackElement->scheduleLoad(); |
| 69 } | 71 } |
| 70 | 72 |
| 71 void LoadableTextTrack::scheduleLoad(const KURL& url) | 73 void LoadableTextTrack::scheduleLoad(const KURL& url) |
| 72 { | 74 { |
| 73 if (url == m_url) { | 75 if (url == m_url) { |
| 74 // If loading of the resource from this URL is in progress, return early
. | 76 // If loading of the resource from this URL is in progress, return early
. |
| 75 ASSERT(m_loader && m_trackElement); | 77 ASSERT(m_loader && m_trackElement); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 91 // was responsible for creating the text track or changing the text track mo
de. | 93 // was responsible for creating the text track or changing the text track mo
de. |
| 92 if (!m_loadTimer.isActive()) | 94 if (!m_loadTimer.isActive()) |
| 93 m_loadTimer.startOneShot(0, FROM_HERE); | 95 m_loadTimer.startOneShot(0, FROM_HERE); |
| 94 } | 96 } |
| 95 | 97 |
| 96 void LoadableTextTrack::loadTimerFired(Timer<LoadableTextTrack>*) | 98 void LoadableTextTrack::loadTimerFired(Timer<LoadableTextTrack>*) |
| 97 { | 99 { |
| 98 if (m_loader) | 100 if (m_loader) |
| 99 m_loader->cancelLoad(); | 101 m_loader->cancelLoad(); |
| 100 | 102 |
| 103 #if !ENABLE(OILPAN) |
| 101 if (!m_trackElement) | 104 if (!m_trackElement) |
| 102 return; | 105 return; |
| 106 #endif |
| 103 | 107 |
| 104 // 4.8.10.12.3 Sourcing out-of-band text tracks (continued) | 108 // 4.8.10.12.3 Sourcing out-of-band text tracks (continued) |
| 105 | 109 |
| 106 // 4. Download: If URL is not the empty string, perform a potentially CORS-e
nabled fetch of URL, with the | 110 // 4. Download: If URL is not the empty string, perform a potentially CORS-e
nabled fetch of URL, with the |
| 107 // mode being the state of the media element's crossorigin content attribute
, the origin being the | 111 // mode being the state of the media element's crossorigin content attribute
, the origin being the |
| 108 // origin of the media element's Document, and the default origin behaviour
set to fail. | 112 // origin of the media element's Document, and the default origin behaviour
set to fail. |
| 109 m_loader = TextTrackLoader::create(*this, m_trackElement->document()); | 113 m_loader = TextTrackLoader::create(*this, m_trackElement->document()); |
| 110 if (!m_loader->load(m_url, m_trackElement->mediaElementCrossOriginAttribute(
))) | 114 if (!m_loader->load(m_url, m_trackElement->mediaElementCrossOriginAttribute(
))) |
| 111 m_trackElement->didCompleteLoad(HTMLTrackElement::Failure); | 115 m_trackElement->didCompleteLoad(HTMLTrackElement::Failure); |
| 112 } | 116 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 127 } | 131 } |
| 128 | 132 |
| 129 if (mediaElement()) | 133 if (mediaElement()) |
| 130 mediaElement()->textTrackAddCues(this, m_cues.get()); | 134 mediaElement()->textTrackAddCues(this, m_cues.get()); |
| 131 } | 135 } |
| 132 | 136 |
| 133 void LoadableTextTrack::cueLoadingCompleted(TextTrackLoader* loader, bool loadin
gFailed) | 137 void LoadableTextTrack::cueLoadingCompleted(TextTrackLoader* loader, bool loadin
gFailed) |
| 134 { | 138 { |
| 135 ASSERT_UNUSED(loader, m_loader == loader); | 139 ASSERT_UNUSED(loader, m_loader == loader); |
| 136 | 140 |
| 141 #if !ENABLE(OILPAN) |
| 137 if (!m_trackElement) | 142 if (!m_trackElement) |
| 138 return; | 143 return; |
| 144 #endif |
| 139 | 145 |
| 140 m_trackElement->didCompleteLoad(loadingFailed ? HTMLTrackElement::Failure :
HTMLTrackElement::Success); | 146 m_trackElement->didCompleteLoad(loadingFailed ? HTMLTrackElement::Failure :
HTMLTrackElement::Success); |
| 141 } | 147 } |
| 142 | 148 |
| 143 void LoadableTextTrack::newRegionsAvailable(TextTrackLoader* loader) | 149 void LoadableTextTrack::newRegionsAvailable(TextTrackLoader* loader) |
| 144 { | 150 { |
| 145 ASSERT_UNUSED(loader, m_loader == loader); | 151 ASSERT_UNUSED(loader, m_loader == loader); |
| 146 | 152 |
| 147 WillBeHeapVector<RefPtrWillBeMember<VTTRegion> > newRegions; | 153 WillBeHeapVector<RefPtrWillBeMember<VTTRegion> > newRegions; |
| 148 m_loader->getNewRegions(newRegions); | 154 m_loader->getNewRegions(newRegions); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 172 } | 178 } |
| 173 | 179 |
| 174 void LoadableTextTrack::trace(Visitor* visitor) | 180 void LoadableTextTrack::trace(Visitor* visitor) |
| 175 { | 181 { |
| 176 visitor->trace(m_trackElement); | 182 visitor->trace(m_trackElement); |
| 177 visitor->trace(m_loader); | 183 visitor->trace(m_loader); |
| 178 TextTrack::trace(visitor); | 184 TextTrack::trace(visitor); |
| 179 } | 185 } |
| 180 | 186 |
| 181 } // namespace WebCore | 187 } // namespace WebCore |
| OLD | NEW |