Commit 16682adf authored by Alex Moshchuk's avatar Alex Moshchuk Committed by Commit Bot

Show lock URL and the origin-keyed bit in chrome://process-internals

After https://crrev.com/c/2304537, the site URL will no longer contain
the process lock URL in the hash, so the lock URL won't be visible on
chrome://process-internals.  This CL adds the plumbing to show the
lock URL independently from site URL, but only if the two URLs are
different.  This way, we'll be able to view the lock URL
in cases where it matters (e.g., for hosted apps), and it won't
pollute the UI in the common case where it matches the site URL.

For completeness, this CL also plumbs the is-origin-keyed bit, so that
all current parts of SiteInfo (foundation of a future
SecurityPrincipal abstraction) are shown.  The origin-keyed bit is
currently only shown when opt-in origin isolation is in effect.

Bug: 1105994, 1067389
Change-Id: Ife20bcefc57aecee96e24a436ae89902e0837d20
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2364816
Commit-Queue: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: default avatarNasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799787}
parent a0f19d29
...@@ -10,11 +10,18 @@ import "url/mojom/url.mojom"; ...@@ -10,11 +10,18 @@ import "url/mojom/url.mojom";
struct SiteInstanceInfo { struct SiteInstanceInfo {
int32 id; int32 id;
// Boolean indicating whether the SiteInstance is locked to a specific URL. // Boolean indicating whether the SiteInstance's process is locked to a
// It does not indicate the granularity of the lock URL. // specific URL.
bool locked; bool locked;
url.mojom.Url? site_url; url.mojom.Url? site_url;
// The URL to which the SiteInstance's process is locked.
url.mojom.Url? process_lock_url;
// Specifies whether the SiteInstance is origin-keyed. This is true for
// opt-in origin isolation, false otherwise.
bool is_origin_keyed;
}; };
// Basic information describing a frame and all of its subframes. // Basic information describing a frame and all of its subframes.
......
...@@ -50,9 +50,23 @@ using IsolatedOriginSource = ChildProcessSecurityPolicy::IsolatedOriginSource; ...@@ -50,9 +50,23 @@ using IsolatedOriginSource = ChildProcessSecurityPolicy::IsolatedOriginSource;
frame_info->site_instance->site_url = frame_info->site_instance->site_url =
site_instance->HasSite() site_instance->HasSite()
? base::make_optional(site_instance->GetSiteURL()) ? base::make_optional(site_instance->GetSiteInfo().site_url())
: base::nullopt; : base::nullopt;
// Only send a process lock URL if it's different from the site URL. In the
// common case they are the same, so we avoid polluting the UI with two
// identical URLs.
bool should_show_lock_url = frame_info->site_instance->locked &&
site_instance->GetSiteInfo().process_lock_url() !=
site_instance->GetSiteInfo().site_url();
frame_info->site_instance->process_lock_url =
should_show_lock_url
? base::make_optional(site_instance->GetSiteInfo().process_lock_url())
: base::nullopt;
frame_info->site_instance->is_origin_keyed =
site_instance->GetSiteInfo().is_origin_keyed();
for (size_t i = 0; i < frame->child_count(); ++i) { for (size_t i = 0; i < frame->child_count(); ++i) {
frame_info->subframes.push_back(RenderFrameHostToFrameInfo( frame_info->subframes.push_back(RenderFrameHostToFrameInfo(
frame->child_at(i)->current_frame_host(), is_bfcached)); frame->child_at(i)->current_frame_host(), is_bfcached));
......
...@@ -98,6 +98,12 @@ function frameToTreeItem(frame) { ...@@ -98,6 +98,12 @@ function frameToTreeItem(frame) {
if (frame.siteInstance.siteUrl) { if (frame.siteInstance.siteUrl) {
itemLabel += `, site:${frame.siteInstance.siteUrl.url}`; itemLabel += `, site:${frame.siteInstance.siteUrl.url}`;
} }
if (frame.siteInstance.processLockUrl) {
itemLabel += `, lock:${frame.siteInstance.processLockUrl.url}`;
}
if (frame.siteInstance.isOriginKeyed) {
itemLabel += ', origin-keyed';
}
if (frame.lastCommittedUrl) { if (frame.lastCommittedUrl) {
itemLabel += ` | url: ${frame.lastCommittedUrl.url}`; itemLabel += ` | url: ${frame.lastCommittedUrl.url}`;
} }
......
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