| 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. |
| 11 * 2. Redistributions in binary form must reproduce the above copyright | 11 * 2. Redistributions in binary form must reproduce the above copyright |
| 12 * notice, this list of conditions and the following disclaimer in the | 12 * notice, this list of conditions and the following disclaimer in the |
| 13 * documentation and/or other materials provided with the distribution. | 13 * documentation and/or other materials provided with the distribution. |
| 14 * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of | 14 * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of |
| 15 * its contributors may be used to endorse or promote products derived | 15 * its contributors may be used to endorse or promote products derived |
| 16 * from this software without specific prior written permission. | 16 * from this software without specific prior written permission. |
| 17 * | 17 * |
| 18 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY | 18 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY |
| 19 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 19 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 20 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 20 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 21 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY | 21 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY |
| 22 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 22 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 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 "core/fetch/ResourceLoader.h" | 30 #include "platform/loader/fetch/ResourceLoader.h" |
| 31 | 31 |
| 32 #include "core/fetch/CrossOriginAccessControl.h" | |
| 33 #include "core/fetch/FetchContext.h" | |
| 34 #include "core/fetch/Resource.h" | |
| 35 #include "core/fetch/ResourceFetcher.h" | |
| 36 #include "platform/SharedBuffer.h" | 32 #include "platform/SharedBuffer.h" |
| 37 #include "platform/exported/WrappedResourceRequest.h" | 33 #include "platform/exported/WrappedResourceRequest.h" |
| 38 #include "platform/exported/WrappedResourceResponse.h" | 34 #include "platform/exported/WrappedResourceResponse.h" |
| 35 #include "platform/loader/fetch/CrossOriginAccessControl.h" |
| 36 #include "platform/loader/fetch/FetchContext.h" |
| 37 #include "platform/loader/fetch/Resource.h" |
| 38 #include "platform/loader/fetch/ResourceFetcher.h" |
| 39 #include "platform/network/NetworkInstrumentation.h" | 39 #include "platform/network/NetworkInstrumentation.h" |
| 40 #include "platform/network/ResourceError.h" | 40 #include "platform/network/ResourceError.h" |
| 41 #include "public/platform/Platform.h" | 41 #include "public/platform/Platform.h" |
| 42 #include "public/platform/WebCachePolicy.h" | 42 #include "public/platform/WebCachePolicy.h" |
| 43 #include "public/platform/WebData.h" | 43 #include "public/platform/WebData.h" |
| 44 #include "public/platform/WebURLError.h" | 44 #include "public/platform/WebURLError.h" |
| 45 #include "public/platform/WebURLRequest.h" | 45 #include "public/platform/WebURLRequest.h" |
| 46 #include "public/platform/WebURLResponse.h" | 46 #include "public/platform/WebURLResponse.h" |
| 47 #include "wtf/Assertions.h" | 47 #include "wtf/Assertions.h" |
| 48 #include "wtf/CurrentTime.h" | 48 #include "wtf/CurrentTime.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 void ResourceLoader::cancel() { | 128 void ResourceLoader::cancel() { |
| 129 handleError( | 129 handleError( |
| 130 ResourceError::cancelledError(m_resource->lastResourceRequest().url())); | 130 ResourceError::cancelledError(m_resource->lastResourceRequest().url())); |
| 131 } | 131 } |
| 132 | 132 |
| 133 void ResourceLoader::cancelForRedirectAccessCheckError( | 133 void ResourceLoader::cancelForRedirectAccessCheckError( |
| 134 const KURL& newURL, | 134 const KURL& newURL, |
| 135 ResourceRequestBlockedReason blockedReason) { | 135 ResourceRequestBlockedReason blockedReason) { |
| 136 m_resource->willNotFollowRedirect(); | 136 m_resource->willNotFollowRedirect(); |
| 137 | 137 |
| 138 if (m_loader) | 138 if (m_loader) { |
| 139 handleError( | 139 handleError( |
| 140 ResourceError::cancelledDueToAccessCheckError(newURL, blockedReason)); | 140 ResourceError::cancelledDueToAccessCheckError(newURL, blockedReason)); |
| 141 } |
| 141 } | 142 } |
| 142 | 143 |
| 143 static bool isManualRedirectFetchRequest(const ResourceRequest& request) { | 144 static bool isManualRedirectFetchRequest(const ResourceRequest& request) { |
| 144 return request.fetchRedirectMode() == | 145 return request.fetchRedirectMode() == |
| 145 WebURLRequest::FetchRedirectModeManual && | 146 WebURLRequest::FetchRedirectModeManual && |
| 146 request.requestContext() == WebURLRequest::RequestContextFetch; | 147 request.requestContext() == WebURLRequest::RequestContextFetch; |
| 147 } | 148 } |
| 148 | 149 |
| 149 bool ResourceLoader::willFollowRedirect( | 150 bool ResourceLoader::willFollowRedirect( |
| 150 WebURLRequest& passedNewRequest, | 151 WebURLRequest& passedNewRequest, |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 return; | 513 return; |
| 513 | 514 |
| 514 // Don't activate if cache policy is explicitly set. | 515 // Don't activate if cache policy is explicitly set. |
| 515 if (request.getCachePolicy() != WebCachePolicy::UseProtocolCachePolicy) | 516 if (request.getCachePolicy() != WebCachePolicy::UseProtocolCachePolicy) |
| 516 return; | 517 return; |
| 517 | 518 |
| 518 m_isCacheAwareLoadingActivated = true; | 519 m_isCacheAwareLoadingActivated = true; |
| 519 } | 520 } |
| 520 | 521 |
| 521 } // namespace blink | 522 } // namespace blink |
| OLD | NEW |