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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 ? resource->response() | 280 ? resource->response() |
281 : response; | 281 : response; |
282 String errorDescription; | 282 String errorDescription; |
283 if (!passesAccessControlCheck( | 283 if (!passesAccessControlCheck( |
284 responseForAccessControl, resource->options().allowCredentials, | 284 responseForAccessControl, resource->options().allowCredentials, |
285 sourceOrigin, errorDescription, | 285 sourceOrigin, errorDescription, |
286 resource->lastResourceRequest().requestContext())) { | 286 resource->lastResourceRequest().requestContext())) { |
287 resource->setCORSFailed(); | 287 resource->setCORSFailed(); |
288 if (!forPreload) { | 288 if (!forPreload) { |
289 String resourceType = Resource::resourceTypeToString( | 289 String resourceType = Resource::resourceTypeToString( |
290 resource->getType(), resource->options().initiatorInfo); | 290 resource->getType(), resource->options().initiatorInfo.name); |
291 context().addConsoleMessage( | 291 context().addConsoleMessage( |
292 "Access to " + resourceType + " at '" + response.url().getString() + | 292 "Access to " + resourceType + " at '" + response.url().getString() + |
293 "' from origin '" + sourceOrigin->toString() + | 293 "' from origin '" + sourceOrigin->toString() + |
294 "' has been blocked by CORS policy: " + errorDescription); | 294 "' has been blocked by CORS policy: " + errorDescription); |
295 } | 295 } |
296 return ResourceRequestBlockedReason::Other; | 296 return ResourceRequestBlockedReason::Other; |
297 } | 297 } |
298 return ResourceRequestBlockedReason::None; | 298 return ResourceRequestBlockedReason::None; |
299 } | 299 } |
300 | 300 |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 return; | 500 return; |
501 | 501 |
502 // Don't activate if cache policy is explicitly set. | 502 // Don't activate if cache policy is explicitly set. |
503 if (request.getCachePolicy() != WebCachePolicy::UseProtocolCachePolicy) | 503 if (request.getCachePolicy() != WebCachePolicy::UseProtocolCachePolicy) |
504 return; | 504 return; |
505 | 505 |
506 m_isCacheAwareLoadingActivated = true; | 506 m_isCacheAwareLoadingActivated = true; |
507 } | 507 } |
508 | 508 |
509 } // namespace blink | 509 } // namespace blink |
OLD | NEW |