Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(544)

Side by Side Diff: Source/WebCore/loader/SubresourceLoader.cpp

Issue 11312006: Merge 132287 - Crash in WebCore::SubresourceLoader::willSendRequest. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1271/
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698