| 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 102 |
| 103 cancelLoad(); | 103 cancelLoad(); |
| 104 } | 104 } |
| 105 | 105 |
| 106 bool TextTrackLoader::load(const KURL& url, CrossOriginAttributeValue crossOrigi
n) | 106 bool TextTrackLoader::load(const KURL& url, CrossOriginAttributeValue crossOrigi
n) |
| 107 { | 107 { |
| 108 cancelLoad(); | 108 cancelLoad(); |
| 109 | 109 |
| 110 FetchRequest cueRequest(ResourceRequest(document().completeURL(url)), FetchI
nitiatorTypeNames::texttrack); | 110 FetchRequest cueRequest(ResourceRequest(document().completeURL(url)), FetchI
nitiatorTypeNames::texttrack); |
| 111 | 111 |
| 112 if (crossOrigin != CrossOriginAttributeNotSet) { | 112 if (crossOrigin == CrossOriginAttributeNotSet && !document().getSecurityOrig
in()->canRequestNoSuborigin(url)) { |
| 113 cueRequest.setCrossOriginAccessControl(document().getSecurityOrigin(), c
rossOrigin); | |
| 114 } else if (!document().getSecurityOrigin()->canRequestNoSuborigin(url)) { | |
| 115 // Text track elements without 'crossorigin' set on the parent are "No C
ORS"; report error if not same-origin. | 113 // Text track elements without 'crossorigin' set on the parent are "No C
ORS"; report error if not same-origin. |
| 116 corsPolicyPreventedLoad(document().getSecurityOrigin(), url); | 114 corsPolicyPreventedLoad(document().getSecurityOrigin(), url); |
| 117 return false; | 115 return false; |
| 118 } | 116 } |
| 117 cueRequest.setCrossOriginAccessControl(document().getSecurityOrigin(), cross
Origin); |
| 119 | 118 |
| 120 ResourceFetcher* fetcher = document().fetcher(); | 119 ResourceFetcher* fetcher = document().fetcher(); |
| 121 setResource(RawResource::fetchTextTrack(cueRequest, fetcher)); | 120 setResource(RawResource::fetchTextTrack(cueRequest, fetcher)); |
| 122 return resource(); | 121 return resource(); |
| 123 } | 122 } |
| 124 | 123 |
| 125 void TextTrackLoader::newCuesParsed() | 124 void TextTrackLoader::newCuesParsed() |
| 126 { | 125 { |
| 127 if (m_cueLoadTimer.isActive()) | 126 if (m_cueLoadTimer.isActive()) |
| 128 return; | 127 return; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 } | 162 } |
| 164 | 163 |
| 165 DEFINE_TRACE(TextTrackLoader) | 164 DEFINE_TRACE(TextTrackLoader) |
| 166 { | 165 { |
| 167 visitor->trace(m_cueParser); | 166 visitor->trace(m_cueParser); |
| 168 visitor->trace(m_document); | 167 visitor->trace(m_document); |
| 169 ResourceOwner<RawResource>::trace(visitor); | 168 ResourceOwner<RawResource>::trace(visitor); |
| 170 } | 169 } |
| 171 | 170 |
| 172 } // namespace blink | 171 } // namespace blink |
| OLD | NEW |