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

Side by Side Diff: third_party/WebKit/Source/core/loader/FrameFetchContext.cpp

Issue 1850123002: Rename WebFrameLoadType::ReloadFromOrigin to ReloadBypassingCache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 if (frame()->tree().top()->isLocalFrame()) 136 if (frame()->tree().top()->isLocalFrame())
137 request.setFirstPartyForCookies(toLocalFrame(frame()->tree().top())->doc ument()->firstPartyForCookies()); 137 request.setFirstPartyForCookies(toLocalFrame(frame()->tree().top())->doc ument()->firstPartyForCookies());
138 } 138 }
139 139
140 CachePolicy FrameFetchContext::getCachePolicy() const 140 CachePolicy FrameFetchContext::getCachePolicy() const
141 { 141 {
142 if (m_document && m_document->loadEventFinished()) 142 if (m_document && m_document->loadEventFinished())
143 return CachePolicyVerify; 143 return CachePolicyVerify;
144 144
145 FrameLoadType loadType = frame()->loader().loadType(); 145 FrameLoadType loadType = frame()->loader().loadType();
146 if (loadType == FrameLoadTypeReloadFromOrigin) 146 if (loadType == FrameLoadTypeReloadBypassingCache)
147 return CachePolicyReload; 147 return CachePolicyReload;
148 148
149 Frame* parentFrame = frame()->tree().parent(); 149 Frame* parentFrame = frame()->tree().parent();
150 if (parentFrame && parentFrame->isLocalFrame()) { 150 if (parentFrame && parentFrame->isLocalFrame()) {
151 CachePolicy parentCachePolicy = toLocalFrame(parentFrame)->document()->f etcher()->context().getCachePolicy(); 151 CachePolicy parentCachePolicy = toLocalFrame(parentFrame)->document()->f etcher()->context().getCachePolicy();
152 if (parentCachePolicy != CachePolicyVerify) 152 if (parentCachePolicy != CachePolicyVerify)
153 return parentCachePolicy; 153 return parentCachePolicy;
154 } 154 }
155 155
156 if (loadType == FrameLoadTypeReload) 156 if (loadType == FrameLoadTypeReload)
(...skipping 29 matching lines...) Expand all
186 return ReturnCacheDataElseLoad; 186 return ReturnCacheDataElseLoad;
187 if (frameLoadType == FrameLoadTypeSame || request.isConditional() || req uest.httpMethod() == "POST") 187 if (frameLoadType == FrameLoadTypeSame || request.isConditional() || req uest.httpMethod() == "POST")
188 return ValidatingCacheData; 188 return ValidatingCacheData;
189 189
190 for (Frame* f = frame(); f; f = f->tree().parent()) { 190 for (Frame* f = frame(); f; f = f->tree().parent()) {
191 if (!f->isLocalFrame()) 191 if (!f->isLocalFrame())
192 continue; 192 continue;
193 frameLoadType = toLocalFrame(f)->loader().loadType(); 193 frameLoadType = toLocalFrame(f)->loader().loadType();
194 if (frameLoadType == FrameLoadTypeBackForward) 194 if (frameLoadType == FrameLoadTypeBackForward)
195 return ReturnCacheDataElseLoad; 195 return ReturnCacheDataElseLoad;
196 if (frameLoadType == FrameLoadTypeReloadFromOrigin) 196 if (frameLoadType == FrameLoadTypeReloadBypassingCache)
197 return BypassingCache; 197 return BypassingCache;
198 if (frameLoadType == FrameLoadTypeReload) 198 if (frameLoadType == FrameLoadTypeReload)
199 return ValidatingCacheData; 199 return ValidatingCacheData;
200 } 200 }
201 return UseProtocolCachePolicy; 201 return UseProtocolCachePolicy;
202 } 202 }
203 203
204 // For users on slow connections, we want to avoid blocking the parser in 204 // For users on slow connections, we want to avoid blocking the parser in
205 // the main frame on script loads inserted via document.write, since it can 205 // the main frame on script loads inserted via document.write, since it can
206 // add significant delays before page content is displayed on the screen. 206 // add significant delays before page content is displayed on the screen.
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
821 } 821 }
822 822
823 DEFINE_TRACE(FrameFetchContext) 823 DEFINE_TRACE(FrameFetchContext)
824 { 824 {
825 visitor->trace(m_document); 825 visitor->trace(m_document);
826 visitor->trace(m_documentLoader); 826 visitor->trace(m_documentLoader);
827 FetchContext::trace(visitor); 827 FetchContext::trace(visitor);
828 } 828 }
829 829
830 } // namespace blink 830 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698