Commit 2cc3ca53 authored by arthursonzogni's avatar arthursonzogni Committed by Commit Bot

Replace DumpWithoutCrashing by CHECK for srcdoc CommitNavigation()

about:srcdoc document is always loaded inside an iframe and is
same-SiteInstance with its parent.

This is checked in CommitNavigation.

As a precautionary measure, this initially landed as a
DumpWithoutCrashing() to avoid hurting canary/dev/beta users if those
check were violated. It was planned to remove the DumpWithoutCrashing
for M79 if there was no reported DumpWithoutCrashing.

There are none of them:
https://crash.corp.google.com/browse?q=product_name%3D%22Chrome%22+AND+STRPOS%28expanded_custom_data.ChromeCrashProto.magic_signature_1.name%2C+%27CommitNavigation%27%29+%3E+0+AND+expanded_custom_data.ChromeCrashProto.magic_signature_1.name%3D%27content%3A%3ARenderFrameHostImpl%3A%3ACommitNavigation%27+AND+product.Version%3E%3D%2778.0.3904.63%27&stbtiq=&reportid=70db5bbe497238ba&index=9#4

Bug: None
Change-Id: Iee51ddcb31fd3a7b1b7155c02f726e24c160f31c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1913401
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: default avatarŁukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: default avatarArthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715115}
parent bf35bd5f
......@@ -5237,26 +5237,14 @@ void RenderFrameHostImpl::CommitNavigation(
bool is_srcdoc = common_params->url.IsAboutSrcdoc();
if (is_srcdoc) {
if (frame_tree_node_->IsMainFrame()) {
// Main frame srcdoc navigation are meaningless. They are blocked whenever
// a navigation attempt is made.
//
// TODO(arthursonzogni): Replace DumpWithoutCrashing by a CHECK on M79 if
// it is never reached.
NOTREACHED();
base::debug::DumpWithoutCrashing();
} else {
// An about:srcdoc document is always same SiteInstance with its parent.
// Otherwise, it won't be able to load. The parent's document contains the
// iframe and its srcdoc attribute.
//
// TODO(arthursonzogni): Replace DumpWithoutCrashing by a CHECK on M80 if
// it is never reached.
if (GetSiteInstance() != parent_->GetSiteInstance()) {
NOTREACHED();
base::debug::DumpWithoutCrashing();
}
}
// Main frame srcdoc navigation are meaningless. They are blocked whenever a
// navigation attempt is made. It shouldn't reach CommitNavigation.
CHECK(!frame_tree_node_->IsMainFrame());
// An about:srcdoc document is always same SiteInstance with its parent.
// Otherwise, it won't be able to load. The parent's document contains the
// iframe and its srcdoc attribute.
CHECK_EQ(GetSiteInstance(), parent_->GetSiteInstance());
}
// If this is an attempt to commit a URL in an incompatible process, capture a
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment