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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 CrossOriginAttributeValue crossOrigin) { | 121 CrossOriginAttributeValue crossOrigin) { |
122 cancelLoad(); | 122 cancelLoad(); |
123 | 123 |
124 FetchRequest cueRequest(ResourceRequest(document().completeURL(url)), | 124 FetchRequest cueRequest(ResourceRequest(document().completeURL(url)), |
125 FetchInitiatorTypeNames::texttrack); | 125 FetchInitiatorTypeNames::texttrack); |
126 | 126 |
127 if (crossOrigin != CrossOriginAttributeNotSet) { | 127 if (crossOrigin != CrossOriginAttributeNotSet) { |
128 cueRequest.setCrossOriginAccessControl(document().getSecurityOrigin(), | 128 cueRequest.setCrossOriginAccessControl(document().getSecurityOrigin(), |
129 crossOrigin); | 129 crossOrigin); |
130 } else if (!document().getSecurityOrigin()->canRequestNoSuborigin(url)) { | 130 } else if (!document().getSecurityOrigin()->canRequestNoSuborigin(url)) { |
131 // Text track elements without 'crossorigin' set on the parent are "No CORS"
; report error if not same-origin. | 131 // Text track elements without 'crossorigin' set on the parent are "No |
| 132 // CORS"; report error if not same-origin. |
132 corsPolicyPreventedLoad(document().getSecurityOrigin(), url); | 133 corsPolicyPreventedLoad(document().getSecurityOrigin(), url); |
133 return false; | 134 return false; |
134 } | 135 } |
135 | 136 |
136 ResourceFetcher* fetcher = document().fetcher(); | 137 ResourceFetcher* fetcher = document().fetcher(); |
137 setResource(RawResource::fetchTextTrack(cueRequest, fetcher)); | 138 setResource(RawResource::fetchTextTrack(cueRequest, fetcher)); |
138 return resource(); | 139 return resource(); |
139 } | 140 } |
140 | 141 |
141 void TextTrackLoader::newCuesParsed() { | 142 void TextTrackLoader::newCuesParsed() { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 | 175 |
175 DEFINE_TRACE(TextTrackLoader) { | 176 DEFINE_TRACE(TextTrackLoader) { |
176 visitor->trace(m_client); | 177 visitor->trace(m_client); |
177 visitor->trace(m_cueParser); | 178 visitor->trace(m_cueParser); |
178 visitor->trace(m_document); | 179 visitor->trace(m_document); |
179 ResourceOwner<RawResource>::trace(visitor); | 180 ResourceOwner<RawResource>::trace(visitor); |
180 VTTParserClient::trace(visitor); | 181 VTTParserClient::trace(visitor); |
181 } | 182 } |
182 | 183 |
183 } // namespace blink | 184 } // namespace blink |
OLD | NEW |