Commit c63ceed7 authored by Lukasz Anforowicz's avatar Lukasz Anforowicz Committed by Commit Bot

Ad-hoc crash keys to help debug RFHM::DetermineSiteInstanceForURL.

Bug: 1116320
Change-Id: I44c2f377ffb64cd23480562c7b30a0a9e389607e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2506171
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: default avatardanakj <danakj@chromium.org>
Reviewed-by: default avatarAlex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#822701}
parent 9ed0b4d6
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/bind_helpers.h" #include "base/bind_helpers.h"
#include "base/debug/alias.h" #include "base/debug/alias.h"
#include "base/debug/crash_logging.h"
#include "base/debug/dump_without_crashing.h" #include "base/debug/dump_without_crashing.h"
#include "base/feature_list.h" #include "base/feature_list.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
...@@ -1398,8 +1399,18 @@ void NavigationRequest::BeginNavigation() { ...@@ -1398,8 +1399,18 @@ void NavigationRequest::BeginNavigation() {
ComputeSandboxFlagsToCommit(); ComputeSandboxFlagsToCommit();
// Select an appropriate RenderFrameHost. // Select an appropriate RenderFrameHost.
//
// TODO(lukasza): https://crbug.com/1116320: Remove the ad-hoc
// |frame_host_choice_reason| crash key once the bug investigation
// completes. Note that the crash related to crbug/1116320 is expected to
// happen inside the call to CommitNavigation below, a few statements down.
std::string frame_host_choice_reason;
render_frame_host_ = render_frame_host_ =
frame_tree_node_->render_manager()->GetFrameHostForNavigation(this); frame_tree_node_->render_manager()->GetFrameHostForNavigation(
this, &frame_host_choice_reason);
SCOPED_CRASH_KEY_STRING256("nav_request", host_choice_reason,
frame_host_choice_reason);
if (!Navigator::CheckWebUIRendererDoesNotDisplayNormalURL( if (!Navigator::CheckWebUIRendererDoesNotDisplayNormalURL(
render_frame_host_, GetUrlInfo(), render_frame_host_, GetUrlInfo(),
/* is_renderer_initiated_check */ false)) { /* is_renderer_initiated_check */ false)) {
......
...@@ -326,7 +326,13 @@ class CONTENT_EXPORT RenderFrameHostManager ...@@ -326,7 +326,13 @@ class CONTENT_EXPORT RenderFrameHostManager
// appropriate RenderFrameHost for the provided URL. The returned pointer will // appropriate RenderFrameHost for the provided URL. The returned pointer will
// be for the current or the speculative RenderFrameHost and the instance is // be for the current or the speculative RenderFrameHost and the instance is
// owned by this manager. // owned by this manager.
RenderFrameHostImpl* GetFrameHostForNavigation(NavigationRequest* request); //
// |reason| is an optional out-parameter that will be populated with
// engineer-readable information describing the reason for the method
// behavior. The returned |reason| should fit into
// base::debug::CrashKeySize::Size256.
RenderFrameHostImpl* GetFrameHostForNavigation(NavigationRequest* request,
std::string* reason = nullptr);
// Clean up any state for any ongoing navigation. // Clean up any state for any ongoing navigation.
void CleanUpNavigation(); void CleanUpNavigation();
...@@ -503,8 +509,14 @@ class CONTENT_EXPORT RenderFrameHostManager ...@@ -503,8 +509,14 @@ class CONTENT_EXPORT RenderFrameHostManager
// initialized RenderProcessHost. It will only be initialized when // initialized RenderProcessHost. It will only be initialized when
// GetProcess() is called on the SiteInstance. In particular, calling this // GetProcess() is called on the SiteInstance. In particular, calling this
// function will never lead to a process being created for the navigation. // function will never lead to a process being created for the navigation.
//
// |reason| is an optional out-parameter that will be populated with
// engineer-readable information describing the reason for the method
// behavior. The returned |reason| should fit into
// base::debug::CrashKeySize::Size256.
scoped_refptr<SiteInstance> GetSiteInstanceForNavigationRequest( scoped_refptr<SiteInstance> GetSiteInstanceForNavigationRequest(
NavigationRequest* navigation_request); NavigationRequest* navigation_request,
std::string* reason = nullptr);
// Helper to initialize the main RenderFrame if it's not initialized. // Helper to initialize the main RenderFrame if it's not initialized.
// TODO(https://crbug.com/936696): Remove this. For now debug URLs and // TODO(https://crbug.com/936696): Remove this. For now debug URLs and
...@@ -654,6 +666,8 @@ class CONTENT_EXPORT RenderFrameHostManager ...@@ -654,6 +666,8 @@ class CONTENT_EXPORT RenderFrameHostManager
bool should_replace_current_entry); bool should_replace_current_entry);
// Returns the SiteInstance to use for the navigation. // Returns the SiteInstance to use for the navigation.
//
// This is a helper function for GetSiteInstanceForNavigationRequest.
scoped_refptr<SiteInstance> GetSiteInstanceForNavigation( scoped_refptr<SiteInstance> GetSiteInstanceForNavigation(
const UrlInfo& dest_url_info, const UrlInfo& dest_url_info,
const CoopCoepCrossOriginIsolatedInfo& cross_origin_isolated_info, const CoopCoepCrossOriginIsolatedInfo& cross_origin_isolated_info,
...@@ -670,7 +684,8 @@ class CONTENT_EXPORT RenderFrameHostManager ...@@ -670,7 +684,8 @@ class CONTENT_EXPORT RenderFrameHostManager
bool cross_origin_opener_policy_mismatch, bool cross_origin_opener_policy_mismatch,
bool should_replace_current_entry, bool should_replace_current_entry,
bool is_speculative, bool is_speculative,
bool* did_same_site_proactive_browsing_instance_swap); bool* did_same_site_proactive_browsing_instance_swap,
std::string* reason);
// Returns a descriptor of the appropriate SiteInstance object for the given // Returns a descriptor of the appropriate SiteInstance object for the given
// |dest_url_info|, possibly reusing the current, source or destination // |dest_url_info|, possibly reusing the current, source or destination
...@@ -707,7 +722,8 @@ class CONTENT_EXPORT RenderFrameHostManager ...@@ -707,7 +722,8 @@ class CONTENT_EXPORT RenderFrameHostManager
bool dest_is_view_source_mode, bool dest_is_view_source_mode,
bool force_browsing_instance_swap, bool force_browsing_instance_swap,
bool was_server_redirect, bool was_server_redirect,
bool is_speculative); bool is_speculative,
std::string* reason);
// Returns true if a navigation to |dest_url| that uses the specified // Returns true if a navigation to |dest_url| that uses the specified
// PageTransition in the current frame is allowed to swap BrowsingInstances. // PageTransition in the current frame is allowed to swap BrowsingInstances.
......
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