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/platform/loader/fetch/Resource.cpp

Issue 2681233002: Actually handle the Vary header in blink, rather than punting on sight. (Closed)
Patch Set: Remove whitespace handling and case sensitivity cases Created 3 years, 10 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) 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) 2006 Samuel Weinig (sam.weinig@gmail.com) 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All 6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
7 rights reserved. 7 rights reserved.
8 8
9 This library is free software; you can redistribute it and/or 9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Library General Public 10 modify it under the terms of the GNU Library General Public
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after
976 return false; 976 return false;
977 } 977 }
978 return true; 978 return true;
979 } 979 }
980 980
981 bool Resource::hasCacheControlNoStoreHeader() const { 981 bool Resource::hasCacheControlNoStoreHeader() const {
982 return response().cacheControlContainsNoStore() || 982 return response().cacheControlContainsNoStore() ||
983 resourceRequest().cacheControlContainsNoStore(); 983 resourceRequest().cacheControlContainsNoStore();
984 } 984 }
985 985
986 bool Resource::hasVaryHeader() const { 986 bool Resource::mustReloadDueToVaryHeader(
987 return !response().httpHeaderField(HTTPNames::Vary).isNull(); 987 const ResourceRequest& newRequest) const {
988 const AtomicString& vary = response().httpHeaderField(HTTPNames::Vary);
989 if (vary.isNull())
990 return false;
991 if (vary == "*")
992 return true;
993
994 CommaDelimitedHeaderSet varyHeaders;
995 parseCommaDelimitedHeader(vary, varyHeaders);
996 for (const String& header : varyHeaders) {
997 AtomicString atomicHeader(header);
998 if (resourceRequest().httpHeaderField(atomicHeader) !=
999 newRequest.httpHeaderField(atomicHeader)) {
1000 return true;
1001 }
1002 }
1003 return false;
988 } 1004 }
989 1005
990 bool Resource::mustRevalidateDueToCacheHeaders() const { 1006 bool Resource::mustRevalidateDueToCacheHeaders() const {
991 return !canUseResponse(response(), m_responseTimestamp) || 1007 return !canUseResponse(response(), m_responseTimestamp) ||
992 resourceRequest().cacheControlContainsNoCache() || 1008 resourceRequest().cacheControlContainsNoCache() ||
993 resourceRequest().cacheControlContainsNoStore(); 1009 resourceRequest().cacheControlContainsNoStore();
994 } 1010 }
995 1011
996 bool Resource::canUseCacheValidator() const { 1012 bool Resource::canUseCacheValidator() const {
997 if (isLoading() || errorOccurred()) 1013 if (isLoading() || errorOccurred())
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
1109 case Resource::Media: 1125 case Resource::Media:
1110 case Resource::Manifest: 1126 case Resource::Manifest:
1111 case Resource::Mock: 1127 case Resource::Mock:
1112 return false; 1128 return false;
1113 } 1129 }
1114 NOTREACHED(); 1130 NOTREACHED();
1115 return false; 1131 return false;
1116 } 1132 }
1117 1133
1118 } // namespace blink 1134 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698