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

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

Issue 2025633002: Move 'ContentSecurityPolicy::RedirectStatus' into 'ResourceRequest' (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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, 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 didFail(nullptr, ResourceError::cancelledError(m_resource->lastResourceReque st().url())); 110 didFail(nullptr, ResourceError::cancelledError(m_resource->lastResourceReque st().url()));
111 } 111 }
112 112
113 void ResourceLoader::willFollowRedirect(WebURLLoader*, WebURLRequest& passedNewR equest, const WebURLResponse& passedRedirectResponse) 113 void ResourceLoader::willFollowRedirect(WebURLLoader*, WebURLRequest& passedNewR equest, const WebURLResponse& passedRedirectResponse)
114 { 114 {
115 ASSERT(!passedNewRequest.isNull()); 115 ASSERT(!passedNewRequest.isNull());
116 ASSERT(!passedRedirectResponse.isNull()); 116 ASSERT(!passedRedirectResponse.isNull());
117 117
118 ResourceRequest& newRequest(passedNewRequest.toMutableResourceRequest()); 118 ResourceRequest& newRequest(passedNewRequest.toMutableResourceRequest());
119 const ResourceResponse& redirectResponse(passedRedirectResponse.toResourceRe sponse()); 119 const ResourceResponse& redirectResponse(passedRedirectResponse.toResourceRe sponse());
120 newRequest.setFollowedRedirect(true); 120 newRequest.setRedirectStatus(ResourceRequest::RedirectStatus::FollowedRedire ct);
121 121
122 if (m_fetcher->willFollowRedirect(m_resource.get(), newRequest, redirectResp onse)) { 122 if (m_fetcher->willFollowRedirect(m_resource.get(), newRequest, redirectResp onse)) {
123 m_resource->willFollowRedirect(newRequest, redirectResponse); 123 m_resource->willFollowRedirect(newRequest, redirectResponse);
124 } else { 124 } else {
125 m_resource->willNotFollowRedirect(); 125 m_resource->willNotFollowRedirect();
126 if (m_loader) 126 if (m_loader)
127 didFail(nullptr, ResourceError::cancelledDueToAccessCheckError(newRe quest.url())); 127 didFail(nullptr, ResourceError::cancelledDueToAccessCheckError(newRe quest.url()));
128 } 128 }
129 } 129 }
130 130
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 // empty buffer is a noop in most cases, but is destructive in the case of 256 // empty buffer is a noop in most cases, but is destructive in the case of
257 // a 304, where it will overwrite the cached data we should be reusing. 257 // a 304, where it will overwrite the cached data we should be reusing.
258 if (dataOut.size()) { 258 if (dataOut.size()) {
259 m_fetcher->didReceiveData(m_resource.get(), dataOut.data(), dataOut.size (), encodedDataLength); 259 m_fetcher->didReceiveData(m_resource.get(), dataOut.data(), dataOut.size (), encodedDataLength);
260 m_resource->setResourceBuffer(dataOut); 260 m_resource->setResourceBuffer(dataOut);
261 } 261 }
262 didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength); 262 didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength);
263 } 263 }
264 264
265 } // namespace blink 265 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698