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

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

Issue 1410313002: Revert of Revalidate using the same Resource, attempt #3 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months 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
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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 m_request.setSkipServiceWorker(true); 334 m_request.setSkipServiceWorker(true);
335 WrappedResourceRequest wrappedRequest(m_request); 335 WrappedResourceRequest wrappedRequest(m_request);
336 m_loader->loadAsynchronously(wrappedRequest, this); 336 m_loader->loadAsynchronously(wrappedRequest, this);
337 return; 337 return;
338 } 338 }
339 } else { 339 } else {
340 // If the response successfully validated a cached resource, perform 340 // If the response successfully validated a cached resource, perform
341 // the access control with respect to it. Need to do this right here 341 // the access control with respect to it. Need to do this right here
342 // before the resource switches clients over to that validated resou rce. 342 // before the resource switches clients over to that validated resou rce.
343 Resource* resource = m_resource; 343 Resource* resource = m_resource;
344 if (!resource->isCacheValidator() || resourceResponse.httpStatusCode () != 304) 344 if (resource->isCacheValidator() && resourceResponse.httpStatusCode( ) == 304)
345 resource = m_resource->resourceToRevalidate();
346 else
345 m_resource->setResponse(resourceResponse); 347 m_resource->setResponse(resourceResponse);
346 if (!m_fetcher->canAccessResource(resource, m_options.securityOrigin .get(), response.url(), ResourceFetcher::ShouldLogAccessControlErrors)) { 348 if (!m_fetcher->canAccessResource(resource, m_options.securityOrigin .get(), response.url(), ResourceFetcher::ShouldLogAccessControlErrors)) {
347 m_fetcher->didReceiveResponse(m_resource, resourceResponse); 349 m_fetcher->didReceiveResponse(m_resource, resourceResponse);
348 cancel(ResourceError::cancelledDueToAccessCheckError(KURL(respon se.url()))); 350 cancel(ResourceError::cancelledDueToAccessCheckError(KURL(respon se.url())));
349 return; 351 return;
350 } 352 }
351 } 353 }
352 } 354 }
353 355
354 m_resource->responseReceived(resourceResponse, handle.release()); 356 m_resource->responseReceived(resourceResponse, handle.release());
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength); 512 didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength);
511 } 513 }
512 514
513 ResourceRequest& ResourceLoader::applyOptions(ResourceRequest& request) const 515 ResourceRequest& ResourceLoader::applyOptions(ResourceRequest& request) const
514 { 516 {
515 request.setAllowStoredCredentials(m_options.allowCredentials == AllowStoredC redentials); 517 request.setAllowStoredCredentials(m_options.allowCredentials == AllowStoredC redentials);
516 return request; 518 return request;
517 } 519 }
518 520
519 } 521 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp ('k') | third_party/WebKit/Source/core/fetch/ScriptResource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698