Commit 6d7f3656 authored by kouhei's avatar kouhei Committed by Commit Bot

process-internals: Show agent_scheduling_group_id for frames

This CL extends the chrome://process-internals UI to display
AgentSchedulingGroupHost ID.

Bug: 1111231
Change-Id: I26656239d6e860d646402eb93ec8ee9c799fd7ed
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2546346Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarNasko Oskov <nasko@chromium.org>
Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Reviewed-by: default avatarDominic Farolino <dom@chromium.org>
Reviewed-by: default avatarTal Pressman <talp@chromium.org>
Commit-Queue: Kouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#829474}
parent bb459fc6
......@@ -27,6 +27,7 @@ struct SiteInstanceInfo {
// Basic information describing a frame and all of its subframes.
struct FrameInfo {
int32 routing_id;
int32 agent_scheduling_group_id;
int32 process_id;
SiteInstanceInfo site_instance;
......
......@@ -11,6 +11,7 @@
#include "base/strings/string_piece.h"
#include "content/browser/child_process_security_policy_impl.h"
#include "content/browser/process_internals/process_internals.mojom.h"
#include "content/browser/renderer_host/agent_scheduling_group_host.h"
#include "content/browser/renderer_host/back_forward_cache_impl.h"
#include "content/browser/renderer_host/navigation_controller_impl.h"
#include "content/browser/renderer_host/navigation_entry_impl.h"
......@@ -32,6 +33,8 @@ using IsolatedOriginSource = ChildProcessSecurityPolicy::IsolatedOriginSource;
auto frame_info = ::mojom::FrameInfo::New();
frame_info->routing_id = frame->GetRoutingID();
frame_info->agent_scheduling_group_id =
frame->agent_scheduling_group().id_for_debugging();
frame_info->process_id = frame->GetProcess()->GetID();
frame_info->last_committed_url =
frame->GetLastCommittedURL().is_valid()
......
......@@ -72,6 +72,11 @@ AgentSchedulingGroupHost* AgentSchedulingGroupHost::Get(
return agent_group;
}
int32_t AgentSchedulingGroupHost::GetNextID() {
static int32_t next_id = 0;
return next_id++;
}
AgentSchedulingGroupHost::AgentSchedulingGroupHost(RenderProcessHost& process)
: process_(process),
association_mode_(base::FeatureList::IsEnabled(
......
......@@ -63,6 +63,8 @@ class CONTENT_EXPORT AgentSchedulingGroupHost
// Returns |false| if any part of the initialization failed.
bool Init();
int32_t id_for_debugging() const { return id_for_debugging_; }
// IPC and mojo messages to be forwarded to the RenderProcessHost, for now. In
// the future they will be handled directly by the AgentSchedulingGroupHost.
// IPC:
......@@ -136,6 +138,8 @@ class CONTENT_EXPORT AgentSchedulingGroupHost
IPC::Listener* GetListener(int32_t routing_id);
static int32_t GetNextID();
// The RenderProcessHost this AgentSchedulingGroup is assigned to.
RenderProcessHost& process_;
......@@ -152,6 +156,8 @@ class CONTENT_EXPORT AgentSchedulingGroupHost
};
const IPCAssociationMode association_mode_;
int32_t id_for_debugging_{GetNextID()};
// This AgentSchedulingGroup's legacy IPC channel. Will only be used in
// `kUnassociated` mode.
std::unique_ptr<IPC::ChannelProxy> channel_;
......
......@@ -45,7 +45,7 @@
<div id="tree-view-container">
<button id="refresh-button">Refresh</button>
<div>Legend:</div>
<div>Frame[<i>process_id</i>:<i>routing_id</i>]:
<div>Frame[<i>process_id</i>:<i>routing_id</i>:<i>agent_scheduling_group_id</i>]:
SI:<i>site_instance_id</i>, <i>whether process is locked to a
site</i>, site: <i>site_url</i> | url:
<i>last_committed_url</i>
......
......@@ -87,7 +87,8 @@ function getTreeViewRoot() {
*/
function frameToTreeItem(frame) {
// Compose the string which will appear in the entry for this frame.
let itemLabel = `Frame[${frame.processId}:${frame.routingId}]:`;
let itemLabel = `Frame[${frame.processId}:${frame.routingId}:${
frame.agentSchedulingGroupId}]:`;
if (frame.isBfcached) {
itemLabel += ` bfcached`;
}
......
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