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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 if (!m_trackElement) | 83 if (!m_trackElement) |
84 return; | 84 return; |
85 | 85 |
86 // 4.8.10.12.3 Sourcing out-of-band text tracks (continued) | 86 // 4.8.10.12.3 Sourcing out-of-band text tracks (continued) |
87 | 87 |
88 // 4. Download: If URL is not the empty string, perform a potentially CORS-e
nabled fetch of URL, with the | 88 // 4. Download: If URL is not the empty string, perform a potentially CORS-e
nabled fetch of URL, with the |
89 // mode being the state of the media element's crossorigin content attribute
, the origin being the | 89 // mode being the state of the media element's crossorigin content attribute
, the origin being the |
90 // origin of the media element's Document, and the default origin behaviour
set to fail. | 90 // origin of the media element's Document, and the default origin behaviour
set to fail. |
91 m_loader = TextTrackLoader::create(*this, m_trackElement->document()); | 91 m_loader = TextTrackLoader::create(*this, m_trackElement->document()); |
92 if (!m_loader->load(m_url, m_trackElement->mediaElementCrossOriginAttribute(
))) | 92 if (!m_loader->load(m_url, m_trackElement->mediaElementCrossOriginAttribute(
))) |
93 m_trackElement->didCompleteLoad(this, HTMLTrackElement::Failure); | 93 m_trackElement->didCompleteLoad(HTMLTrackElement::Failure); |
94 } | 94 } |
95 | 95 |
96 void LoadableTextTrack::newCuesAvailable(TextTrackLoader* loader) | 96 void LoadableTextTrack::newCuesAvailable(TextTrackLoader* loader) |
97 { | 97 { |
98 ASSERT_UNUSED(loader, m_loader == loader); | 98 ASSERT_UNUSED(loader, m_loader == loader); |
99 | 99 |
100 Vector<RefPtr<TextTrackCue> > newCues; | 100 Vector<RefPtr<TextTrackCue> > newCues; |
101 m_loader->getNewCues(newCues); | 101 m_loader->getNewCues(newCues); |
102 | 102 |
103 if (!m_cues) | 103 if (!m_cues) |
(...skipping 13 matching lines...) Expand all Loading... |
117 ASSERT_UNUSED(loader, m_loader == loader); | 117 ASSERT_UNUSED(loader, m_loader == loader); |
118 } | 118 } |
119 | 119 |
120 void LoadableTextTrack::cueLoadingCompleted(TextTrackLoader* loader, bool loadin
gFailed) | 120 void LoadableTextTrack::cueLoadingCompleted(TextTrackLoader* loader, bool loadin
gFailed) |
121 { | 121 { |
122 ASSERT_UNUSED(loader, m_loader == loader); | 122 ASSERT_UNUSED(loader, m_loader == loader); |
123 | 123 |
124 if (!m_trackElement) | 124 if (!m_trackElement) |
125 return; | 125 return; |
126 | 126 |
127 m_trackElement->didCompleteLoad(this, loadingFailed ? HTMLTrackElement::Fail
ure : HTMLTrackElement::Success); | 127 m_trackElement->didCompleteLoad(loadingFailed ? HTMLTrackElement::Failure :
HTMLTrackElement::Success); |
128 } | 128 } |
129 | 129 |
130 void LoadableTextTrack::newRegionsAvailable(TextTrackLoader* loader) | 130 void LoadableTextTrack::newRegionsAvailable(TextTrackLoader* loader) |
131 { | 131 { |
132 ASSERT_UNUSED(loader, m_loader == loader); | 132 ASSERT_UNUSED(loader, m_loader == loader); |
133 | 133 |
134 Vector<RefPtr<TextTrackRegion> > newRegions; | 134 Vector<RefPtr<TextTrackRegion> > newRegions; |
135 m_loader->getNewRegions(newRegions); | 135 m_loader->getNewRegions(newRegions); |
136 | 136 |
137 for (size_t i = 0; i < newRegions.size(); ++i) { | 137 for (size_t i = 0; i < newRegions.size(); ++i) { |
(...skipping 15 matching lines...) Expand all Loading... |
153 return index; | 153 return index; |
154 ++index; | 154 ++index; |
155 } | 155 } |
156 ASSERT_NOT_REACHED(); | 156 ASSERT_NOT_REACHED(); |
157 | 157 |
158 return 0; | 158 return 0; |
159 } | 159 } |
160 | 160 |
161 } // namespace WebCore | 161 } // namespace WebCore |
162 | 162 |
OLD | NEW |