Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: third_party/WebKit/Source/core/fetch/ResourceLoader.cpp

Issue 2572373003: Loading: pass minimum information to Resource::resourceTypeToString() (Closed)
Patch Set: review #9 #11 Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698