Skip to content

Commit 79fbaa2

Browse files
author
Allan Sandfeld Jensen
committed
Avoid crashing on new window in cross-origin isolated content
The case seems to trigger if the opener is coop-coep-cross-origin- isolated, the load is speculative, site-related and not (yet) similarly isolated. The latter might be a separate/underlying bug though Change-Id: I9aacc1611ececc91425efe8a1c84ea941b575669 Fixes: QTBUG-92110 Reviewed-by: Jüri Valdmann <[email protected]>
1 parent e67c7b4 commit 79fbaa2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

chromium/content/browser/renderer_host/render_frame_host_manager.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,14 @@ bool IsSiteInstanceCompatibleWithCoopCoepCrossOriginIsolation(
159159
const GURL& url,
160160
bool is_coop_coep_cross_origin_isolated,
161161
bool is_speculative) {
162+
SiteInstanceImpl* site_instance_impl =
163+
static_cast<SiteInstanceImpl*>(site_instance);
162164
// We do not want cross-origin-isolated have any impact on SiteInstances until
163165
// we get an actual COOP value in a redirect or a final response.
164166
if (is_speculative)
165-
return true;
167+
return !site_instance_impl->IsCoopCoepCrossOriginIsolated() ||
168+
site_instance_impl->GetCoopCoepCrossOriginIsolatedInfo() ==
169+
cross_origin_isolated_info;
166170

167171
// Note: The about blank case is to accommodate web tests that use COOP. They
168172
// expect an about:blank page to stay in process, and hang otherwise. In
@@ -172,9 +176,6 @@ bool IsSiteInstanceCompatibleWithCoopCoepCrossOriginIsolation(
172176
if (url.IsAboutBlank())
173177
return true;
174178

175-
SiteInstanceImpl* site_instance_impl =
176-
static_cast<SiteInstanceImpl*>(site_instance);
177-
178179
if (is_main_frame) {
179180
if (site_instance_impl->IsCoopCoepCrossOriginIsolated() !=
180181
is_coop_coep_cross_origin_isolated) {

0 commit comments

Comments
 (0)