| 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 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 #include "config.h" | 26 #include "config.h" |
| 27 | 27 |
| 28 #include "core/loader/TextTrackLoader.h" | 28 #include "core/loader/TextTrackLoader.h" |
| 29 | 29 |
| 30 #include "FetchInitiatorTypeNames.h" | 30 #include "FetchInitiatorTypeNames.h" |
| 31 #include "core/dom/Document.h" | 31 #include "core/dom/Document.h" |
| 32 #include "core/fetch/CrossOriginAccessControl.h" | 32 #include "core/fetch/CrossOriginAccessControl.h" |
| 33 #include "core/fetch/FetchRequest.h" | 33 #include "core/fetch/FetchRequest.h" |
| 34 #include "core/fetch/ResourceFetcher.h" | 34 #include "core/fetch/ResourceFetcher.h" |
| 35 #include "core/fetch/TextTrackResource.h" | |
| 36 #include "core/html/track/WebVTTParser.h" | 35 #include "core/html/track/WebVTTParser.h" |
| 37 #include "platform/Logging.h" | 36 #include "platform/Logging.h" |
| 38 #include "platform/SharedBuffer.h" | 37 #include "platform/SharedBuffer.h" |
| 39 #include "weborigin/SecurityOrigin.h" | 38 #include "weborigin/SecurityOrigin.h" |
| 40 | 39 |
| 41 namespace WebCore { | 40 namespace WebCore { |
| 42 | 41 |
| 43 TextTrackLoader::TextTrackLoader(TextTrackLoaderClient* client, Document& docume
nt) | 42 TextTrackLoader::TextTrackLoader(TextTrackLoaderClient* client, Document& docume
nt) |
| 44 : m_client(client) | 43 : m_client(client) |
| 45 , m_document(document) | 44 , m_document(document) |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 updateRequestForAccessControl(cueRequest.mutableResourceRequest(), m_doc
ument.securityOrigin(), allowCredentials); | 130 updateRequestForAccessControl(cueRequest.mutableResourceRequest(), m_doc
ument.securityOrigin(), allowCredentials); |
| 132 } else { | 131 } else { |
| 133 // 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. |
| 134 if (!m_document.securityOrigin()->canRequest(url)) { | 133 if (!m_document.securityOrigin()->canRequest(url)) { |
| 135 corsPolicyPreventedLoad(); | 134 corsPolicyPreventedLoad(); |
| 136 return false; | 135 return false; |
| 137 } | 136 } |
| 138 } | 137 } |
| 139 | 138 |
| 140 ResourceFetcher* fetcher = m_document.fetcher(); | 139 ResourceFetcher* fetcher = m_document.fetcher(); |
| 141 m_resource = fetcher->fetchTextTrack(cueRequest); | 140 m_resource = fetcher->fetchRawResource(cueRequest); |
| 142 if (m_resource) | 141 if (m_resource) |
| 143 m_resource->addClient(this); | 142 m_resource->addClient(this); |
| 144 | 143 |
| 145 m_client->cueLoadingStarted(this); | 144 m_client->cueLoadingStarted(this); |
| 146 | 145 |
| 147 return true; | 146 return true; |
| 148 } | 147 } |
| 149 | 148 |
| 150 void TextTrackLoader::newCuesParsed() | 149 void TextTrackLoader::newCuesParsed() |
| 151 { | 150 { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 181 } | 180 } |
| 182 | 181 |
| 183 void TextTrackLoader::getNewRegions(Vector<RefPtr<TextTrackRegion> >& outputRegi
ons) | 182 void TextTrackLoader::getNewRegions(Vector<RefPtr<TextTrackRegion> >& outputRegi
ons) |
| 184 { | 183 { |
| 185 ASSERT(m_cueParser); | 184 ASSERT(m_cueParser); |
| 186 if (m_cueParser) | 185 if (m_cueParser) |
| 187 m_cueParser->getNewRegions(outputRegions); | 186 m_cueParser->getNewRegions(outputRegions); |
| 188 } | 187 } |
| 189 } | 188 } |
| 190 | 189 |
| OLD | NEW |