OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2009 Apple 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 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 | 157 |
158 bool SubresourceLoader::isSubresourceLoader() | 158 bool SubresourceLoader::isSubresourceLoader() |
159 { | 159 { |
160 return true; | 160 return true; |
161 } | 161 } |
162 | 162 |
163 void SubresourceLoader::willSendRequest(ResourceRequest& newRequest, const Resou
rceResponse& redirectResponse) | 163 void SubresourceLoader::willSendRequest(ResourceRequest& newRequest, const Resou
rceResponse& redirectResponse) |
164 { | 164 { |
165 // Store the previous URL because the call to ResourceLoader::willSendReques
t will modify it. | 165 // Store the previous URL because the call to ResourceLoader::willSendReques
t will modify it. |
166 KURL previousURL = request().url(); | 166 KURL previousURL = request().url(); |
| 167 RefPtr<SubresourceLoader> protect(this); |
167 | 168 |
168 ResourceLoader::willSendRequest(newRequest, redirectResponse); | 169 ResourceLoader::willSendRequest(newRequest, redirectResponse); |
169 if (!previousURL.isNull() && !newRequest.isNull() && previousURL != newReque
st.url()) { | 170 if (!previousURL.isNull() && !newRequest.isNull() && previousURL != newReque
st.url()) { |
170 if (!m_document->cachedResourceLoader()->canRequest(m_resource->type(),
newRequest.url())) { | 171 if (!m_document->cachedResourceLoader()->canRequest(m_resource->type(),
newRequest.url())) { |
171 cancel(); | 172 cancel(); |
172 return; | 173 return; |
173 } | 174 } |
174 m_resource->willSendRequest(newRequest, redirectResponse); | 175 m_resource->willSendRequest(newRequest, redirectResponse); |
175 } | 176 } |
176 } | 177 } |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 if (reachedTerminalState()) | 341 if (reachedTerminalState()) |
341 return; | 342 return; |
342 m_resource->stopLoading(); | 343 m_resource->stopLoading(); |
343 m_documentLoader->removeSubresourceLoader(this); | 344 m_documentLoader->removeSubresourceLoader(this); |
344 } | 345 } |
345 m_document = 0; | 346 m_document = 0; |
346 ResourceLoader::releaseResources(); | 347 ResourceLoader::releaseResources(); |
347 } | 348 } |
348 | 349 |
349 } | 350 } |
OLD | NEW |