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

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

Issue 2863683003: PlzNavigate: Fix wrong "Cache-Control" header. (Closed)
Patch Set: fix errors 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 | « content/browser/loader/reload_cache_control_browsertest.cc ('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..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
« no previous file with comments | « content/browser/loader/reload_cache_control_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698