| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 { | 116 { |
| 117 if (m_loader) | 117 if (m_loader) |
| 118 m_loader->didChangePriority(static_cast<WebURLRequest::Priority>(loadPri
ority), intraPriorityValue); | 118 m_loader->didChangePriority(static_cast<WebURLRequest::Priority>(loadPri
ority), intraPriorityValue); |
| 119 } | 119 } |
| 120 | 120 |
| 121 void ResourceLoader::cancel() | 121 void ResourceLoader::cancel() |
| 122 { | 122 { |
| 123 didFail(nullptr, ResourceError::cancelledError(m_resource->lastResourceReque
st().url())); | 123 didFail(nullptr, ResourceError::cancelledError(m_resource->lastResourceReque
st().url())); |
| 124 } | 124 } |
| 125 | 125 |
| 126 void ResourceLoader::willFollowRedirect(WebURLLoader*, WebURLRequest& passedNewR
equest, const WebURLResponse& passedRedirectResponse, int64_t encodedDataLength) | 126 void ResourceLoader::willFollowRedirect(WebURLLoader*, WebURLRequest& passedNewR
equest, const WebURLResponse& passedRedirectResponse) |
| 127 { | 127 { |
| 128 ASSERT(!passedNewRequest.isNull()); | 128 ASSERT(!passedNewRequest.isNull()); |
| 129 ASSERT(!passedRedirectResponse.isNull()); | 129 ASSERT(!passedRedirectResponse.isNull()); |
| 130 | 130 |
| 131 ResourceRequest& newRequest(passedNewRequest.toMutableResourceRequest()); | 131 ResourceRequest& newRequest(passedNewRequest.toMutableResourceRequest()); |
| 132 const ResourceResponse& redirectResponse(passedRedirectResponse.toResourceRe
sponse()); | 132 const ResourceResponse& redirectResponse(passedRedirectResponse.toResourceRe
sponse()); |
| 133 newRequest.setRedirectStatus(ResourceRequest::RedirectStatus::FollowedRedire
ct); | 133 newRequest.setRedirectStatus(ResourceRequest::RedirectStatus::FollowedRedire
ct); |
| 134 | 134 |
| 135 if (m_fetcher->willFollowRedirect(m_resource.get(), newRequest, redirectResp
onse, encodedDataLength)) { | 135 if (m_fetcher->willFollowRedirect(m_resource.get(), newRequest, redirectResp
onse)) { |
| 136 m_resource->willFollowRedirect(newRequest, redirectResponse); | 136 m_resource->willFollowRedirect(newRequest, redirectResponse); |
| 137 } else { | 137 } else { |
| 138 m_resource->willNotFollowRedirect(); | 138 m_resource->willNotFollowRedirect(); |
| 139 if (m_loader) | 139 if (m_loader) |
| 140 didFail(nullptr, ResourceError::cancelledDueToAccessCheckError(newRe
quest.url())); | 140 didFail(nullptr, ResourceError::cancelledDueToAccessCheckError(newRe
quest.url())); |
| 141 } | 141 } |
| 142 } | 142 } |
| 143 | 143 |
| 144 void ResourceLoader::didReceiveCachedMetadata(WebURLLoader*, const char* data, i
nt length) | 144 void ResourceLoader::didReceiveCachedMetadata(WebURLLoader*, const char* data, i
nt length) |
| 145 { | 145 { |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 // empty buffer is a noop in most cases, but is destructive in the case of | 220 // empty buffer is a noop in most cases, but is destructive in the case of |
| 221 // a 304, where it will overwrite the cached data we should be reusing. | 221 // a 304, where it will overwrite the cached data we should be reusing. |
| 222 if (dataOut.size()) { | 222 if (dataOut.size()) { |
| 223 m_fetcher->didReceiveData(m_resource.get(), dataOut.data(), dataOut.size
(), encodedDataLength); | 223 m_fetcher->didReceiveData(m_resource.get(), dataOut.data(), dataOut.size
(), encodedDataLength); |
| 224 m_resource->setResourceBuffer(dataOut); | 224 m_resource->setResourceBuffer(dataOut); |
| 225 } | 225 } |
| 226 didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength); | 226 didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength); |
| 227 } | 227 } |
| 228 | 228 |
| 229 } // namespace blink | 229 } // namespace blink |
| OLD | NEW |