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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 } else { | 131 } else { |
132 // Cross-origin resources that are not suitably CORS-enabled may not loa
d. | 132 // Cross-origin resources that are not suitably CORS-enabled may not loa
d. |
133 if (!m_document.securityOrigin()->canRequest(url)) { | 133 if (!m_document.securityOrigin()->canRequest(url)) { |
134 corsPolicyPreventedLoad(); | 134 corsPolicyPreventedLoad(); |
135 return false; | 135 return false; |
136 } | 136 } |
137 } | 137 } |
138 | 138 |
139 ResourceFetcher* fetcher = m_document.fetcher(); | 139 ResourceFetcher* fetcher = m_document.fetcher(); |
140 m_resource = fetcher->fetchRawResource(cueRequest); | 140 m_resource = fetcher->fetchRawResource(cueRequest); |
141 if (m_resource) | 141 if (!m_resource) |
142 m_resource->addClient(this); | 142 return false; |
143 | 143 m_resource->addClient(this); |
144 m_client.cueLoadingStarted(this); | 144 m_client.cueLoadingStarted(this); |
145 | |
146 return true; | 145 return true; |
147 } | 146 } |
148 | 147 |
149 void TextTrackLoader::newCuesParsed() | 148 void TextTrackLoader::newCuesParsed() |
150 { | 149 { |
151 if (m_cueLoadTimer.isActive()) | 150 if (m_cueLoadTimer.isActive()) |
152 return; | 151 return; |
153 | 152 |
154 m_newCuesAvailable = true; | 153 m_newCuesAvailable = true; |
155 m_cueLoadTimer.startOneShot(0); | 154 m_cueLoadTimer.startOneShot(0); |
(...skipping 22 matching lines...) Expand all Loading... |
178 if (m_cueParser) | 177 if (m_cueParser) |
179 m_cueParser->getNewCues(outputCues); | 178 m_cueParser->getNewCues(outputCues); |
180 } | 179 } |
181 | 180 |
182 void TextTrackLoader::getNewRegions(Vector<RefPtr<TextTrackRegion> >& outputRegi
ons) | 181 void TextTrackLoader::getNewRegions(Vector<RefPtr<TextTrackRegion> >& outputRegi
ons) |
183 { | 182 { |
184 ASSERT(m_cueParser); | 183 ASSERT(m_cueParser); |
185 if (m_cueParser) | 184 if (m_cueParser) |
186 m_cueParser->getNewRegions(outputRegions); | 185 m_cueParser->getNewRegions(outputRegions); |
187 } | 186 } |
| 187 |
188 } | 188 } |
189 | |
OLD | NEW |