Commit add0a11a authored by Alex Moshchuk's avatar Alex Moshchuk Committed by Commit Bot

Fix origin lock state on chrome://process-internals.

chrome://process-internals calculates and displays each process's
locked state by checking lock_url().  That won't give the correct
result, since lock_url() is computed before we lock the process, and
having it doesn't imply that the process will actually be locked in
the future.  Fix this to check the process's lock in
ChildProcessSecurityPolicy, which should always given the correct
result.

Bug: 850087
Change-Id: Ibf5e37fc69919e6c1e6a7e67943942cf6c93242d
Reviewed-on: https://chromium-review.googlesource.com/c/1287953Reviewed-by: default avatarNasko Oskov <nasko@chromium.org>
Commit-Queue: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#601655}
parent d241cf9c
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <vector> #include <vector>
#include "base/strings/string_piece.h" #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/process_internals/process_internals.mojom.h"
#include "content/browser/web_contents/web_contents_impl.h" #include "content/browser/web_contents/web_contents_impl.h"
#include "content/public/browser/site_isolation_policy.h" #include "content/public/browser/site_isolation_policy.h"
...@@ -32,7 +33,11 @@ namespace { ...@@ -32,7 +33,11 @@ namespace {
static_cast<SiteInstanceImpl*>(frame->GetSiteInstance()); static_cast<SiteInstanceImpl*>(frame->GetSiteInstance());
frame_info->site_instance = ::mojom::SiteInstanceInfo::New(); frame_info->site_instance = ::mojom::SiteInstanceInfo::New();
frame_info->site_instance->id = site_instance->GetId(); frame_info->site_instance->id = site_instance->GetId();
frame_info->site_instance->locked = site_instance->lock_url().is_valid();
auto* policy = ChildProcessSecurityPolicyImpl::GetInstance();
frame_info->site_instance->locked =
!policy->GetOriginLock(site_instance->GetProcess()->GetID()).is_empty();
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->GetSiteURL())
......
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