| 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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 } | 212 } |
| 213 } | 213 } |
| 214 | 214 |
| 215 bool crossOrigin = !SecurityOrigin::areSameSchemeHostPort( | 215 bool crossOrigin = !SecurityOrigin::areSameSchemeHostPort( |
| 216 redirectResponse.url(), newRequest.url()); | 216 redirectResponse.url(), newRequest.url()); |
| 217 m_fetcher->recordResourceTimingOnRedirect(m_resource.get(), redirectResponse, | 217 m_fetcher->recordResourceTimingOnRedirect(m_resource.get(), redirectResponse, |
| 218 crossOrigin); | 218 crossOrigin); |
| 219 | 219 |
| 220 newRequest.setAllowStoredCredentials(m_resource->options().allowCredentials == | 220 newRequest.setAllowStoredCredentials(m_resource->options().allowCredentials == |
| 221 AllowStoredCredentials); | 221 AllowStoredCredentials); |
| 222 | 222 context().prepareRequest(m_resource->identifier(), newRequest); |
| 223 context().dispatchWillSendRequest(m_resource->identifier(), newRequest, | 223 context().dispatchWillSendRequest(m_resource->identifier(), newRequest, |
| 224 redirectResponse, | 224 redirectResponse, |
| 225 m_resource->options().initiatorInfo); | 225 m_resource->options().initiatorInfo); |
| 226 | 226 |
| 227 // ResourceFetcher::willFollowRedirect() may rewrite the URL to | 227 // FetchContext::prepareRequest() may rewrite the URL to |
| 228 // something else not for rejecting redirect but for other reasons. | 228 // something else not for rejecting redirect but for other reasons. |
| 229 // E.g. WebFrameTestClient::willSendRequest() and | 229 // E.g. WebFrameTestClient::willSendRequest() and |
| 230 // RenderFrameImpl::willSendRequest(). We should reflect the | 230 // RenderFrameImpl::willSendRequest(). We should reflect the |
| 231 // rewriting but currently we cannot. So, return false to make the | 231 // rewriting but currently we cannot. So, return false to make the |
| 232 // redirect fail. | 232 // redirect fail. |
| 233 if (newRequest.url() != originalURL) { | 233 if (newRequest.url() != originalURL) { |
| 234 cancelForRedirectAccessCheckError(newRequest.url(), | 234 cancelForRedirectAccessCheckError(newRequest.url(), |
| 235 ResourceRequestBlockedReason::Other); | 235 ResourceRequestBlockedReason::Other); |
| 236 return false; | 236 return false; |
| 237 } | 237 } |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 return; | 519 return; |
| 520 | 520 |
| 521 // Don't activate if cache policy is explicitly set. | 521 // Don't activate if cache policy is explicitly set. |
| 522 if (request.getCachePolicy() != WebCachePolicy::UseProtocolCachePolicy) | 522 if (request.getCachePolicy() != WebCachePolicy::UseProtocolCachePolicy) |
| 523 return; | 523 return; |
| 524 | 524 |
| 525 m_isCacheAwareLoadingActivated = true; | 525 m_isCacheAwareLoadingActivated = true; |
| 526 } | 526 } |
| 527 | 527 |
| 528 } // namespace blink | 528 } // namespace blink |
| OLD | NEW |