| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 if (m_state >= Finished) | 61 if (m_state >= Finished) |
| 62 m_client->cueLoadingCompleted(this, m_state == Failed); | 62 m_client->cueLoadingCompleted(this, m_state == Failed); |
| 63 } | 63 } |
| 64 | 64 |
| 65 void TextTrackLoader::cancelLoad() | 65 void TextTrackLoader::cancelLoad() |
| 66 { | 66 { |
| 67 clearResource(); | 67 clearResource(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void TextTrackLoader::redirectReceived(Resource* resource, ResourceRequest& requ
est, const ResourceResponse&) |
| 71 { |
| 72 DCHECK_EQ(this->resource(), resource); |
| 73 if (resource->options().corsEnabled == IsCORSEnabled || document().getSecuri
tyOrigin()->canRequestNoSuborigin(request.url())) |
| 74 return; |
| 75 |
| 76 corsPolicyPreventedLoad(document().getSecurityOrigin(), request.url()); |
| 77 if (!m_cueLoadTimer.isActive()) |
| 78 m_cueLoadTimer.startOneShot(0, BLINK_FROM_HERE); |
| 79 clearResource(); |
| 80 } |
| 81 |
| 70 void TextTrackLoader::dataReceived(Resource* resource, const char* data, size_t
length) | 82 void TextTrackLoader::dataReceived(Resource* resource, const char* data, size_t
length) |
| 71 { | 83 { |
| 72 DCHECK_EQ(this->resource(), resource); | 84 DCHECK_EQ(this->resource(), resource); |
| 73 | 85 |
| 74 if (m_state == Failed) | 86 if (m_state == Failed) |
| 75 return; | 87 return; |
| 76 | 88 |
| 77 if (!m_cueParser) | 89 if (!m_cueParser) |
| 78 m_cueParser = VTTParser::create(this, document()); | 90 m_cueParser = VTTParser::create(this, document()); |
| 79 | 91 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 DEFINE_TRACE(TextTrackLoader) | 174 DEFINE_TRACE(TextTrackLoader) |
| 163 { | 175 { |
| 164 visitor->trace(m_client); | 176 visitor->trace(m_client); |
| 165 visitor->trace(m_cueParser); | 177 visitor->trace(m_cueParser); |
| 166 visitor->trace(m_document); | 178 visitor->trace(m_document); |
| 167 ResourceOwner<RawResource>::trace(visitor); | 179 ResourceOwner<RawResource>::trace(visitor); |
| 168 VTTParserClient::trace(visitor); | 180 VTTParserClient::trace(visitor); |
| 169 } | 181 } |
| 170 | 182 |
| 171 } // namespace blink | 183 } // namespace blink |
| OLD | NEW |