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

Unified Diff: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

Issue 2863683003: PlzNavigate: Fix wrong "Cache-Control" header. (Closed)
Patch Set: Add TODO Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameFetchContext.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
index 7e88545b6d6c3ec6f3bcbb1bf792ee12c8647aae..eea5797155874aa4843eace40811c41bad19d9f7 100644
--- a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
+++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
@@ -1699,23 +1699,48 @@ LocalFrame* WebLocalFrameImpl::CreateChildFrame(
if (!webframe_child->Parent())
return nullptr;
- // If we're moving in the back/forward list, we might want to replace the
- // content of this child frame with whatever was there at that point.
+ FrameLoadRequest new_request = request;
+ FrameLoadType child_load_type = kFrameLoadTypeStandard;
HistoryItem* child_item = nullptr;
- if (IsBackForwardLoadType(
- GetFrame()->Loader().GetDocumentLoader()->LoadType()) &&
- !GetFrame()->GetDocument()->LoadEventFinished())
- child_item = webframe_child->Client()->HistoryItemForNewChildFrame();
- FrameLoadRequest new_request = request;
- FrameLoadType load_type = kFrameLoadTypeStandard;
- if (child_item) {
- new_request = FrameLoadRequest(
- request.OriginDocument(), child_item->GenerateResourceRequest(
- WebCachePolicy::kUseProtocolCachePolicy));
- load_type = kFrameLoadTypeInitialHistoryLoad;
+ if (!GetFrame()->GetDocument()->LoadEventFinished()) {
+ FrameLoadType load_type =
+ GetFrame()->Loader().GetDocumentLoader()->LoadType();
+ switch (load_type) {
+ case kFrameLoadTypeStandard:
+ case kFrameLoadTypeReplaceCurrentItem:
+ case kFrameLoadTypeInitialInChildFrame:
+ break;
+
+ // If we're moving in the back/forward list, we might want to replace the
+ // content of this child frame with whatever was there at that point.
+ case kFrameLoadTypeBackForward:
+ case kFrameLoadTypeInitialHistoryLoad:
+ child_item = webframe_child->Client()->HistoryItemForNewChildFrame();
+ if (child_item) {
+ child_load_type = kFrameLoadTypeInitialHistoryLoad;
+ new_request =
+ FrameLoadRequest(request.OriginDocument(),
+ child_item->GenerateResourceRequest(
+ WebCachePolicy::kUseProtocolCachePolicy));
+ }
+ break;
+
+ // We're in a middle of a reload. The FrameLoadType is propagated to its
+ // children only if it is a ReloadBypassingCache, else it becomes a
+ // standard load.
+ case kFrameLoadTypeReload:
+ break;
+ case kFrameLoadTypeReloadBypassingCache:
+ child_load_type = kFrameLoadTypeReloadBypassingCache;
+ new_request.GetResourceRequest().SetCachePolicy(
+ WebCachePolicy::kBypassingCache);
+ break;
+ }
}
- webframe_child->GetFrame()->Loader().Load(new_request, load_type, child_item);
+
+ webframe_child->GetFrame()->Loader().Load(new_request, child_load_type,
+ child_item);
// Note a synchronous navigation (about:blank) would have already processed
// onload, so it is possible for the child frame to have already been
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameFetchContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698