| 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 12 matching lines...) Expand all Loading... |
| 23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 */ | 28 */ |
| 29 | 29 |
| 30 #include "config.h" | 30 #include "config.h" |
| 31 #include "core/fetch/ResourceLoader.h" | 31 #include "core/fetch/ResourceLoader.h" |
| 32 | 32 |
| 33 #include "core/fetch/CSSStyleSheetResource.h" |
| 33 #include "core/fetch/Resource.h" | 34 #include "core/fetch/Resource.h" |
| 34 #include "core/fetch/ResourceLoaderHost.h" | 35 #include "core/fetch/ResourceLoaderHost.h" |
| 35 #include "core/fetch/ResourcePtr.h" | 36 #include "core/fetch/ResourcePtr.h" |
| 36 #include "platform/Logging.h" | 37 #include "platform/Logging.h" |
| 37 #include "platform/SharedBuffer.h" | 38 #include "platform/SharedBuffer.h" |
| 38 #include "platform/ThreadedDataReceiver.h" | 39 #include "platform/ThreadedDataReceiver.h" |
| 39 #include "platform/exported/WrappedResourceRequest.h" | 40 #include "platform/exported/WrappedResourceRequest.h" |
| 40 #include "platform/exported/WrappedResourceResponse.h" | 41 #include "platform/exported/WrappedResourceResponse.h" |
| 41 #include "platform/network/ResourceError.h" | 42 #include "platform/network/ResourceError.h" |
| 42 #include "public/platform/Platform.h" | 43 #include "public/platform/Platform.h" |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 } | 348 } |
| 348 } else { | 349 } else { |
| 349 // If the response successfully validated a cached resource, perform | 350 // If the response successfully validated a cached resource, perform |
| 350 // the access control with respect to it. Need to do this right here | 351 // the access control with respect to it. Need to do this right here |
| 351 // before the resource switches clients over to that validated resou
rce. | 352 // before the resource switches clients over to that validated resou
rce. |
| 352 Resource* resource = m_resource; | 353 Resource* resource = m_resource; |
| 353 if (resource->isCacheValidator() && resourceResponse.httpStatusCode(
) == 304) | 354 if (resource->isCacheValidator() && resourceResponse.httpStatusCode(
) == 304) |
| 354 resource = m_resource->resourceToRevalidate(); | 355 resource = m_resource->resourceToRevalidate(); |
| 355 else | 356 else |
| 356 m_resource->setResponse(resourceResponse); | 357 m_resource->setResponse(resourceResponse); |
| 357 if (!m_host->canAccessResource(resource, m_options.securityOrigin.ge
t(), response.url())) { | 358 if (!m_host->canAccessResource(resource, m_options.securityOrigin.ge
t(), response.url(), ResourceLoaderHost::ShouldLogAccessControlErrors)) { |
| 358 m_host->didReceiveResponse(m_resource, resourceResponse); | 359 m_host->didReceiveResponse(m_resource, resourceResponse); |
| 359 cancel(ResourceError::cancelledDueToAccessCheckError(KURL(respon
se.url()))); | 360 cancel(ResourceError::cancelledDueToAccessCheckError(KURL(respon
se.url()))); |
| 360 return; | 361 return; |
| 361 } | 362 } |
| 362 } | 363 } |
| 363 } | 364 } |
| 364 | 365 |
| 365 // Reference the object in this method since the additional processing can d
o | 366 // Reference the object in this method since the additional processing can d
o |
| 366 // anything including removing the last reference to this object. | 367 // anything including removing the last reference to this object. |
| 367 RefPtrWillBeRawPtr<ResourceLoader> protect(this); | 368 RefPtrWillBeRawPtr<ResourceLoader> protect(this); |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength); | 525 didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength); |
| 525 } | 526 } |
| 526 | 527 |
| 527 ResourceRequest& ResourceLoader::applyOptions(ResourceRequest& request) const | 528 ResourceRequest& ResourceLoader::applyOptions(ResourceRequest& request) const |
| 528 { | 529 { |
| 529 request.setAllowStoredCredentials(m_options.allowCredentials == AllowStoredC
redentials); | 530 request.setAllowStoredCredentials(m_options.allowCredentials == AllowStoredC
redentials); |
| 530 return request; | 531 return request; |
| 531 } | 532 } |
| 532 | 533 |
| 533 } | 534 } |
| OLD | NEW |