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

Side by Side Diff: third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp

Issue 2748463002: Split header modification out of willSendRequest
Patch Set: bug fix Created 3 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
« no previous file with comments | « third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp ('k') | 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, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2010, 2011 Apple Inc. All rights reserved.
3 * (C) 2007 Graham Dennis (graham.dennis@gmail.com) 3 * (C) 2007 Graham Dennis (graham.dennis@gmail.com)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 } 212 }
213 } 213 }
214 214
215 bool crossOrigin = !SecurityOrigin::areSameSchemeHostPort( 215 bool crossOrigin = !SecurityOrigin::areSameSchemeHostPort(
216 redirectResponse.url(), newRequest.url()); 216 redirectResponse.url(), newRequest.url());
217 m_fetcher->recordResourceTimingOnRedirect(m_resource.get(), redirectResponse, 217 m_fetcher->recordResourceTimingOnRedirect(m_resource.get(), redirectResponse,
218 crossOrigin); 218 crossOrigin);
219 219
220 newRequest.setAllowStoredCredentials(m_resource->options().allowCredentials == 220 newRequest.setAllowStoredCredentials(m_resource->options().allowCredentials ==
221 AllowStoredCredentials); 221 AllowStoredCredentials);
222 222 context().prepareRequest(m_resource->identifier(), newRequest);
223 context().dispatchWillSendRequest(m_resource->identifier(), newRequest, 223 context().dispatchWillSendRequest(m_resource->identifier(), newRequest,
224 redirectResponse, 224 redirectResponse,
225 m_resource->options().initiatorInfo); 225 m_resource->options().initiatorInfo);
226 226
227 // ResourceFetcher::willFollowRedirect() may rewrite the URL to 227 // FetchContext::prepareRequest() may rewrite the URL to
228 // something else not for rejecting redirect but for other reasons. 228 // something else not for rejecting redirect but for other reasons.
229 // E.g. WebFrameTestClient::willSendRequest() and 229 // E.g. WebFrameTestClient::willSendRequest() and
230 // RenderFrameImpl::willSendRequest(). We should reflect the 230 // RenderFrameImpl::willSendRequest(). We should reflect the
231 // rewriting but currently we cannot. So, return false to make the 231 // rewriting but currently we cannot. So, return false to make the
232 // redirect fail. 232 // redirect fail.
233 if (newRequest.url() != originalURL) { 233 if (newRequest.url() != originalURL) {
234 cancelForRedirectAccessCheckError(newRequest.url(), 234 cancelForRedirectAccessCheckError(newRequest.url(),
235 ResourceRequestBlockedReason::Other); 235 ResourceRequestBlockedReason::Other);
236 return false; 236 return false;
237 } 237 }
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 return; 519 return;
520 520
521 // Don't activate if cache policy is explicitly set. 521 // Don't activate if cache policy is explicitly set.
522 if (request.getCachePolicy() != WebCachePolicy::UseProtocolCachePolicy) 522 if (request.getCachePolicy() != WebCachePolicy::UseProtocolCachePolicy)
523 return; 523 return;
524 524
525 m_isCacheAwareLoadingActivated = true; 525 m_isCacheAwareLoadingActivated = true;
526 } 526 }
527 527
528 } // namespace blink 528 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698