File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
chromium/content/browser/renderer_host Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -2783,19 +2783,21 @@ bool NavigationRequest::ShouldAddCookieChangeListener() {
2783
2783
// The `CookieChangeListener` will only be set up if all of these are true:
2784
2784
// (1) the navigation's protocol is HTTP(s).
2785
2785
// (2) we allow a document with `Cache-control: no-store` header to
2786
- // enter BFCache .
2786
+ // enter back/forward .
2787
2787
// (3) the navigation is neither a same-document navigation nor a page
2788
2788
// activation, since in these cases, an existing `RenderFrameHost` will be
2789
2789
// used, and it would already have an existing listener, so we should skip the
2790
2790
// initialization.
2791
- // (4) the navigation is a primary main frame navigation, as the cookie
2792
- // change information will only be used in the inactive document control
2793
- // logic.
2791
+ // (4) the navigation is a primary main frame navigation or it's for
2792
+ // prerendering a main frame, as the cookie change information will only be
2793
+ // used to determined if a page can be restored from back/forward cache, so
2794
+ // subframe navigation can be ignored.
2794
2795
return frame_tree_node_->navigator ()
2795
2796
.controller ()
2796
2797
.GetBackForwardCache ()
2797
2798
.should_allow_storing_pages_with_cache_control_no_store () &&
2798
- !IsPageActivation () && !IsSameDocument () && IsInPrimaryMainFrame () &&
2799
+ !IsPageActivation () && !IsSameDocument () &&
2800
+ (IsInPrimaryMainFrame () || IsInPrerenderedMainFrame ()) &&
2799
2801
common_params_->url .SchemeIsHTTPOrHTTPS ();
2800
2802
}
2801
2803
You can’t perform that action at this time.
0 commit comments