Move IsSandboxed to SecurityPrincipal interface [chromium/src : main]

0 views
Skip to first unread message

Charlie Reis (Gerrit)

unread,
Jan 30, 2026, 3:50:25 PM (10 hours ago) Jan 30
to Viktoriya Bryhider, Alex Moshchuk, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, prerendering-reviews, chromium-a...@chromium.org, extension...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, gavin...@chromium.org, navigation...@chromium.org, tburkar...@chromium.org
Attention needed from Alex Moshchuk and Viktoriya Bryhider

Charlie Reis voted and added 3 comments

Votes added by Charlie Reis

Code-Review+1

3 comments

Patchset-level comments
File-level comment, Patchset 14 (Latest):
Charlie Reis . resolved

Thanks! LGTM with a few nits. I think this is a nice simple example of how SecurityPrincipal will be used outside content/, and you may want to consider making this first use instead of the slightly-more-complex StoragePartitionConfig case in https://chromium-review.googlesource.com/c/chromium/src/+/7231185, or the less-obviously-security-related IsGuest case in https://chromium-review.googlesource.com/c/chromium/src/+/7234613.

Commit Message
Line 17, Patchset 14 (Latest):separation between site identity management (SiteInstance) and security
boundary representation (SecurityPrincipal).
Charlie Reis . unresolved

This doesn't quite match my interpretation-- the distinction is more about "instance" vs "site/principal." Maybe we can say something like: "instance management within a browsing context group (SiteInstance) and security properties of the principal being isolated (SecurityPrincipal)"?

File content/public/browser/security_principal.h
Line 36, Patchset 14 (Latest): // sandboxed iframe.
Charlie Reis . unresolved

Let's use a comment closer to the one that was in SiteInstance (since the "iframe" term isn't meaningful here, and since the process-isolated part is important):

Returns true if this SecurityPrincipal is for process-isolated sandboxed documents only.

Open in Gerrit

Related details

Attention is currently required from:
  • Alex Moshchuk
  • Viktoriya Bryhider
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id6a3c82962056f5872e84af6301e710f6ee28c5b
Gerrit-Change-Number: 7243420
Gerrit-PatchSet: 14
Gerrit-Owner: Viktoriya Bryhider <vbry...@microsoft.com>
Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
Gerrit-Reviewer: Charlie Reis <cr...@chromium.org>
Gerrit-Reviewer: Viktoriya Bryhider <vbry...@microsoft.com>
Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
Gerrit-Attention: Viktoriya Bryhider <vbry...@microsoft.com>
Gerrit-Comment-Date: Fri, 30 Jan 2026 20:50:12 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Charlie Reis (Gerrit)

unread,
Jan 30, 2026, 5:03:41 PM (9 hours ago) Jan 30
to Viktoriya Bryhider, Alex Moshchuk, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, prerendering-reviews, chromium-a...@chromium.org, extension...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, gavin...@chromium.org, navigation...@chromium.org, tburkar...@chromium.org
Attention needed from Alex Moshchuk and Viktoriya Bryhider

Charlie Reis voted and added 4 comments

Votes added by Charlie Reis

Code-Review+1

4 comments

Patchset-level comments
File-level comment, Patchset 16 (Latest):
Charlie Reis . resolved

Thanks! Still LGTM.

(Sorry if I'm jumping the gun before you've replied to the open comments-- usually it helps to reply to those and mark them done to wrap up the discussion. I saw I was back in the attention set, though.)

Commit Message
Line 17, Patchset 14:separation between site identity management (SiteInstance) and security
boundary representation (SecurityPrincipal).
Charlie Reis . resolved

This doesn't quite match my interpretation-- the distinction is more about "instance" vs "site/principal." Maybe we can say something like: "instance management within a browsing context group (SiteInstance) and security properties of the principal being isolated (SecurityPrincipal)"?

Charlie Reis

Thanks!

Line 19, Patchset 16 (Latest):(SecurityPrincipal)
Charlie Reis . unresolved

minor nit: End with period.

File content/public/browser/security_principal.h
Line 36, Patchset 14: // sandboxed iframe.
Charlie Reis . resolved

Let's use a comment closer to the one that was in SiteInstance (since the "iframe" term isn't meaningful here, and since the process-isolated part is important):

Returns true if this SecurityPrincipal is for process-isolated sandboxed documents only.

Charlie Reis

Thanks!

Open in Gerrit

Related details

Attention is currently required from:
  • Alex Moshchuk
  • Viktoriya Bryhider
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id6a3c82962056f5872e84af6301e710f6ee28c5b
Gerrit-Change-Number: 7243420
Gerrit-PatchSet: 16
Gerrit-Owner: Viktoriya Bryhider <vbry...@microsoft.com>
Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
Gerrit-Reviewer: Charlie Reis <cr...@chromium.org>
Gerrit-Reviewer: Viktoriya Bryhider <vbry...@microsoft.com>
Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
Gerrit-Attention: Viktoriya Bryhider <vbry...@microsoft.com>
Gerrit-Comment-Date: Fri, 30 Jan 2026 22:03:30 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Charlie Reis <cr...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Viktoriya Bryhider (Gerrit)

unread,
Jan 30, 2026, 5:13:55 PM (9 hours ago) Jan 30
to Liang Zhao, Charlie Reis, Alex Moshchuk, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, prerendering-reviews, chromium-a...@chromium.org, extension...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, gavin...@chromium.org, navigation...@chromium.org, tburkar...@chromium.org
Attention needed from Alex Moshchuk and Liang Zhao

Viktoriya Bryhider added 1 comment

File content/browser/site_instance_impl.cc
Line 1004, Patchset 17 (Parent): if (!has_site_) {
Viktoriya Bryhider . resolved
I was thinking yesterday that moving IsSandboxed to SecurityPrincipal without has_site_ may introduce behavior change but now cannot come up with use-case when it will happen.
- If site is not set - it will be default SiteInfo - with default is_sandboxed which is `false`
- If it is accesses from SiteInfo object - then it was not checking this flag either and can be `true` even if site is not set in SiteInstance.
Leaving the comment for sanity-check
Open in Gerrit

Related details

Attention is currently required from:
  • Alex Moshchuk
  • Liang Zhao
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id6a3c82962056f5872e84af6301e710f6ee28c5b
Gerrit-Change-Number: 7243420
Gerrit-PatchSet: 17
Gerrit-Owner: Viktoriya Bryhider <vbry...@microsoft.com>
Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
Gerrit-Reviewer: Charlie Reis <cr...@chromium.org>
Gerrit-Reviewer: Liang Zhao <lz...@microsoft.com>
Gerrit-Reviewer: Viktoriya Bryhider <vbry...@microsoft.com>
Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
Gerrit-Comment-Date: Fri, 30 Jan 2026 22:13:44 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Liang Zhao (Gerrit)

unread,
Jan 30, 2026, 5:49:37 PM (8 hours ago) Jan 30
to Viktoriya Bryhider, Charlie Reis, Alex Moshchuk, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, prerendering-reviews, chromium-a...@chromium.org, extension...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, gavin...@chromium.org, navigation...@chromium.org, tburkar...@chromium.org
Attention needed from Alex Moshchuk and Viktoriya Bryhider

Liang Zhao voted Code-Review+1

Code-Review+1
Open in Gerrit

Related details

Attention is currently required from:
  • Alex Moshchuk
  • Viktoriya Bryhider
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Id6a3c82962056f5872e84af6301e710f6ee28c5b
    Gerrit-Change-Number: 7243420
    Gerrit-PatchSet: 17
    Gerrit-Owner: Viktoriya Bryhider <vbry...@microsoft.com>
    Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
    Gerrit-Reviewer: Charlie Reis <cr...@chromium.org>
    Gerrit-Reviewer: Liang Zhao <lz...@microsoft.com>
    Gerrit-Reviewer: Viktoriya Bryhider <vbry...@microsoft.com>
    Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
    Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
    Gerrit-Attention: Viktoriya Bryhider <vbry...@microsoft.com>
    Gerrit-Comment-Date: Fri, 30 Jan 2026 22:49:27 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Viktoriya Bryhider (Gerrit)

    unread,
    Jan 30, 2026, 7:26:32 PM (7 hours ago) Jan 30
    to Liang Zhao, Charlie Reis, Alex Moshchuk, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, prerendering-reviews, chromium-a...@chromium.org, extension...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, gavin...@chromium.org, navigation...@chromium.org, tburkar...@chromium.org
    Attention needed from Alex Moshchuk

    Viktoriya Bryhider added 1 comment

    Commit Message
    Line 19, Patchset 16:(SecurityPrincipal)
    Charlie Reis . resolved

    minor nit: End with period.

    Viktoriya Bryhider

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alex Moshchuk
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Id6a3c82962056f5872e84af6301e710f6ee28c5b
      Gerrit-Change-Number: 7243420
      Gerrit-PatchSet: 17
      Gerrit-Owner: Viktoriya Bryhider <vbry...@microsoft.com>
      Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
      Gerrit-Reviewer: Charlie Reis <cr...@chromium.org>
      Gerrit-Reviewer: Liang Zhao <lz...@microsoft.com>
      Gerrit-Reviewer: Viktoriya Bryhider <vbry...@microsoft.com>
      Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
      Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
      Gerrit-Comment-Date: Sat, 31 Jan 2026 00:26:18 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Charlie Reis <cr...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Alex Moshchuk (Gerrit)

      unread,
      Jan 30, 2026, 9:03:58 PM (5 hours ago) Jan 30
      to Viktoriya Bryhider, Liang Zhao, Charlie Reis, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, prerendering-reviews, chromium-a...@chromium.org, extension...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, creis...@chromium.org, gavin...@chromium.org, navigation...@chromium.org, tburkar...@chromium.org
      Attention needed from Viktoriya Bryhider

      Alex Moshchuk voted and added 4 comments

      Votes added by Alex Moshchuk

      Code-Review+1

      4 comments

      Patchset-level comments
      File-level comment, Patchset 14:
      Charlie Reis . resolved

      Thanks! LGTM with a few nits. I think this is a nice simple example of how SecurityPrincipal will be used outside content/, and you may want to consider making this first use instead of the slightly-more-complex StoragePartitionConfig case in https://chromium-review.googlesource.com/c/chromium/src/+/7231185, or the less-obviously-security-related IsGuest case in https://chromium-review.googlesource.com/c/chromium/src/+/7234613.

      Alex Moshchuk

      +1 that this is a nice first use case!

      File-level comment, Patchset 17 (Latest):
      Alex Moshchuk . resolved

      Thanks, LGTM as well with one minor comment.

      File content/browser/site_instance_impl.cc
      Viktoriya Bryhider . resolved
      I was thinking yesterday that moving IsSandboxed to SecurityPrincipal without has_site_ may introduce behavior change but now cannot come up with use-case when it will happen.
      - If site is not set - it will be default SiteInfo - with default is_sandboxed which is `false`
      - If it is accesses from SiteInfo object - then it was not checking this flag either and can be `true` even if site is not set in SiteInstance.
      Leaving the comment for sanity-check
      Alex Moshchuk

      Sounds reasonable to me.

      File content/public/test/browser_test_utils.cc
      Line 2091, Patchset 17 (Latest):bool HasSandboxedSiteInstance(RenderFrameHost* frame) {
      Alex Moshchuk . unresolved

      I think we can actually clean this up and remove this helper as well; I think this is left over from before we had SiteInstance::IsSandboxed(). The test use cases like `content::HasSandboxedSiteInstance(frame)` can now become `frame->GetSiteInstance()->GetSecurityPrincipal()->IsSandboxed()`. Fell free to do it here or in a separate followup CL.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Viktoriya Bryhider
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Id6a3c82962056f5872e84af6301e710f6ee28c5b
        Gerrit-Change-Number: 7243420
        Gerrit-PatchSet: 17
        Gerrit-Owner: Viktoriya Bryhider <vbry...@microsoft.com>
        Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
        Gerrit-Reviewer: Charlie Reis <cr...@chromium.org>
        Gerrit-Reviewer: Liang Zhao <lz...@microsoft.com>
        Gerrit-Reviewer: Viktoriya Bryhider <vbry...@microsoft.com>
        Gerrit-CC: prerendering-reviews <prerenderi...@chromium.org>
        Gerrit-Attention: Viktoriya Bryhider <vbry...@microsoft.com>
        Gerrit-Comment-Date: Sat, 31 Jan 2026 02:03:48 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        Comment-In-Reply-To: Viktoriya Bryhider <vbry...@microsoft.com>
        Comment-In-Reply-To: Charlie Reis <cr...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy
        Reply all
        Reply to author
        Forward
        0 new messages