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

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

Issue 12568009: Merge 145735 "REGRESSION(r137607): Redirecting a post to a get then reloading triggers resubmit war… (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1410/
Patch Set: Created 7 years, 9 months 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
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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 return true; 124 return true;
125 } 125 }
126 126
127 void SubresourceLoader::willSendRequest(ResourceRequest& newRequest, const Resou rceResponse& redirectResponse) 127 void SubresourceLoader::willSendRequest(ResourceRequest& newRequest, const Resou rceResponse& redirectResponse)
128 { 128 {
129 // Store the previous URL because the call to ResourceLoader::willSendReques t will modify it. 129 // Store the previous URL because the call to ResourceLoader::willSendReques t will modify it.
130 KURL previousURL = request().url(); 130 KURL previousURL = request().url();
131 RefPtr<SubresourceLoader> protect(this); 131 RefPtr<SubresourceLoader> protect(this);
132 132
133 ASSERT(!newRequest.isNull()); 133 ASSERT(!newRequest.isNull());
134 if (!previousURL.isNull() && previousURL != newRequest.url()) { 134 if (!redirectResponse.isNull()) {
135 if (!m_documentLoader->cachedResourceLoader()->canRequest(m_resource->ty pe(), newRequest.url())) { 135 if (!m_documentLoader->cachedResourceLoader()->canRequest(m_resource->ty pe(), newRequest.url())) {
136 cancel(); 136 cancel();
137 return; 137 return;
138 } 138 }
139 if (m_resource->type() == CachedResource::ImageResource && m_documentLoa der->cachedResourceLoader()->shouldDeferImageLoad(newRequest.url())) { 139 if (m_resource->type() == CachedResource::ImageResource && m_documentLoa der->cachedResourceLoader()->shouldDeferImageLoad(newRequest.url())) {
140 cancel(); 140 cancel();
141 return; 141 return;
142 } 142 }
143 m_resource->willSendRequest(newRequest, redirectResponse); 143 m_resource->willSendRequest(newRequest, redirectResponse);
144 } 144 }
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 m_documentLoader->cachedResourceLoader()->loadDone(m_resource); 322 m_documentLoader->cachedResourceLoader()->loadDone(m_resource);
323 if (reachedTerminalState()) 323 if (reachedTerminalState())
324 return; 324 return;
325 m_resource->stopLoading(); 325 m_resource->stopLoading();
326 m_documentLoader->removeSubresourceLoader(this); 326 m_documentLoader->removeSubresourceLoader(this);
327 } 327 }
328 ResourceLoader::releaseResources(); 328 ResourceLoader::releaseResources();
329 } 329 }
330 330
331 } 331 }
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/navigation/post-redirect-get-reload-expected.txt ('k') | Source/WebCore/testing/Internals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698