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..2958fcf5eda0478713aae282245efb38ee98426f 100644 |
--- a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp |
+++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp |
@@ -1699,23 +1699,46 @@ 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 kFrameLoadTypeInitialHistoryLoad: |
+ 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 kFrameLoadTypeInitialInChildFrame: |
Charlie Reis
2017/05/06 00:08:56
This looks wrong to me. Why is kFrameLoadTypeInit
arthursonzogni
2017/05/09 12:49:05
You are right. I made an error. The two case shoul
|
+ child_load_type = kFrameLoadTypeInitialHistoryLoad; |
+ child_item = webframe_child->Client()->HistoryItemForNewChildFrame(); |
+ new_request = |
+ FrameLoadRequest(request.OriginDocument(), |
+ child_item->GenerateResourceRequest( |
+ WebCachePolicy::kUseProtocolCachePolicy)); |
+ break; |
+ |
+ // If 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 |