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

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

Issue 2341893002: Don't attempt to revalidate a Resource with a 304 response. (Closed)
Patch Set: Fix comment issues Created 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp » ('j') | 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) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org)
4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org)
5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ 6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
7 7
8 This library is free software; you can redistribute it and/or 8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public 9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either 10 License as published by the Free Software Foundation; either
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 return Reload; 702 return Reload;
703 703
704 // If resource was populated from a SubstituteData load or data: url, use it . 704 // If resource was populated from a SubstituteData load or data: url, use it .
705 if (isStaticData) 705 if (isStaticData)
706 return Use; 706 return Use;
707 707
708 if (!existingResource->canReuse(request)) 708 if (!existingResource->canReuse(request))
709 return Reload; 709 return Reload;
710 710
711 // Certain requests (e.g., XHRs) might have manually set headers that requir e revalidation. 711 // Certain requests (e.g., XHRs) might have manually set headers that requir e revalidation.
712 // FIXME: In theory, this should be a Revalidate case. In practice, the Memo ryCache revalidation path assumes a whole bunch 712 // In theory, this should be a Revalidate case. In practice, the MemoryCache revalidation path assumes a whole bunch
713 // of things about how revalidation works that manual headers violate, so pu nt to Reload instead. 713 // of things about how revalidation works that manual headers violate, so pu nt to Reload instead.
714 if (request.isConditional()) 714 //
715 // Similarly, a request with manually added revalidation headers can lead
716 // to a 304 response for a request that wasn't flagged as a revalidation
717 // attempt. Normally, successful revalidation will maintain the original
718 // response's status code, but for a manual revalidation the response code
719 // remains 304. In this case, the Resource likely has insufficient context
720 // to provide a useful cache hit or revalidation.
721 // See http://crbug.com/643659
722 if (request.isConditional() || existingResource->response().httpStatusCode() == 304)
715 return Reload; 723 return Reload;
716 724
717 // Don't try to reuse an in-progress async request for a new sync request. 725 // Don't try to reuse an in-progress async request for a new sync request.
718 if (fetchRequest.options().synchronousPolicy == RequestSynchronously && exis tingResource->isLoading()) 726 if (fetchRequest.options().synchronousPolicy == RequestSynchronously && exis tingResource->isLoading())
719 return Reload; 727 return Reload;
720 728
721 // Don't reload resources while pasting. 729 // Don't reload resources while pasting.
722 if (m_allowStaleResources) 730 if (m_allowStaleResources)
723 return Use; 731 return Use;
724 732
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
1360 visitor->trace(m_context); 1368 visitor->trace(m_context);
1361 visitor->trace(m_archive); 1369 visitor->trace(m_archive);
1362 visitor->trace(m_loaders); 1370 visitor->trace(m_loaders);
1363 visitor->trace(m_nonBlockingLoaders); 1371 visitor->trace(m_nonBlockingLoaders);
1364 visitor->trace(m_documentResources); 1372 visitor->trace(m_documentResources);
1365 visitor->trace(m_preloads); 1373 visitor->trace(m_preloads);
1366 visitor->trace(m_resourceTimingInfoMap); 1374 visitor->trace(m_resourceTimingInfoMap);
1367 } 1375 }
1368 1376
1369 } // namespace blink 1377 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698