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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 } | 55 } |
56 | 56 |
57 if (m_state >= Finished) | 57 if (m_state >= Finished) |
58 m_client->cueLoadingCompleted(this, m_state == Failed); | 58 m_client->cueLoadingCompleted(this, m_state == Failed); |
59 } | 59 } |
60 | 60 |
61 void TextTrackLoader::cancelLoad() { | 61 void TextTrackLoader::cancelLoad() { |
62 clearResource(); | 62 clearResource(); |
63 } | 63 } |
64 | 64 |
65 void TextTrackLoader::redirectReceived(Resource* resource, | 65 bool TextTrackLoader::redirectReceived(Resource* resource, |
66 ResourceRequest& request, | 66 const ResourceRequest& request, |
67 const ResourceResponse&) { | 67 const ResourceResponse&) { |
68 DCHECK_EQ(this->resource(), resource); | 68 DCHECK_EQ(this->resource(), resource); |
69 if (resource->options().corsEnabled == IsCORSEnabled || | 69 if (resource->options().corsEnabled == IsCORSEnabled || |
70 document().getSecurityOrigin()->canRequestNoSuborigin(request.url())) | 70 document().getSecurityOrigin()->canRequestNoSuborigin(request.url())) |
71 return; | 71 return true; |
72 | 72 |
73 corsPolicyPreventedLoad(document().getSecurityOrigin(), request.url()); | 73 corsPolicyPreventedLoad(document().getSecurityOrigin(), request.url()); |
74 if (!m_cueLoadTimer.isActive()) | 74 if (!m_cueLoadTimer.isActive()) |
75 m_cueLoadTimer.startOneShot(0, BLINK_FROM_HERE); | 75 m_cueLoadTimer.startOneShot(0, BLINK_FROM_HERE); |
76 clearResource(); | 76 clearResource(); |
| 77 return false; |
77 } | 78 } |
78 | 79 |
79 void TextTrackLoader::dataReceived(Resource* resource, | 80 void TextTrackLoader::dataReceived(Resource* resource, |
80 const char* data, | 81 const char* data, |
81 size_t length) { | 82 size_t length) { |
82 DCHECK_EQ(this->resource(), resource); | 83 DCHECK_EQ(this->resource(), resource); |
83 | 84 |
84 if (m_state == Failed) | 85 if (m_state == Failed) |
85 return; | 86 return; |
86 | 87 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 | 176 |
176 DEFINE_TRACE(TextTrackLoader) { | 177 DEFINE_TRACE(TextTrackLoader) { |
177 visitor->trace(m_client); | 178 visitor->trace(m_client); |
178 visitor->trace(m_cueParser); | 179 visitor->trace(m_cueParser); |
179 visitor->trace(m_document); | 180 visitor->trace(m_document); |
180 ResourceOwner<RawResource>::trace(visitor); | 181 ResourceOwner<RawResource>::trace(visitor); |
181 VTTParserClient::trace(visitor); | 182 VTTParserClient::trace(visitor); |
182 } | 183 } |
183 | 184 |
184 } // namespace blink | 185 } // namespace blink |
OLD | NEW |