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..381bebba33efe5216f9bda0549ef852551d0db05 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 |
Takashi Toyoshima
2017/05/09 10:57:25
Modified code for bypassing cache look good to me,
arthursonzogni
2017/05/09 12:49:06
I will let other peoples answer the questions beca
Charlie Reis
2017/05/10 05:56:40
Sorry, I don't follow any of these questions. Thi
|
+ // 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; |
+ |
+ // If we're in a middle of a reload. The FrameLoadType is propagated to |
Charlie Reis
2017/05/10 05:56:40
nit: Drop "If"
arthursonzogni
2017/05/10 08:05:13
Done.
|
+ // its children only if it is a ReloadByPassingCache, else it becomes a |
Charlie Reis
2017/05/10 05:56:40
nit: Don't capitalize P.
arthursonzogni
2017/05/10 08:05:13
Done.
|
+ // 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 |