| 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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 if (!m_resource->isCacheValidator() || resourceResponse.httpStatusCo
de() != 304) | 240 if (!m_resource->isCacheValidator() || resourceResponse.httpStatusCo
de() != 304) |
| 241 m_resource->setResponse(resourceResponse); | 241 m_resource->setResponse(resourceResponse); |
| 242 if (!m_fetcher->canAccessResource(m_resource.get(), m_resource->opti
ons().securityOrigin.get(), response.url(), ResourceFetcher::ShouldLogAccessCont
rolErrors)) { | 242 if (!m_fetcher->canAccessResource(m_resource.get(), m_resource->opti
ons().securityOrigin.get(), response.url(), ResourceFetcher::ShouldLogAccessCont
rolErrors)) { |
| 243 m_fetcher->didReceiveResponse(m_resource.get(), resourceResponse
); | 243 m_fetcher->didReceiveResponse(m_resource.get(), resourceResponse
); |
| 244 cancel(ResourceError::cancelledDueToAccessCheckError(KURL(respon
se.url()))); | 244 cancel(ResourceError::cancelledDueToAccessCheckError(KURL(respon
se.url()))); |
| 245 return; | 245 return; |
| 246 } | 246 } |
| 247 } | 247 } |
| 248 } | 248 } |
| 249 | 249 |
| 250 m_resource->responseReceived(resourceResponse, handle.release()); | 250 m_resource->responseReceived(resourceResponse, std::move(handle)); |
| 251 if (m_state == ConnectionStateReleased) | 251 if (m_state == ConnectionStateReleased) |
| 252 return; | 252 return; |
| 253 | 253 |
| 254 m_fetcher->didReceiveResponse(m_resource.get(), resourceResponse); | 254 m_fetcher->didReceiveResponse(m_resource.get(), resourceResponse); |
| 255 if (m_state == ConnectionStateReleased) | 255 if (m_state == ConnectionStateReleased) |
| 256 return; | 256 return; |
| 257 | 257 |
| 258 if (m_resource->response().httpStatusCode() < 400 || m_resource->shouldIgnor
eHTTPStatusCodeErrors()) | 258 if (m_resource->response().httpStatusCode() < 400 || m_resource->shouldIgnor
eHTTPStatusCodeErrors()) |
| 259 return; | 259 return; |
| 260 cancel(ResourceError::cancelledError(resourceResponse.url())); | 260 cancel(ResourceError::cancelledError(resourceResponse.url())); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 // empty buffer is a noop in most cases, but is destructive in the case of | 348 // empty buffer is a noop in most cases, but is destructive in the case of |
| 349 // a 304, where it will overwrite the cached data we should be reusing. | 349 // a 304, where it will overwrite the cached data we should be reusing. |
| 350 if (dataOut.size()) { | 350 if (dataOut.size()) { |
| 351 m_fetcher->didReceiveData(m_resource.get(), dataOut.data(), dataOut.size
(), encodedDataLength); | 351 m_fetcher->didReceiveData(m_resource.get(), dataOut.data(), dataOut.size
(), encodedDataLength); |
| 352 m_resource->setResourceBuffer(dataOut); | 352 m_resource->setResourceBuffer(dataOut); |
| 353 } | 353 } |
| 354 didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength); | 354 didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength); |
| 355 } | 355 } |
| 356 | 356 |
| 357 } // namespace blink | 357 } // namespace blink |
| OLD | NEW |