OLD | NEW |
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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 } | 118 } |
119 | 119 |
120 void ResourceLoader::cancel() { | 120 void ResourceLoader::cancel() { |
121 didFail(nullptr, ResourceError::cancelledError( | 121 didFail(nullptr, ResourceError::cancelledError( |
122 m_resource->lastResourceRequest().url())); | 122 m_resource->lastResourceRequest().url())); |
123 } | 123 } |
124 | 124 |
125 void ResourceLoader::willFollowRedirect( | 125 void ResourceLoader::willFollowRedirect( |
126 WebURLLoader*, | 126 WebURLLoader*, |
127 WebURLRequest& passedNewRequest, | 127 WebURLRequest& passedNewRequest, |
128 const WebURLResponse& passedRedirectResponse, | 128 const WebURLResponse& passedRedirectResponse) { |
129 int64_t encodedDataLength) { | |
130 DCHECK(!passedNewRequest.isNull()); | 129 DCHECK(!passedNewRequest.isNull()); |
131 DCHECK(!passedRedirectResponse.isNull()); | 130 DCHECK(!passedRedirectResponse.isNull()); |
132 | 131 |
133 ResourceRequest& newRequest(passedNewRequest.toMutableResourceRequest()); | 132 ResourceRequest& newRequest(passedNewRequest.toMutableResourceRequest()); |
134 const ResourceResponse& redirectResponse( | 133 const ResourceResponse& redirectResponse( |
135 passedRedirectResponse.toResourceResponse()); | 134 passedRedirectResponse.toResourceResponse()); |
136 newRequest.setRedirectStatus( | 135 newRequest.setRedirectStatus( |
137 ResourceRequest::RedirectStatus::FollowedRedirect); | 136 ResourceRequest::RedirectStatus::FollowedRedirect); |
138 | 137 |
139 if (m_fetcher->willFollowRedirect(m_resource.get(), newRequest, | 138 if (m_fetcher->willFollowRedirect(m_resource.get(), newRequest, |
140 redirectResponse, encodedDataLength)) { | 139 redirectResponse)) { |
141 m_resource->willFollowRedirect(newRequest, redirectResponse); | 140 m_resource->willFollowRedirect(newRequest, redirectResponse); |
142 } else { | 141 } else { |
143 m_resource->willNotFollowRedirect(); | 142 m_resource->willNotFollowRedirect(); |
144 if (m_loader) | 143 if (m_loader) |
145 didFail(nullptr, | 144 didFail(nullptr, |
146 ResourceError::cancelledDueToAccessCheckError(newRequest.url())); | 145 ResourceError::cancelledDueToAccessCheckError(newRequest.url())); |
147 } | 146 } |
148 } | 147 } |
149 | 148 |
150 void ResourceLoader::didReceiveCachedMetadata(WebURLLoader*, | 149 void ResourceLoader::didReceiveCachedMetadata(WebURLLoader*, |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 // a 304, where it will overwrite the cached data we should be reusing. | 235 // a 304, where it will overwrite the cached data we should be reusing. |
237 if (dataOut.size()) { | 236 if (dataOut.size()) { |
238 m_fetcher->didReceiveData(m_resource.get(), dataOut.data(), dataOut.size(), | 237 m_fetcher->didReceiveData(m_resource.get(), dataOut.data(), dataOut.size(), |
239 encodedDataLength); | 238 encodedDataLength); |
240 m_resource->setResourceBuffer(dataOut); | 239 m_resource->setResourceBuffer(dataOut); |
241 } | 240 } |
242 didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength); | 241 didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength); |
243 } | 242 } |
244 | 243 |
245 } // namespace blink | 244 } // namespace blink |
OLD | NEW |