Improve third-party NTPs creation performance by using spare renderer [chromium/src : main]

13 views
Skip to first unread message

Wangsong Jin (Gerrit)

unread,
May 9, 2025, 3:09:28 PM5/9/25
to AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
Attention needed from Alex Moshchuk, Daniel Cheng and Liang Zhao

Wangsong Jin added 5 comments

Commit Message
Line 20, Patchset 31:a new interface, SetConfigurationOnProcessLockUpdate(), in the existing
Liang Zhao . resolved

it is a new method instead of interface

Wangsong Jin

Done

Line 21, Patchset 31:RendererConfiguration mojom. This method is called in
Liang Zhao . resolved

`RendererConfiguration mojom interface`?

Wangsong Jin

Done

File chrome/renderer/chrome_render_thread_observer.cc
Line 86, Patchset 31:bool AreStaticParamsEqual(const chrome::mojom::StaticParamsPtr& a,
const chrome::mojom::StaticParamsPtr& b) {
if (!a || !b) {
return !a && !b;
}
return a->is_instant_process == b->is_instant_process;
}
Liang Zhao . resolved

`a.Equals(b)` should work, no need for this helper function.

Wangsong Jin

Done

Line 257, Patchset 31: CHECK(!static_params_ || AreStaticParamsEqual(static_params_, params));
Liang Zhao . resolved

Would `static_params_ == params` not work?

Wangsong Jin

Done

File chrome/renderer/process_state.h
Line 8, Patchset 31:// Returns true if this renderer process is incognito.
bool IsIncognitoProcess();

// Sets whether this renderer process is an incognito process.
void SetIsIncognitoProcess(bool is_incognito_process);

// Returns true if this renderer process is an instant process.
bool IsInstantProcess();

// Sets whether this renderer process is an instant process.
void SetIsInstantProcess(bool is_instant_process);
Liang Zhao . resolved

Do we want to put these into some name space?

Wangsong Jin

Yep, we should. IsInstantProcess() is widely used. Thanks!

Open in Gerrit

Related details

Attention is currently required from:
  • Alex Moshchuk
  • Daniel Cheng
  • Liang Zhao
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
Gerrit-Change-Number: 6373046
Gerrit-PatchSet: 33
Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
Gerrit-CC: Charlie Reis <cr...@chromium.org>
Gerrit-CC: Liang Zhao <lz...@microsoft.com>
Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
Gerrit-Comment-Date: Fri, 09 May 2025 19:09:17 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Liang Zhao <lz...@microsoft.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Wangsong Jin (Gerrit)

unread,
May 13, 2025, 1:26:43 PM5/13/25
to AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
Attention needed from Alex Moshchuk, Daniel Cheng and Liang Zhao

Wangsong Jin added 2 comments

File chrome/renderer/chrome_content_renderer_client.cc
Line 1743, Patchset 29: WebSecurityPolicy::RegisterURLSchemeAsDisplayIsolated(chrome_search_scheme);
Daniel Cheng . unresolved

Is there any reason we can't just unconditionally do this always? I thought there was already an extension point in ContentClient or ContentBrowserClient for configuring schemes, and it doesn't seem like it'd hurt to do this in all renderers.

Wangsong Jin

That's the current behavior. If we do this for an instant process, it prevents 3rd party NTPs from displaying chrome-search:: urls in some frames the in ntp page. We have an existing test `ThirdPartyNTPBrowserTest.EmbeddedMostVisitedIframe` to cover this. So I assume we still want to maintain this behavior?

Wangsong Jin

Could you provide additional context if you believe we should apply this to all renders? I can create a separate bug based on that. Thx!

File content/browser/renderer_host/render_process_host_impl.cc
Line 3295, Patchset 16: GetRendererInterface()->SetIsInstantProcess();
Alex Moshchuk . unresolved

Per my other comment about layering, it seems that you might need to instead call out to the embedder (e.g., via ContentBrowserClient) to do whatever work is needed on a LockedStateUpdate, which could include sending over the instant process status (over some similar chrome-layer interface)

Wangsong Jin

Thank you for pointing out the layering issue. I wasn't aware of it before. This brings to mind the initial proposal: Move instant process flag into WebPreferences. Add a flag like bool enable_instant_api in WebPreferencse, and use that flag in ChromeContentRendererClient::RenderFrameCreated() to call RegisterURLSchemeAsDisplayIsolated()/SearchBox(render_frame). The flag is consumed only in chrome/ code. Here's the earlier revision https://chromium-review.googlesource.com/c/chromium/src/+/6373046/3
Do you think that's something we want to move forward with?

Liang Zhao

My thoughts.

There seems to be 3 aspects of this.

The first is what we label the thing so that it feels useful for other content embedders. With current code or put it into Web/RendererPreferences, it is still a flag that sounds chrome only, even if the code under /content does not access the flag.
Would use something like `mojo_base.mojom.DictionaryValue embedder_preferences` be more generic?

The second is how/when to pass the flag and apply update according to the flag. As Web/RenderPreferences are passed down for every WebView creation and when some preference changes, if we use Web/RendererPreferences, we would end up passing the info multiple times and then have to ensure that it does not change when apply it. That feels not optimal to me.
As this is something that used to be command line switch, we don't expect it to change after the process is launched. So, calling it from NotifyRendererOfLockedStateUpdate() seems to be better to me. If we do it there, then it would be natural to add a new SetEmbedderPreference() method on Renderer mojo interface. We would want to call it when the process is locked or not though.

The third is when to apply the preference. We could use existing places like ChromeContentRendererClient::WebViewCreated() to retrieve and apply the preference with a static flag to avoid applying it multiple times. Alternatively, we could add a new method like ContentRendererClient::UpdateEmbedderPreference() to ContentRendererClient and call it with GetContentClient()->renderer()->ApplyEmbedderPreference() from RenderThreadImpl::SetEmbedderPreference().

For checking, we could expose methods from ContentRendererClient to retrieve the preferences and switch the code to check that instead of command line switch. Those checking places are under /chrome, so no layer violation.

Wangsong Jin

Thanks for you all inputs!

WebPreferences/RendererPreferences ... Since these are in Blink and also should be just about the web platform,

I retained the current approach NotifyRendererOfLockedStateUpdate() and refactored the code to isolate instant-process/chrome-search schema within the content layer.

Update the GetRendererInterface()->SetIsInstantProcess() to more general calls:

  • GetContentClient()->browser()->GetClientPreferences(): We checked the instant flag and instant URL logic and encapsulate the instant flag into the dictionary.
  • GetRendererInterface()->SetClientPreferences(): We store the ClientPreferences for the renderer, and call the ChromeContentRendererClient::SetClientPreferences() to set up RegisterURLSchemeAsDisplayIsolated(chrome_search_scheme).

but we'd need to ask Blink owners if they would be ok with.

Should we go through a design review, or would it be sufficient to add them to review the CL

and I also share Liang's concern of this sending more updates than necessary... pass it in a separate IPC sent from NotifyRendererOfLockedStateUpdate() - maybe something like SetProcessLockedEmbedderState().

In RenderThreadImpl::SetClientPreferences, there're checks to ensure we don't
a. Update client preferences when the process is locked.
b. Apply the client preferences if there's no change.

This ensures that RegisterURLSchemeAsDisplayIsolated() won't be called unnecessarily. I should do the same thing for blink_platform_impl_->SetClientPreferences(client_preferences); to avoid setting unnecessary values. Do you think that's acceptable?

I'm wondering if NotifyRendererOfLockedStateUpdate() could just have a ContentBrowserClient callout to the embedder, and then the chrome layer sends an IPC to its renderer counterpart through a different interface

It sounds for me what we refactored. Let me know if I don't get you.

would it be possible to rename the whole thing to not be "instant"? I don't think this feature has anything to do with instant processes anymore,

I updated the CL title and description. Are you suggesting that all the places (code) "instant" should be changed to something like "3rd party NTPs"?

Wangsong Jin

Acknowledged

Alex Moshchuk

>> but we'd need to ask Blink owners if they would be ok with.

Should we go through a design review, or would it be sufficient to add them to review the CL

Let's just do it in this CL review; you'll need a blink owner anyway. @dch...@chromium.org, would you be able to help take a look at this, and whether there's a simpler way of doing things? tldr is that this is trying to replace a command-line switch for instant/third-party NTP processes with an IPC that is sent when we lock a process, with the goal of setting a renderer-global "I'm an instant process" bit. And the challenge being that we don't really want content/blink to know about instant.

>> I'm wondering if NotifyRendererOfLockedStateUpdate() could just have a ContentBrowserClient callout to the embedder, and then the chrome layer sends an IPC to its renderer counterpart through a different interface

It sounds for me what we refactored. Let me know if I don't get you.

Not quite. I meant instead of collecting prefs from the content embedder, sending them at the content layer (content/common/renderer.mojom), and then again calling out to the embedder on the renderer side to interpret them - find a way to send the actual IPC at the chrome layer (through some other process-wide interface). Daniel might be able to suggest something that might work better.

Wangsong Jin

Got it, thanks! Here's what I'm thinking: In the content embedder, we call into the chrome layer to set the client preferences directly:

  • call the content layer to store the preference.
  • call the content embedder to invoke RegisterURLSchemeAsDisplayIsolated(). Might need one more call from content embedder to the embedder on the renderer side to RegisterURL...

Would it be acceptable to expose GetRendererInterface() in chrome/browser? I haven’t seen us do that before, so I’m wondering if that’s why you mentioned going “through a different interface.

Or let me know if you have a better idea. Thx!

Daniel Cheng

I think we can simplify this quite a bit.

We can just reuse (or add a new) .mojom in `//chrome/common` to pass the bit down directly. [renderer_configuration.mojom](https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/renderer_configuration.mojom;l=1?q=renderer_configuration.mojom&ss=chromium) would be promising... but it looks like it's called a bit too early. I really hate to add another Mojo interface "just" for this, that's probably the easiest. We could even just say that binding the Mojo interface itself is sufficient to activate instant, though it's probably clearer to have an explicit call for that.

Making that call would just set a global somewhere, and the other bits of the code that check instant preferences (or the command line today) would just check this flag.

Wangsong Jin
Thank you for your suggestion! We have two options:
1. Add a new method into mojom::RendererConfiguration, something like SetConfigurationOnProcessLockUpdate, then we can set/get IsInstantProcess similarly to how it's done for chrome\renderer\process_state.cc.
2. Add a new mojo interface for setting renderer client preferences:
````
struct ClientPreferences {
bool is_instant_process;
};
interface RendererClientPreferences {
SetClientPreferences(ClientPreferences client_preferences);
};
```

Which option do you prefer?

Wangsong Jin
I refactored using option 1, which allows for the reuse of the existing mojom. The `SetConfiguration(DynamicParams params)` method is used for renderer configurations with settings that can change. It seems reasonable for me to introduce a separate interface for settings like is_instant_process, which should remain unchanged once set. Therefore, I added SetConfigurationOnProcessLockUpdate(StaticParams params).

PTAL when you have the chance, thanks a lot!
Wangsong Jin

Hi @dch...@chromium.org, when you get the chance, could you help to look at this? We need your input on this refactor. Thank you!

Gerrit-Comment-Date: Tue, 13 May 2025 17:26:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
Comment-In-Reply-To: Wangsong Jin <wangs...@microsoft.com>
Comment-In-Reply-To: Liang Zhao <lz...@microsoft.com>
Comment-In-Reply-To: Alex Moshchuk <ale...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Liang Zhao (Gerrit)

unread,
May 13, 2025, 2:03:53 PM5/13/25
to Wangsong Jin, AyeAye, Daniel Cheng, Charlie Reis, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
Attention needed from Alex Moshchuk, Daniel Cheng and Wangsong Jin

Liang Zhao added 1 comment

File chrome/browser/chrome_content_browser_client.cc
Line 2040, Patchset 33 (Latest):ChromeContentBrowserClient::GetRendererConfiguration(
Liang Zhao . unresolved

This helper function doesn't seem to access any member of ChromeContentBrowserClient. Should we make it a helper function in anonymous namespace in this file instead of a member function of the class?

Open in Gerrit

Related details

Attention is currently required from:
  • Alex Moshchuk
  • Daniel Cheng
  • Wangsong Jin
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
Gerrit-Change-Number: 6373046
Gerrit-PatchSet: 33
Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
Gerrit-CC: Charlie Reis <cr...@chromium.org>
Gerrit-CC: Liang Zhao <lz...@microsoft.com>
Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
Gerrit-Comment-Date: Tue, 13 May 2025 18:03:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Wangsong Jin (Gerrit)

unread,
May 13, 2025, 2:53:00 PM5/13/25
to AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
Attention needed from Alex Moshchuk, Daniel Cheng and Liang Zhao

Wangsong Jin added 1 comment

File chrome/browser/chrome_content_browser_client.cc
Line 2040, Patchset 33:ChromeContentBrowserClient::GetRendererConfiguration(
Liang Zhao . resolved

This helper function doesn't seem to access any member of ChromeContentBrowserClient. Should we make it a helper function in anonymous namespace in this file instead of a member function of the class?

Wangsong Jin

Acknowledged

Open in Gerrit

Related details

Attention is currently required from:
  • Alex Moshchuk
  • Daniel Cheng
  • Liang Zhao
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
Gerrit-Change-Number: 6373046
Gerrit-PatchSet: 34
Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
Gerrit-CC: Charlie Reis <cr...@chromium.org>
Gerrit-CC: Liang Zhao <lz...@microsoft.com>
Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
Gerrit-Comment-Date: Tue, 13 May 2025 18:52:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Liang Zhao <lz...@microsoft.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Daniel Cheng (Gerrit)

unread,
May 15, 2025, 4:37:59 AM5/15/25
to Wangsong Jin, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
Attention needed from Alex Moshchuk, Liang Zhao and Wangsong Jin

Daniel Cheng added 2 comments

File chrome/renderer/chrome_content_renderer_client.cc
Line 1743, Patchset 29: WebSecurityPolicy::RegisterURLSchemeAsDisplayIsolated(chrome_search_scheme);
Daniel Cheng . unresolved

Is there any reason we can't just unconditionally do this always? I thought there was already an extension point in ContentClient or ContentBrowserClient for configuring schemes, and it doesn't seem like it'd hurt to do this in all renderers.

Wangsong Jin

That's the current behavior. If we do this for an instant process, it prevents 3rd party NTPs from displaying chrome-search:: urls in some frames the in ntp page. We have an existing test `ThirdPartyNTPBrowserTest.EmbeddedMostVisitedIframe` to cover this. So I assume we still want to maintain this behavior?

Wangsong Jin

Could you provide additional context if you believe we should apply this to all renders? I can create a separate bug based on that. Thx!

Daniel Cheng

I guess I'm a bit concerned about this, because we have to weaken the DCHECK somewhat significantly. In particular, just because a process isn't locked to a site doesn't mean it can't have loaded pages.

What exactly is the chrome-search scheme for? Why is it important for its security properties to differ in an instant process? That is honestly a bit odd–definitely unfortunate that we're running into it now, but if we want to move away from the command-line flag, this is an issue we're going to have to solve.

File content/browser/renderer_host/render_process_host_impl.cc
Line 3295, Patchset 16: GetRendererInterface()->SetIsInstantProcess();
Alex Moshchuk . resolved
Daniel Cheng

The general IPC plumbing seems fine.

Open in Gerrit

Related details

Attention is currently required from:
  • Alex Moshchuk
  • Liang Zhao
  • Wangsong Jin
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
Gerrit-Change-Number: 6373046
Gerrit-PatchSet: 34
Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
Gerrit-CC: Charlie Reis <cr...@chromium.org>
Gerrit-CC: Liang Zhao <lz...@microsoft.com>
Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
Gerrit-Comment-Date: Thu, 15 May 2025 08:37:51 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Wangsong Jin (Gerrit)

unread,
May 15, 2025, 2:30:49 PM5/15/25
to AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
Attention needed from Alex Moshchuk, Daniel Cheng and Liang Zhao

Wangsong Jin added 1 comment

File chrome/renderer/chrome_content_renderer_client.cc
Line 1743, Patchset 29: WebSecurityPolicy::RegisterURLSchemeAsDisplayIsolated(chrome_search_scheme);
Daniel Cheng . unresolved

Is there any reason we can't just unconditionally do this always? I thought there was already an extension point in ContentClient or ContentBrowserClient for configuring schemes, and it doesn't seem like it'd hurt to do this in all renderers.

Wangsong Jin

That's the current behavior. If we do this for an instant process, it prevents 3rd party NTPs from displaying chrome-search:: urls in some frames the in ntp page. We have an existing test `ThirdPartyNTPBrowserTest.EmbeddedMostVisitedIframe` to cover this. So I assume we still want to maintain this behavior?

Wangsong Jin

Could you provide additional context if you believe we should apply this to all renders? I can create a separate bug based on that. Thx!

Daniel Cheng

I guess I'm a bit concerned about this, because we have to weaken the DCHECK somewhat significantly. In particular, just because a process isn't locked to a site doesn't mean it can't have loaded pages.

What exactly is the chrome-search scheme for? Why is it important for its security properties to differ in an instant process? That is honestly a bit odd–definitely unfortunate that we're running into it now, but if we want to move away from the command-line flag, this is an issue we're going to have to solve.

Wangsong Jin

Thanks!

chrome-search is designed for 3rd party default search provider to be hosted and have access to some native APIs that other web pages do not have access to.

Why is it important for its security properties to differ in an instant process?

This is the existing behavior for all third party NTPs. I'm not entirely sure about the impact. We'd better to have separate task to clear if we want to this for all renderers.

 Just because a process isn't locked to a site doesn't mean it can't have loaded pages.

Do you have any thoughts on the where to configure the settings?

Open in Gerrit

Related details

Attention is currently required from:
  • Alex Moshchuk
  • Daniel Cheng
  • Liang Zhao
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
Gerrit-Change-Number: 6373046
Gerrit-PatchSet: 34
Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
Gerrit-CC: Charlie Reis <cr...@chromium.org>
Gerrit-CC: Liang Zhao <lz...@microsoft.com>
Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
Gerrit-Comment-Date: Thu, 15 May 2025 18:30:41 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Daniel Cheng (Gerrit)

unread,
May 15, 2025, 8:08:49 PM5/15/25
to Wangsong Jin, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
Attention needed from Alex Moshchuk, Liang Zhao and Wangsong Jin

Daniel Cheng added 1 comment

File chrome/renderer/chrome_content_renderer_client.cc
Line 1743, Patchset 29: WebSecurityPolicy::RegisterURLSchemeAsDisplayIsolated(chrome_search_scheme);
Daniel Cheng . unresolved

Is there any reason we can't just unconditionally do this always? I thought there was already an extension point in ContentClient or ContentBrowserClient for configuring schemes, and it doesn't seem like it'd hurt to do this in all renderers.

Wangsong Jin

That's the current behavior. If we do this for an instant process, it prevents 3rd party NTPs from displaying chrome-search:: urls in some frames the in ntp page. We have an existing test `ThirdPartyNTPBrowserTest.EmbeddedMostVisitedIframe` to cover this. So I assume we still want to maintain this behavior?

Wangsong Jin

Could you provide additional context if you believe we should apply this to all renders? I can create a separate bug based on that. Thx!

Daniel Cheng

I guess I'm a bit concerned about this, because we have to weaken the DCHECK somewhat significantly. In particular, just because a process isn't locked to a site doesn't mean it can't have loaded pages.

What exactly is the chrome-search scheme for? Why is it important for its security properties to differ in an instant process? That is honestly a bit odd–definitely unfortunate that we're running into it now, but if we want to move away from the command-line flag, this is an issue we're going to have to solve.

Wangsong Jin

Thanks!

chrome-search is designed for 3rd party default search provider to be hosted and have access to some native APIs that other web pages do not have access to.

Why is it important for its security properties to differ in an instant process?

This is the existing behavior for all third party NTPs. I'm not entirely sure about the impact. We'd better to have separate task to clear if we want to this for all renderers.

 Just because a process isn't locked to a site doesn't mean it can't have loaded pages.

Do you have any thoughts on the where to configure the settings?

Daniel Cheng

I think there are probably two paths here:
1. Don't add chrome-search as a display-isolated scheme at all. That would require understanding why we did this historically.
2. Figure out what's triggering thread creation... and don't do it. I don't honestly know if that's possible though.

The DCHECK exists to prevent race conditions, and we're relaxing the DCHECK to potentially allow those race conditions. I think (1) might be easier, but that requires some code archaeology to understand the historical context.

Open in Gerrit

Related details

Attention is currently required from:
  • Alex Moshchuk
  • Liang Zhao
  • Wangsong Jin
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
Gerrit-Change-Number: 6373046
Gerrit-PatchSet: 34
Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
Gerrit-CC: Charlie Reis <cr...@chromium.org>
Gerrit-CC: Liang Zhao <lz...@microsoft.com>
Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
Gerrit-Comment-Date: Fri, 16 May 2025 00:08:40 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Alex Moshchuk (Gerrit)

unread,
May 16, 2025, 1:04:24 PM5/16/25
to Wangsong Jin, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
Attention needed from Daniel Cheng, Liang Zhao and Wangsong Jin

Alex Moshchuk added 1 comment

File chrome/renderer/chrome_content_renderer_client.cc
Line 1743, Patchset 29: WebSecurityPolicy::RegisterURLSchemeAsDisplayIsolated(chrome_search_scheme);
Daniel Cheng . unresolved

Is there any reason we can't just unconditionally do this always? I thought there was already an extension point in ContentClient or ContentBrowserClient for configuring schemes, and it doesn't seem like it'd hurt to do this in all renderers.

Wangsong Jin

That's the current behavior. If we do this for an instant process, it prevents 3rd party NTPs from displaying chrome-search:: urls in some frames the in ntp page. We have an existing test `ThirdPartyNTPBrowserTest.EmbeddedMostVisitedIframe` to cover this. So I assume we still want to maintain this behavior?

Wangsong Jin

Could you provide additional context if you believe we should apply this to all renders? I can create a separate bug based on that. Thx!

Daniel Cheng

I guess I'm a bit concerned about this, because we have to weaken the DCHECK somewhat significantly. In particular, just because a process isn't locked to a site doesn't mean it can't have loaded pages.

What exactly is the chrome-search scheme for? Why is it important for its security properties to differ in an instant process? That is honestly a bit odd–definitely unfortunate that we're running into it now, but if we want to move away from the command-line flag, this is an issue we're going to have to solve.

Wangsong Jin

Thanks!

chrome-search is designed for 3rd party default search provider to be hosted and have access to some native APIs that other web pages do not have access to.

Why is it important for its security properties to differ in an instant process?

This is the existing behavior for all third party NTPs. I'm not entirely sure about the impact. We'd better to have separate task to clear if we want to this for all renderers.

 Just because a process isn't locked to a site doesn't mean it can't have loaded pages.

Do you have any thoughts on the where to configure the settings?

Daniel Cheng

I think there are probably two paths here:
1. Don't add chrome-search as a display-isolated scheme at all. That would require understanding why we did this historically.
2. Figure out what's triggering thread creation... and don't do it. I don't honestly know if that's possible though.

The DCHECK exists to prevent race conditions, and we're relaxing the DCHECK to potentially allow those race conditions. I think (1) might be easier, but that requires some code archaeology to understand the historical context.

Alex Moshchuk

I found some historical context for chrome-search and display-isolated scheme in https://issues.chromium.org/issues/40309067 and https://chromiumcodereview.appspot.com/12621008/.

IIUC, all this is due to the fact that a third-party NTP needs to be able to show most visited tiles hosted at chrome-search://. E.g., if I set Bing as my default search engine, the NTP is loaded from https://bing.com/chrome/newtab in a process locked to chrome-search://remote-ntp; the origin seen in Blink is https://bing.com. That document needs to be able to display most-visited tiles, which are embedded via iframes to chrome-search://most-visited/title.html?rid=2. Other sites in non-NTP processes shouldn't be able to embed them.

Prior to https://chromiumcodereview.appspot.com/12621008, chrome-search was actually registered as a display-isolated scheme unconditionally, and then special exceptions were made for allowing tile URLs to be iframed via WebSecurityPolicy::AddOriginAccessAllowListEntry(). But https://issues.chromium.org/issues/40309067 showed that this was problematic because it allowed bing.com to XHR and read the tile data directly, which was undesirable. So instead, the origin access exceptions were removed, and chrome-search was made non-display-isolated in the instant process, which allowed the instant process to embed and display the most visited tiles, but not read them.

This was a long time ago (e.g., WebSecurityPolicy evolved a lot, we've got site isolation and CORB, etc). I also think that we have some NTP tile exceptions configured in the browser process, and that even if we completely removed the display-isolated scheme thing in the renderer process, the browser process still wouldn't allow a web process other than 3P NTP to embed chrome-search: iframes (though you might get a renderer kill instead of a console error) - maybe this is worth verifying.

A couple of other random thoughts here:

  • could there be a better way with WebSecurityPolicy (which evolved a lot) to configure most visited tile exception for 3P NTP, without running into the XHR bug?
  • I didn't look much at the race question, but presumably the process should be locked before any pages get to execute any code in that process, so at that time it should still be theoretically ok to be configuring the scheme registry?
  • Does it help if we start with chrome-search: being display-isolated unconditionally on renderer process startup, and then we relax that condition for instant processes when they're locked (still before they get to run any code)?
Open in Gerrit

Related details

Attention is currently required from:
  • Daniel Cheng
  • Liang Zhao
  • Wangsong Jin
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
Gerrit-Change-Number: 6373046
Gerrit-PatchSet: 34
Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
Gerrit-CC: Charlie Reis <cr...@chromium.org>
Gerrit-CC: Liang Zhao <lz...@microsoft.com>
Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
Gerrit-Comment-Date: Fri, 16 May 2025 17:04:02 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Wangsong Jin (Gerrit)

unread,
May 19, 2025, 12:32:30 PM5/19/25
to AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
Attention needed from Alex Moshchuk, Daniel Cheng and Liang Zhao

Wangsong Jin added 1 comment

File chrome/renderer/chrome_content_renderer_client.cc
Line 1743, Patchset 29: WebSecurityPolicy::RegisterURLSchemeAsDisplayIsolated(chrome_search_scheme);
Daniel Cheng . resolved
Wangsong Jin

Thanks for you all the valuable insights!
We also found that DuckDuckGo embeds a chrome-search iframe in their NTP page in real-world scenarios. Therefore, we cannot block the test ThirdPartyNTPBrowserTest.EmbeddedMostVisitedIframe.

Attempted to remove the registration of the chrome-search schema for all renderers. However, this does not prevent non-instant processes from embedding the chrome-search schema. Therefore, we still need to use RegisterURLSchemeAsDisplayIsolated(chrome_search_scheme).

if we start with chrome-search: being display-isolated unconditionally on renderer process startup, and then we relax that condition for instant processes when they're locked.

Updated with this approach. It turns out we don't need to modify the DCHECK(). This also resolves the 'Relaxing the DCHECK()' issue.

Open in Gerrit

Related details

Attention is currently required from:
  • Alex Moshchuk
  • Daniel Cheng
  • Liang Zhao
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
Gerrit-Change-Number: 6373046
Gerrit-PatchSet: 36
Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
Gerrit-CC: Charlie Reis <cr...@chromium.org>
Gerrit-CC: Liang Zhao <lz...@microsoft.com>
Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
Gerrit-Comment-Date: Mon, 19 May 2025 16:32:20 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
Comment-In-Reply-To: Wangsong Jin <wangs...@microsoft.com>
Comment-In-Reply-To: Alex Moshchuk <ale...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Liang Zhao (Gerrit)

unread,
May 19, 2025, 12:53:38 PM5/19/25
to Wangsong Jin, AyeAye, Daniel Cheng, Charlie Reis, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
Attention needed from Alex Moshchuk, Daniel Cheng and Wangsong Jin

Liang Zhao added 3 comments

File chrome/browser/chrome_content_browser_client.cc
Line 2061, Patchset 36 (Latest): if (base::FeatureList::IsEnabled(features::kInstantUsesSpareRenderer) &&
Liang Zhao . unresolved

Since we now only call SetConfigurationOnProcessLockUpdate when is_instant_process is true and we rely on SetConfigurationOnProcessLockUpdate to make process_state::IsInstantProcess() true, we should ensure that params->is_instant_process is true whether the feature is enabled or not.

File chrome/common/renderer_configuration.mojom
Line 38, Patchset 36 (Latest): bool is_instant_process;
Liang Zhao . unresolved

should we explicitly set `= false`?

File chrome/renderer/chrome_content_renderer_client.cc
Line 539, Patchset 36 (Latest): // The Instant process can only display the content but not read it. Other
// processes can't display it or read it.
Liang Zhao . unresolved

Should we update the comments? With the new code/feature, we treat the process as non instant process at the process start time and update the registration later if it is decided that it is an instant process.

Do we even need to check for command line switch?

Open in Gerrit

Related details

Attention is currently required from:
  • Alex Moshchuk
  • Daniel Cheng
  • Wangsong Jin
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
    Gerrit-Change-Number: 6373046
    Gerrit-PatchSet: 36
    Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
    Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
    Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
    Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
    Gerrit-CC: Charlie Reis <cr...@chromium.org>
    Gerrit-CC: Liang Zhao <lz...@microsoft.com>
    Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
    Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
    Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
    Gerrit-Comment-Date: Mon, 19 May 2025 16:53:29 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Daniel Cheng (Gerrit)

    unread,
    May 19, 2025, 1:40:18 PM5/19/25
    to Wangsong Jin, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
    Attention needed from Alex Moshchuk and Wangsong Jin

    Daniel Cheng added 1 comment

    File chrome/renderer/chrome_content_renderer_client.cc
    Daniel Cheng

    Attempted to remove the registration of the chrome-search schema for all renderers. However, this does not prevent non-instant processes from embedding the chrome-search schema. Therefore, we still need to use RegisterURLSchemeAsDisplayIsolated(chrome_search_scheme).

    Why is it a problem for non-instance processes to embed it? It shouldn't do anything in a non-instant process, since it wouldn't have the corresponding URLLoaderFactory for the scheme, right?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alex Moshchuk
    • Wangsong Jin
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
    Gerrit-Change-Number: 6373046
    Gerrit-PatchSet: 36
    Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
    Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
    Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
    Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
    Gerrit-CC: Charlie Reis <cr...@chromium.org>
    Gerrit-CC: Liang Zhao <lz...@microsoft.com>
    Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
    Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
    Gerrit-Comment-Date: Mon, 19 May 2025 17:40:08 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Liang Zhao (Gerrit)

    unread,
    May 19, 2025, 3:42:10 PM5/19/25
    to Wangsong Jin, AyeAye, Daniel Cheng, Charlie Reis, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
    Attention needed from Alex Moshchuk, Daniel Cheng and Wangsong Jin

    Liang Zhao added 1 comment

    File chrome/renderer/chrome_content_renderer_client.cc
    Liang Zhao

    That seems to be the intent, but the current code does not really achieve it.

    In [InstantService::ShouldServiceRequest](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/search/instant_service.cc;l=296?q=InstantService::ShouldServiceRequest&ss=chromium%2Fchromium%2Fsrc#:~:text=bool%20InstantService%3A%3AShouldServiceRequest,%7D), we return true if `render_process_id == -1` and the comments states: "The process_id for the navigation request will be -1. If so, allow this request since it's not going to another renderer.".

    And WebUIURLLoaderFactory [always uses -1](https://source.chromium.org/chromium/chromium/src/+/main:content/browser/webui/web_ui_url_loader_factory.cc;l=357?q=CreateWebUIURLLoaderFactory&ss=chromium%2Fchromium%2Fsrc#:~:text=if%20(!source%2D%3E,%2D1) when checking ShouldServiceRequest.

    And because chrome-search is supported WebUI scheme, [CreateWebUIURLLoaderFactory is always called](https://source.chromium.org/chromium/chromium/src/+/main:content/browser/loader/navigation_url_loader_impl.cc#:~:text=CreateWebUIURLLoaderFactory(,mojom%3A%3AkBrowserProcessId)%2C) in `NavigationURLLoaderImpl::Start` when trying to add an chrome-search: iframe.

    If we want to really block it in browser code, we might want to do it in a separate CL.

    Anyway, not removing renderer process restriction is better.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alex Moshchuk
    • Daniel Cheng
    • Wangsong Jin
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
    Gerrit-Change-Number: 6373046
    Gerrit-PatchSet: 36
    Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
    Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
    Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
    Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
    Gerrit-CC: Charlie Reis <cr...@chromium.org>
    Gerrit-CC: Liang Zhao <lz...@microsoft.com>
    Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
    Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
    Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
    Gerrit-Comment-Date: Mon, 19 May 2025 19:41:59 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Wangsong Jin (Gerrit)

    unread,
    May 19, 2025, 3:50:10 PM5/19/25
    to AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
    Attention needed from Alex Moshchuk, Daniel Cheng and Liang Zhao

    Wangsong Jin added 2 comments

    File chrome/browser/chrome_content_browser_client.cc
    Line 2061, Patchset 36: if (base::FeatureList::IsEnabled(features::kInstantUsesSpareRenderer) &&
    Liang Zhao . resolved

    Since we now only call SetConfigurationOnProcessLockUpdate when is_instant_process is true and we rely on SetConfigurationOnProcessLockUpdate to make process_state::IsInstantProcess() true, we should ensure that params->is_instant_process is true whether the feature is enabled or not.

    Wangsong Jin

    Thanks!
    In process_state::IsInstantProcess() we still check the command line switch. Thus we don't need to set params->is_instant_process to true if it's from command line.
    But yes, it's better to set this params->is_instant_process to true for all instant process cases, it can simplify the logic.

    File chrome/renderer/chrome_content_renderer_client.cc
    Line 539, Patchset 36: // The Instant process can only display the content but not read it. Other

    // processes can't display it or read it.
    Liang Zhao . resolved

    Should we update the comments? With the new code/feature, we treat the process as non instant process at the process start time and update the registration later if it is decided that it is an instant process.

    Do we even need to check for command line switch?

    Wangsong Jin

    Updated. Previous we need it as we only call SetConfigurationOnProcessLockUpdate() with the feature enabled case. As we update to set params->is_instant_process for both command switches and feature flag, we can remove it now.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alex Moshchuk
    • Daniel Cheng
    • Liang Zhao
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
    Gerrit-Change-Number: 6373046
    Gerrit-PatchSet: 37
    Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
    Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
    Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
    Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
    Gerrit-CC: Charlie Reis <cr...@chromium.org>
    Gerrit-CC: Liang Zhao <lz...@microsoft.com>
    Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
    Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
    Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
    Gerrit-Comment-Date: Mon, 19 May 2025 19:50:01 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Liang Zhao <lz...@microsoft.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Liang Zhao (Gerrit)

    unread,
    May 19, 2025, 4:46:15 PM5/19/25
    to Wangsong Jin, AyeAye, Daniel Cheng, Charlie Reis, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
    Attention needed from Alex Moshchuk, Daniel Cheng and Wangsong Jin

    Liang Zhao added 2 comments

    File chrome/common/renderer_configuration.mojom
    Line 38, Patchset 36: bool is_instant_process;
    Liang Zhao . resolved

    should we explicitly set `= false`?

    Liang Zhao

    Done

    File chrome/renderer/chrome_content_renderer_client.cc
    Line 539, Patchset 36: // The Instant process can only display the content but not read it. Other
    // processes can't display it or read it.
    Liang Zhao . resolved

    Should we update the comments? With the new code/feature, we treat the process as non instant process at the process start time and update the registration later if it is decided that it is an instant process.

    Do we even need to check for command line switch?

    Wangsong Jin

    Updated. Previous we need it as we only call SetConfigurationOnProcessLockUpdate() with the feature enabled case. As we update to set params->is_instant_process for both command switches and feature flag, we can remove it now.

    Liang Zhao

    Ah. I missed that IsInstantProcess() also checks for command line switch. Both the current change and previous version work. While the current code is simpler, previous version (patchset 36) code should be safer against possible regression when the new feature is disabled. To de-risk while we experiment with the new feature, I feel that it might be better to keep the previous version of the code.
    Don't know what Daniel and Alex think.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alex Moshchuk
    • Daniel Cheng
    • Wangsong Jin
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
    Gerrit-Change-Number: 6373046
    Gerrit-PatchSet: 37
    Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
    Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
    Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
    Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
    Gerrit-CC: Charlie Reis <cr...@chromium.org>
    Gerrit-CC: Liang Zhao <lz...@microsoft.com>
    Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
    Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
    Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
    Gerrit-Comment-Date: Mon, 19 May 2025 20:46:01 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Liang Zhao <lz...@microsoft.com>
    Comment-In-Reply-To: Wangsong Jin <wangs...@microsoft.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Liang Zhao (Gerrit)

    unread,
    May 20, 2025, 2:37:19 PM5/20/25
    to Wangsong Jin, AyeAye, Daniel Cheng, Charlie Reis, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
    Attention needed from Alex Moshchuk, Daniel Cheng and Wangsong Jin

    Liang Zhao added 1 comment

    File chrome/browser/chrome_content_browser_client.cc
    Line 2061, Patchset 38 (Latest): if (base::FeatureList::IsEnabled(features::kInstantUsesSpareRenderer) &&
    Liang Zhao . unresolved

    If the feature is not enabled, we would never call SetConfigurationOnProcessLockUpdate. Should we move the feature check to the top of the function and return early if the feature is not enabled?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alex Moshchuk
    • Daniel Cheng
    • Wangsong Jin
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
      Gerrit-Change-Number: 6373046
      Gerrit-PatchSet: 38
      Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
      Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
      Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
      Gerrit-CC: Charlie Reis <cr...@chromium.org>
      Gerrit-CC: Liang Zhao <lz...@microsoft.com>
      Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
      Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
      Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
      Gerrit-Comment-Date: Tue, 20 May 2025 18:37:11 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Wangsong Jin (Gerrit)

      unread,
      May 20, 2025, 4:27:50 PM5/20/25
      to AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
      Attention needed from Alex Moshchuk, Daniel Cheng and Liang Zhao

      Wangsong Jin added 1 comment

      File chrome/browser/chrome_content_browser_client.cc
      Line 2061, Patchset 38: if (base::FeatureList::IsEnabled(features::kInstantUsesSpareRenderer) &&
      Liang Zhao . resolved

      If the feature is not enabled, we would never call SetConfigurationOnProcessLockUpdate. Should we move the feature check to the top of the function and return early if the feature is not enabled?

      Wangsong Jin

      Yes, it's better to return earlier. I've updated the function accordingly.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Alex Moshchuk
      • Daniel Cheng
      • Liang Zhao
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Review
      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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
      Gerrit-Change-Number: 6373046
      Gerrit-PatchSet: 39
      Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
      Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
      Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
      Gerrit-CC: Charlie Reis <cr...@chromium.org>
      Gerrit-CC: Liang Zhao <lz...@microsoft.com>
      Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
      Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
      Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
      Gerrit-Comment-Date: Tue, 20 May 2025 20:27:41 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Liang Zhao <lz...@microsoft.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Daniel Cheng (Gerrit)

      unread,
      May 20, 2025, 4:39:38 PM5/20/25
      to Wangsong Jin, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
      Attention needed from Alex Moshchuk and Liang Zhao

      Daniel Cheng added 1 comment

      File chrome/renderer/chrome_content_renderer_client.cc
      Daniel Cheng

      The CSA team chatted about this today. I would really like to avoid adding more ways to modify the URL scheme registry, even if they don't happen to hit the DCHECKs anymore. While there are other `Remove*` functions, they appear to be primarily (only?) used in tests, and should probably be marked as such. In general, we should treat the scheme registry as one-off registration, and not something we can go back and patch after the fact.

      We also think it's fragile to lean so heavily on the renderer to enforce that chrome-display: is only loaded "where it should be". Enforcing this should be two parts on the browser side:
      1. Make sure we don't provide a URLLoaderFactory for chrome-search subresources (and make sure the fallback URL loader factory doesn't inadvertently end up serving chrome-search).
      2. Somehow fixing navigations to block navigation requests unless this an NTP process is requesting to load chrome-search:// as a subframe. (This means that attempting to commit chrome-search:// as a main frame **also** should not work). I'm not quite sure what's involved; as you noted, it looks like passing -1 here: https://source.chromium.org/chromium/chromium/src/+/main:content/browser/webui/web_ui_url_loader_factory.cc;l=141;drc=743a82d08e59d803c94ee1b8564b8b11dd7b462f;bpv=0;bpt=1 is allowing checks to pass when it should be denied, i.e. I think this comment:
      ```
      // We pass the FrameTreeNode ID to get to the WebContents because requests
      // from frames can happen while the RFH is changed for a cross-process
      // navigation. The URLDataSources just need the WebContents; the specific
      // frame doesn't matter.
      ```
      is not quite correct–the specific frame making the request does matter.

      How does this work for "normal" WebUI schemes? I'd expect it to get blocked by ChildProcessSecurityPolicy or the like... in our discussion, we had mentioned using a navigation throttle, but I think this was actually removed in https://chromium-review.googlesource.com/c/chromium/src/+/2007813.
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Alex Moshchuk
      • Liang Zhao
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Review
      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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
      Gerrit-Change-Number: 6373046
      Gerrit-PatchSet: 38
      Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
      Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
      Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
      Gerrit-CC: Charlie Reis <cr...@chromium.org>
      Gerrit-CC: Liang Zhao <lz...@microsoft.com>
      Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
      Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
      Gerrit-Comment-Date: Tue, 20 May 2025 20:39:30 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
      Comment-In-Reply-To: Liang Zhao <lz...@microsoft.com>
      Comment-In-Reply-To: Wangsong Jin <wangs...@microsoft.com>
      Comment-In-Reply-To: Alex Moshchuk <ale...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Liang Zhao (Gerrit)

      unread,
      May 21, 2025, 6:18:53 PM5/21/25
      to Wangsong Jin, AyeAye, Daniel Cheng, Charlie Reis, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
      Attention needed from Alex Moshchuk and Wangsong Jin

      Liang Zhao added 1 comment

      File chrome/renderer/chrome_content_renderer_client.cc
      Line 1743, Patchset 29: WebSecurityPolicy::RegisterURLSchemeAsDisplayIsolated(chrome_search_scheme);
      Daniel Cheng . unresolved
      Liang Zhao

      Looks like normal WebUI schemes are called with RegisterURLSchemeAsDisplayIsolated() in renderer process and not called with RegisterWebSafeScheme() in browser process.

      If we use the renderer process id associated with the frame_tree_node_id, ShouldServiceRequest will work as expected and block the navigation.

      However, we might not want to block main frame navigation though. They are currently allowed and third party NTP is using chrome-search://local-ntp and remote-ntp.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Alex Moshchuk
      • Wangsong Jin
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
        Gerrit-Change-Number: 6373046
        Gerrit-PatchSet: 39
        Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
        Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
        Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
        Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
        Gerrit-CC: Charlie Reis <cr...@chromium.org>
        Gerrit-CC: Liang Zhao <lz...@microsoft.com>
        Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
        Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
        Gerrit-Comment-Date: Wed, 21 May 2025 22:18:44 +0000
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Wangsong Jin (Gerrit)

        unread,
        May 21, 2025, 7:28:51 PM5/21/25
        to AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
        Attention needed from Alex Moshchuk, Daniel Cheng and Liang Zhao

        Wangsong Jin added 1 comment

        File chrome/renderer/chrome_content_renderer_client.cc
        Line 1743, Patchset 29: WebSecurityPolicy::RegisterURLSchemeAsDisplayIsolated(chrome_search_scheme);
        Daniel Cheng . resolved
        Wangsong Jin

        Thanks!
        Removed all the chrome-search as a display-isolated scheme.

        Fixed the logic to return the actual render_process_id instead of -1 in `WebUIURLLoaderFactory`. And among all ShouldServiceRequest() implementations, only InstantService::ShouldServiceRequest() uses render_process_id, so this change looks safe. Also added a test: `ThirdPartyNTPBrowserTest.NonInstantProcessCannotEmbedChromeSearch` to ensure that non-Instant processes cannot embed a chrome-search:// iframe.

        This means that attempting to commit chrome-search:// as a main frame also should not work

        Currently on Edge, it's possible to navigate from a normal process to a chrome-search:// URL in the main frame. So we'd like to keep main frame behavior unchanged in this update.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Alex Moshchuk
        • Daniel Cheng
        • Liang Zhao
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Review
        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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
        Gerrit-Change-Number: 6373046
        Gerrit-PatchSet: 40
        Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
        Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
        Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
        Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
        Gerrit-CC: Charlie Reis <cr...@chromium.org>
        Gerrit-CC: Liang Zhao <lz...@microsoft.com>
        Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
        Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
        Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
        Gerrit-Comment-Date: Wed, 21 May 2025 23:28:33 +0000
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Liang Zhao (Gerrit)

        unread,
        May 21, 2025, 7:44:43 PM5/21/25
        to Wangsong Jin, AyeAye, Daniel Cheng, Charlie Reis, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
        Attention needed from Alex Moshchuk, Daniel Cheng and Wangsong Jin

        Liang Zhao added 2 comments

        File chrome/browser/ui/search/third_party_ntp_browsertest.cc
        Line 101, Patchset 40 (Latest): GURL non_instant_url = https_test_server().GetURL("accounts.google.com", "/");
        Liang Zhao . unresolved

        Can we use same url as in EmbeddedMostVisitedIframe test, or example.com or a.com if we want to avoid using ntp.com to avoid potential confusion?

        File chrome/renderer/chrome_content_renderer_client.cc
        Line 541, Patchset 40 (Parent): WebSecurityPolicy::RegisterURLSchemeAsDisplayIsolated(chrome_search_scheme);
        Liang Zhao . unresolved
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Alex Moshchuk
        • Daniel Cheng
        • Wangsong Jin
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
          Gerrit-Change-Number: 6373046
          Gerrit-PatchSet: 40
          Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
          Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
          Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
          Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
          Gerrit-CC: Charlie Reis <cr...@chromium.org>
          Gerrit-CC: Liang Zhao <lz...@microsoft.com>
          Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
          Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
          Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
          Gerrit-Comment-Date: Wed, 21 May 2025 23:44:34 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Wangsong Jin (Gerrit)

          unread,
          May 21, 2025, 8:37:13 PM5/21/25
          to AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
          Attention needed from Alex Moshchuk, Daniel Cheng and Liang Zhao

          Wangsong Jin added 2 comments

          File chrome/browser/ui/search/third_party_ntp_browsertest.cc
          Line 101, Patchset 40: GURL non_instant_url = https_test_server().GetURL("accounts.google.com", "/");
          Liang Zhao . resolved

          Can we use same url as in EmbeddedMostVisitedIframe test, or example.com or a.com if we want to avoid using ntp.com to avoid potential confusion?

          Wangsong Jin

          Done

          File chrome/renderer/chrome_content_renderer_client.cc
          Line 541, Patchset 40 (Parent): WebSecurityPolicy::RegisterURLSchemeAsDisplayIsolated(chrome_search_scheme);
          Liang Zhao . resolved
          Wangsong Jin

          Done

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Alex Moshchuk
          • Daniel Cheng
          • Liang Zhao
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Review
          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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
          Gerrit-Change-Number: 6373046
          Gerrit-PatchSet: 41
          Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
          Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
          Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
          Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
          Gerrit-CC: Charlie Reis <cr...@chromium.org>
          Gerrit-CC: Liang Zhao <lz...@microsoft.com>
          Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
          Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
          Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
          Gerrit-Comment-Date: Thu, 22 May 2025 00:37:02 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Liang Zhao <lz...@microsoft.com>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Daniel Cheng (Gerrit)

          unread,
          May 23, 2025, 1:38:16 PM5/23/25
          to Wangsong Jin, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
          Attention needed from Alex Moshchuk, Liang Zhao and Wangsong Jin

          Daniel Cheng added 2 comments

          File content/browser/webui/web_ui_url_loader_factory.cc
          Line 141, Patchset 43 (Latest): if (!request.is_outermost_main_frame) {
          Daniel Cheng . unresolved

          Is there a chance this will be racy? Is it possible for one RFH to start the navigation, and then get it swapped out in a way that would cause subsequent checks to pass when they should have failed?

          I think this would be a pretty rare edge case (since non-WebUI shouldn't be able to navigate to WebUI... but I don't know if there are weird edge cases here, e.g. if we use chrome-untrusted: to implement something), and maybe the BrowsingInstance swap we force on transitions between WebUI and non-WebUI pages prevents this... but it'd probably be good to have a comment here that describes why this isn't problematic if so.

          File third_party/blink/public/web/web_security_policy.h
          File-level comment, Patchset 43 (Latest):
          Daniel Cheng . unresolved

          Are these changes still needed?

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Alex Moshchuk
          • Liang Zhao
          • Wangsong Jin
          Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
            Gerrit-Change-Number: 6373046
            Gerrit-PatchSet: 43
            Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
            Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
            Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
            Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
            Gerrit-CC: Charlie Reis <cr...@chromium.org>
            Gerrit-CC: Liang Zhao <lz...@microsoft.com>
            Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
            Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
            Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
            Gerrit-Comment-Date: Fri, 23 May 2025 17:38:06 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Liang Zhao (Gerrit)

            unread,
            May 23, 2025, 1:53:21 PM5/23/25
            to Wangsong Jin, AyeAye, Daniel Cheng, Charlie Reis, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
            Attention needed from Alex Moshchuk and Wangsong Jin

            Liang Zhao added 1 comment

            File content/browser/webui/web_ui_url_loader_factory.cc
            Line 141, Patchset 43 (Latest): if (!request.is_outermost_main_frame) {
            Daniel Cheng . unresolved

            Is there a chance this will be racy? Is it possible for one RFH to start the navigation, and then get it swapped out in a way that would cause subsequent checks to pass when they should have failed?

            I think this would be a pretty rare edge case (since non-WebUI shouldn't be able to navigate to WebUI... but I don't know if there are weird edge cases here, e.g. if we use chrome-untrusted: to implement something), and maybe the BrowsingInstance swap we force on transitions between WebUI and non-WebUI pages prevents this... but it'd probably be good to have a comment here that describes why this isn't problematic if so.

            Liang Zhao

            The process id is only used for checking whether it is in instant process. For the purpose of that check, the potential race condition risk should not matter. There should not be a case where navigation in non instant process get assigned to an instant process.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Alex Moshchuk
            • Wangsong Jin
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
            Gerrit-Change-Number: 6373046
            Gerrit-PatchSet: 43
            Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
            Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
            Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
            Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
            Gerrit-CC: Charlie Reis <cr...@chromium.org>
            Gerrit-CC: Liang Zhao <lz...@microsoft.com>
            Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
            Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
            Gerrit-Comment-Date: Fri, 23 May 2025 17:53:11 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Wangsong Jin (Gerrit)

            unread,
            May 23, 2025, 5:23:28 PM5/23/25
            to AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
            Attention needed from Alex Moshchuk and Daniel Cheng

            Wangsong Jin added 2 comments

            File third_party/blink/public/web/web_security_policy.h
            File-level comment, Patchset 43:
            Daniel Cheng . resolved

            Are these changes still needed?

            Wangsong Jin

            Ah, deleted that one.

            File third_party/blink/renderer/platform/weborigin/scheme_registry.h
            Line 54, Patchset 45 (Parent):
            Wangsong Jin . unresolved

            I will reset this blank space in next patchset

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Alex Moshchuk
            • Daniel Cheng
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
            Gerrit-Change-Number: 6373046
            Gerrit-PatchSet: 45
            Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
            Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
            Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
            Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
            Gerrit-CC: Charlie Reis <cr...@chromium.org>
            Gerrit-CC: Liang Zhao <lz...@microsoft.com>
            Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
            Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
            Gerrit-Comment-Date: Fri, 23 May 2025 21:23:19 +0000
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Liang Zhao (Gerrit)

            unread,
            May 27, 2025, 12:50:37 PM5/27/25
            to Wangsong Jin, AyeAye, Daniel Cheng, Charlie Reis, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
            Attention needed from Alex Moshchuk, Daniel Cheng and Wangsong Jin

            Liang Zhao added 1 comment

            File content/browser/webui/web_ui_url_loader_factory.cc
            Line 141, Patchset 43: if (!request.is_outermost_main_frame) {
            Daniel Cheng . unresolved

            Is there a chance this will be racy? Is it possible for one RFH to start the navigation, and then get it swapped out in a way that would cause subsequent checks to pass when they should have failed?

            I think this would be a pretty rare edge case (since non-WebUI shouldn't be able to navigate to WebUI... but I don't know if there are weird edge cases here, e.g. if we use chrome-untrusted: to implement something), and maybe the BrowsingInstance swap we force on transitions between WebUI and non-WebUI pages prevents this... but it'd probably be good to have a comment here that describes why this isn't problematic if so.

            Liang Zhao

            The process id is only used for checking whether it is in instant process. For the purpose of that check, the potential race condition risk should not matter. There should not be a case where navigation in non instant process get assigned to an instant process.

            Liang Zhao

            Would it better if we capture the render process id when WebUIURLLoaderFactory is created? It should address the race condition concern and also avoid calculating the render process id for every sub resource loading.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Alex Moshchuk
            • Daniel Cheng
            • Wangsong Jin
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
            Gerrit-Change-Number: 6373046
            Gerrit-PatchSet: 45
            Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
            Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
            Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
            Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
            Gerrit-CC: Charlie Reis <cr...@chromium.org>
            Gerrit-CC: Liang Zhao <lz...@microsoft.com>
            Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
            Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
            Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
            Gerrit-Comment-Date: Tue, 27 May 2025 16:50:25 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
            Comment-In-Reply-To: Liang Zhao <lz...@microsoft.com>
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Wangsong Jin (Gerrit)

            unread,
            May 27, 2025, 4:51:15 PM5/27/25
            to AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
            Attention needed from Alex Moshchuk, Daniel Cheng and Liang Zhao

            Wangsong Jin added 2 comments

            File content/browser/webui/web_ui_url_loader_factory.cc
            Line 141, Patchset 43: if (!request.is_outermost_main_frame) {
            Daniel Cheng . resolved

            Is there a chance this will be racy? Is it possible for one RFH to start the navigation, and then get it swapped out in a way that would cause subsequent checks to pass when they should have failed?

            I think this would be a pretty rare edge case (since non-WebUI shouldn't be able to navigate to WebUI... but I don't know if there are weird edge cases here, e.g. if we use chrome-untrusted: to implement something), and maybe the BrowsingInstance swap we force on transitions between WebUI and non-WebUI pages prevents this... but it'd probably be good to have a comment here that describes why this isn't problematic if so.

            Liang Zhao

            The process id is only used for checking whether it is in instant process. For the purpose of that check, the potential race condition risk should not matter. There should not be a case where navigation in non instant process get assigned to an instant process.

            Liang Zhao

            Would it better if we capture the render process id when WebUIURLLoaderFactory is created? It should address the race condition concern and also avoid calculating the render process id for every sub resource loading.

            Wangsong Jin

            Thanks, refined.

            File third_party/blink/renderer/platform/weborigin/scheme_registry.h
            Wangsong Jin . resolved

            I will reset this blank space in next patchset

            Wangsong Jin

            Done

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Alex Moshchuk
            • Daniel Cheng
            • Liang Zhao
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Review
            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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
            Gerrit-Change-Number: 6373046
            Gerrit-PatchSet: 46
            Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
            Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
            Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
            Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
            Gerrit-CC: Charlie Reis <cr...@chromium.org>
            Gerrit-CC: Liang Zhao <lz...@microsoft.com>
            Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
            Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
            Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
            Gerrit-Comment-Date: Tue, 27 May 2025 20:51:04 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
            Comment-In-Reply-To: Liang Zhao <lz...@microsoft.com>
            Comment-In-Reply-To: Wangsong Jin <wangs...@microsoft.com>
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Liang Zhao (Gerrit)

            unread,
            May 27, 2025, 5:00:05 PM5/27/25
            to Wangsong Jin, AyeAye, Daniel Cheng, Charlie Reis, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
            Attention needed from Alex Moshchuk, Daniel Cheng and Wangsong Jin

            Liang Zhao added 2 comments

            File content/browser/webui/web_ui_url_loader_factory.cc
            Line 143, Patchset 46 (Latest): // instant process. If the request is from the outer most main frame, we
            // set the render process id to -1 to preserve the existing behavior,
            Liang Zhao . unresolved

            We might be able to move this logic also to object creation time. FWIW, we are also using -1 for service worker.

            Line 245, Patchset 46 (Latest): ftn->current_frame_host()->GetBrowserContext(),
            Liang Zhao . unresolved

            This code implies that ftn->current_frame_host() should not be null and therefore we don't have to check ftn and rfh not null.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Alex Moshchuk
            • Daniel Cheng
            • Wangsong Jin
            Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement is not satisfiedCode-Review
              • requirement is not satisfiedNo-Unresolved-Comments
              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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
              Gerrit-Change-Number: 6373046
              Gerrit-PatchSet: 46
              Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
              Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
              Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
              Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
              Gerrit-CC: Charlie Reis <cr...@chromium.org>
              Gerrit-CC: Liang Zhao <lz...@microsoft.com>
              Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
              Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
              Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
              Gerrit-Comment-Date: Tue, 27 May 2025 20:59:57 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Wangsong Jin (Gerrit)

              unread,
              May 27, 2025, 5:52:57 PM5/27/25
              to AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
              Attention needed from Daniel Cheng and Liang Zhao

              Wangsong Jin added 2 comments

              File content/browser/webui/web_ui_url_loader_factory.cc
              Line 143, Patchset 46: // instant process. If the request is from the outer most main frame, we

              // set the render process id to -1 to preserve the existing behavior,
              Liang Zhao . resolved

              We might be able to move this logic also to object creation time. FWIW, we are also using -1 for service worker.

              Wangsong Jin

              Updated!

              Line 245, Patchset 46: ftn->current_frame_host()->GetBrowserContext(),
              Liang Zhao . resolved

              This code implies that ftn->current_frame_host() should not be null and therefore we don't have to check ftn and rfh not null.

              Wangsong Jin

              Done

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Daniel Cheng
              • Liang Zhao
              Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement is not satisfiedCode-Review
              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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
              Gerrit-Change-Number: 6373046
              Gerrit-PatchSet: 47
              Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
              Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
              Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
              Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
              Gerrit-CC: Charlie Reis <cr...@chromium.org>
              Gerrit-CC: Liang Zhao <lz...@microsoft.com>
              Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
              Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
              Gerrit-Comment-Date: Tue, 27 May 2025 21:52:48 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              Comment-In-Reply-To: Liang Zhao <lz...@microsoft.com>
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Daniel Cheng (Gerrit)

              unread,
              May 30, 2025, 2:14:49 PM5/30/25
              to Wangsong Jin, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
              Attention needed from Liang Zhao and Wangsong Jin

              Daniel Cheng added 6 comments

              Patchset-level comments
              File-level comment, Patchset 47 (Latest):
              Daniel Cheng . resolved

              I didn't review the tests nor the new `render_process_id` in the web UI url loader factory in a lot of detail, but they look approximately correct to me.

              File chrome/browser/chrome_content_browser_client.cc
              Line 1004, Patchset 47 (Latest): return mojo::AssociatedRemote<chrome::mojom::RendererConfiguration>();
              Daniel Cheng . unresolved

              You could `return mojo::NullAssociatedRemote()` here if you wanted.

              That being said, is there any reasonable world where we'd actually have no channel here? It seems undesirable to silently fail in this case, because then the first-time init would just not happen...

              Line 1914, Patchset 47 (Latest): renderer_configuration->SetConfigurationOnProcessLockUpdate(
              Daniel Cheng . resolved

              i.e. we should be able to assume we have a ChannelProxy here probably?

              File chrome/browser/ui/search/third_party_ntp_browsertest.cc
              Line 214, Patchset 47 (Latest): https_test_server().GetURL("ntp.com", "/instant_extended.html");
              Daniel Cheng . unresolved

              Nit: I think it would be safe to use something like ntp.example.com

              There's no real guarantee where ntp.com will point.

              File chrome/renderer/chrome_render_thread_observer.cc
              Line 229, Patchset 47 (Latest): // once and do not change.
              Daniel Cheng . unresolved

              When would we call this again?

              Line 232, Patchset 47 (Latest): process_state::SetIsInstantProcess(params ? params->is_instant_process
              Daniel Cheng . unresolved

              We don't need to check that this is not null; it's not marked nullable in method declaration in the mojom, so Mojo will enforce this is always set.

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Liang Zhao
              • Wangsong Jin
              Submit Requirements:
                • requirement satisfiedCode-Coverage
                • requirement is not satisfiedCode-Review
                • requirement is not satisfiedNo-Unresolved-Comments
                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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                Gerrit-Change-Number: 6373046
                Gerrit-PatchSet: 47
                Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
                Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
                Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
                Gerrit-CC: Charlie Reis <cr...@chromium.org>
                Gerrit-CC: Liang Zhao <lz...@microsoft.com>
                Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
                Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
                Gerrit-Comment-Date: Fri, 30 May 2025 18:14:40 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: No
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Wangsong Jin (Gerrit)

                unread,
                May 30, 2025, 7:50:34 PM5/30/25
                to AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                Attention needed from Alex Moshchuk, Daniel Cheng and Liang Zhao

                Wangsong Jin added 5 comments

                Patchset-level comments
                File-level comment, Patchset 47:
                Wangsong Jin . resolved

                Hi, I really appreciate all the valuable feedback on this change.
                I think now is a fair time to bring in additional reviews. Since this CL involves considerable amount of contexts, could you help loop in any key OWNERS you think would be a good fit to review? I’ll make sure to add the remaining reviewers as needed. cc: alexmos@, dcheng@ Thanks a lot!

                File chrome/browser/chrome_content_browser_client.cc
                Line 1004, Patchset 47: return mojo::AssociatedRemote<chrome::mojom::RendererConfiguration>();
                Daniel Cheng . unresolved

                You could `return mojo::NullAssociatedRemote()` here if you wanted.

                That being said, is there any reasonable world where we'd actually have no channel here? It seems undesirable to silently fail in this case, because then the first-time init would just not happen...

                Wangsong Jin

                I followed existing pattern to setup [GetRendererConfiguration](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/profiles/renderer_updater.cc;l=174?q=GetRendererConfiguration()&ss=chromium%2Fchromium%2Fsrc:chrome%2F). If the renderer process died unexpectedly, the channel would be null and we don't want to crash browser process if that happened. So I don't add CHECK for renderer_configuration.

                File chrome/browser/ui/search/third_party_ntp_browsertest.cc
                Line 214, Patchset 47: https_test_server().GetURL("ntp.com", "/instant_extended.html");
                Daniel Cheng . resolved

                Nit: I think it would be safe to use something like ntp.example.com

                There's no real guarantee where ntp.com will point.

                Wangsong Jin

                Done

                File chrome/renderer/chrome_render_thread_observer.cc
                Line 229, Patchset 47: // once and do not change.
                Daniel Cheng . unresolved

                When would we call this again?

                Wangsong Jin

                Both RenderProcessHostImpl::OnProcessLaunched() and RenderProcessHostImpl::SetProcessLock() call NotifyRendererOfLockedStateUpdate(), which in turn triggers OnRendererProcessLockedStateUpdated() → SetConfigurationOnProcessLockUpdate(). As a result, if params->is_instant_process == true, SetConfigurationOnProcessLockUpdate() may be invoked twice

                More specifically:
                1. Instant process with existing command-line switch:
                SetConfigurationOnProcessLockUpdate() is never called. The configuration setting is skipped, and the command-line switch is used directly in IsInstantProcess() check.

                2. Instant process set with process_state and a spare renderer available:
                SetConfigurationOnProcessLockUpdate() is called only once for third party NTPs. This is because OnProcessLaunched() is triggered during spare renderer creation, but is_instant_process is false at that point, so the update is skipped.

                3. Instant process set with process_state and no spare renderer available:
                A new process is created, and SetConfigurationOnProcessLockUpdate() is called twice for third party NTPs.

                This guard is just to prevent potential issue from future changes. Personally, I think we'd better add some guards for other fields that are also meant to be set only once in NotifyRendererOfLockedStateUpdate() to prevent from unintentionally modifying renderer settings.

                Line 232, Patchset 47: process_state::SetIsInstantProcess(params ? params->is_instant_process
                Daniel Cheng . resolved

                We don't need to check that this is not null; it's not marked nullable in method declaration in the mojom, so Mojo will enforce this is always set.

                Wangsong Jin

                Done

                Open in Gerrit

                Related details

                Attention is currently required from:
                • Alex Moshchuk
                • Daniel Cheng
                • Liang Zhao
                Submit Requirements:
                • requirement satisfiedCode-Coverage
                • requirement is not satisfiedCode-Review
                • requirement is not satisfiedNo-Unresolved-Comments
                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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                Gerrit-Change-Number: 6373046
                Gerrit-PatchSet: 48
                Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
                Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
                Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
                Gerrit-CC: Charlie Reis <cr...@chromium.org>
                Gerrit-CC: Liang Zhao <lz...@microsoft.com>
                Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
                Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                Gerrit-Comment-Date: Fri, 30 May 2025 23:50:26 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: No
                Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Liang Zhao (Gerrit)

                unread,
                Jun 2, 2025, 12:39:48 PM6/2/25
                to Wangsong Jin, AyeAye, Daniel Cheng, Charlie Reis, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                Attention needed from Alex Moshchuk, Daniel Cheng and Wangsong Jin

                Liang Zhao added 1 comment

                File chrome/browser/ui/search/third_party_ntp_browsertest.cc
                Line 214, Patchset 47: https_test_server().GetURL("ntp.com", "/instant_extended.html");
                Daniel Cheng . resolved

                Nit: I think it would be safe to use something like ntp.example.com

                There's no real guarantee where ntp.com will point.

                Wangsong Jin

                Done

                Liang Zhao

                There actually is no need to change to ntp.example.com. This test does ` host_resolver()->AddRule("*", "127.0.0.1");` in its SetUpOnMainThread() to ensure that all hosts are resolved to the test server.

                Open in Gerrit

                Related details

                Attention is currently required from:
                • Alex Moshchuk
                • Daniel Cheng
                • Wangsong Jin
                Submit Requirements:
                • requirement satisfiedCode-Coverage
                • requirement is not satisfiedCode-Review
                • requirement is not satisfiedNo-Unresolved-Comments
                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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                Gerrit-Change-Number: 6373046
                Gerrit-PatchSet: 48
                Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
                Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
                Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
                Gerrit-CC: Charlie Reis <cr...@chromium.org>
                Gerrit-CC: Liang Zhao <lz...@microsoft.com>
                Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
                Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                Gerrit-Comment-Date: Mon, 02 Jun 2025 16:39:39 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: No
                Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
                Comment-In-Reply-To: Wangsong Jin <wangs...@microsoft.com>
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Daniel Cheng (Gerrit)

                unread,
                Jun 2, 2025, 2:32:48 PM6/2/25
                to Wangsong Jin, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                Attention needed from Alex Moshchuk, Liang Zhao and Wangsong Jin

                Daniel Cheng added 3 comments

                File chrome/browser/chrome_content_browser_client.cc
                Line 1004, Patchset 47: return mojo::AssociatedRemote<chrome::mojom::RendererConfiguration>();
                Daniel Cheng . resolved

                You could `return mojo::NullAssociatedRemote()` here if you wanted.

                That being said, is there any reasonable world where we'd actually have no channel here? It seems undesirable to silently fail in this case, because then the first-time init would just not happen...

                Wangsong Jin

                I followed existing pattern to setup [GetRendererConfiguration](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/profiles/renderer_updater.cc;l=174?q=GetRendererConfiguration()&ss=chromium%2Fchromium%2Fsrc:chrome%2F). If the renderer process died unexpectedly, the channel would be null and we don't want to crash browser process if that happened. So I don't add CHECK for renderer_configuration.

                Daniel Cheng

                Acknowledged

                File chrome/browser/ui/search/third_party_ntp_browsertest.cc
                Line 214, Patchset 47: https_test_server().GetURL("ntp.com", "/instant_extended.html");
                Daniel Cheng . resolved

                Nit: I think it would be safe to use something like ntp.example.com

                There's no real guarantee where ntp.com will point.

                Wangsong Jin

                Done

                Liang Zhao

                There actually is no need to change to ntp.example.com. This test does ` host_resolver()->AddRule("*", "127.0.0.1");` in its SetUpOnMainThread() to ensure that all hosts are resolved to the test server.

                Daniel Cheng

                I understand that, but I don't really want random hostnames that aren't controlled in our code. ntp.com doesn't really point to anything right now, but it could point to something unfortunate in the future.

                File chrome/renderer/chrome_render_thread_observer.cc
                Line 229, Patchset 47: // once and do not change.
                Daniel Cheng . unresolved

                When would we call this again?

                Wangsong Jin

                Both RenderProcessHostImpl::OnProcessLaunched() and RenderProcessHostImpl::SetProcessLock() call NotifyRendererOfLockedStateUpdate(), which in turn triggers OnRendererProcessLockedStateUpdated() → SetConfigurationOnProcessLockUpdate(). As a result, if params->is_instant_process == true, SetConfigurationOnProcessLockUpdate() may be invoked twice

                More specifically:
                1. Instant process with existing command-line switch:
                SetConfigurationOnProcessLockUpdate() is never called. The configuration setting is skipped, and the command-line switch is used directly in IsInstantProcess() check.

                2. Instant process set with process_state and a spare renderer available:
                SetConfigurationOnProcessLockUpdate() is called only once for third party NTPs. This is because OnProcessLaunched() is triggered during spare renderer creation, but is_instant_process is false at that point, so the update is skipped.

                3. Instant process set with process_state and no spare renderer available:
                A new process is created, and SetConfigurationOnProcessLockUpdate() is called twice for third party NTPs.

                This guard is just to prevent potential issue from future changes. Personally, I think we'd better add some guards for other fields that are also meant to be set only once in NotifyRendererOfLockedStateUpdate() to prevent from unintentionally modifying renderer settings.

                Daniel Cheng

                It feels kind of messy that the static configuration would be sent more than once :)

                Can the browser check if the static config has changed and skip sending the update the second time?

                (And if it has changed, that seems like a browser bug...)

                Open in Gerrit

                Related details

                Attention is currently required from:
                • Alex Moshchuk
                • Liang Zhao
                • Wangsong Jin
                Submit Requirements:
                • requirement satisfiedCode-Coverage
                • requirement is not satisfiedCode-Review
                • requirement is not satisfiedNo-Unresolved-Comments
                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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                Gerrit-Change-Number: 6373046
                Gerrit-PatchSet: 49
                Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
                Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
                Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
                Gerrit-CC: Charlie Reis <cr...@chromium.org>
                Gerrit-CC: Liang Zhao <lz...@microsoft.com>
                Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
                Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
                Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                Gerrit-Comment-Date: Mon, 02 Jun 2025 18:32:39 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: No
                Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
                Comment-In-Reply-To: Wangsong Jin <wangs...@microsoft.com>
                Comment-In-Reply-To: Liang Zhao <lz...@microsoft.com>
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Wangsong Jin (Gerrit)

                unread,
                Jun 2, 2025, 7:05:24 PM6/2/25
                to AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                Attention needed from Alex Moshchuk, Daniel Cheng and Liang Zhao

                Wangsong Jin added 2 comments

                File chrome/browser/ui/search/third_party_ntp_browsertest.cc
                Line 214, Patchset 47: https_test_server().GetURL("ntp.com", "/instant_extended.html");
                Daniel Cheng . resolved

                Nit: I think it would be safe to use something like ntp.example.com

                There's no real guarantee where ntp.com will point.

                Wangsong Jin

                Done

                Liang Zhao

                There actually is no need to change to ntp.example.com. This test does ` host_resolver()->AddRule("*", "127.0.0.1");` in its SetUpOnMainThread() to ensure that all hosts are resolved to the test server.

                Wangsong Jin

                Updated all domain to ntp.example.com

                File chrome/renderer/chrome_render_thread_observer.cc
                Line 229, Patchset 47: // once and do not change.
                Daniel Cheng . unresolved

                When would we call this again?

                Wangsong Jin

                Both RenderProcessHostImpl::OnProcessLaunched() and RenderProcessHostImpl::SetProcessLock() call NotifyRendererOfLockedStateUpdate(), which in turn triggers OnRendererProcessLockedStateUpdated() → SetConfigurationOnProcessLockUpdate(). As a result, if params->is_instant_process == true, SetConfigurationOnProcessLockUpdate() may be invoked twice

                More specifically:
                1. Instant process with existing command-line switch:
                SetConfigurationOnProcessLockUpdate() is never called. The configuration setting is skipped, and the command-line switch is used directly in IsInstantProcess() check.

                2. Instant process set with process_state and a spare renderer available:
                SetConfigurationOnProcessLockUpdate() is called only once for third party NTPs. This is because OnProcessLaunched() is triggered during spare renderer creation, but is_instant_process is false at that point, so the update is skipped.

                3. Instant process set with process_state and no spare renderer available:
                A new process is created, and SetConfigurationOnProcessLockUpdate() is called twice for third party NTPs.

                This guard is just to prevent potential issue from future changes. Personally, I think we'd better add some guards for other fields that are also meant to be set only once in NotifyRendererOfLockedStateUpdate() to prevent from unintentionally modifying renderer settings.

                Daniel Cheng

                It feels kind of messy that the static configuration would be sent more than once :)

                Can the browser check if the static config has changed and skip sending the update the second time?

                (And if it has changed, that seems like a browser bug...)

                Wangsong Jin

                Thanks!
                Added GetUserData(kRendererConfigurationStaticParamsKey) to save the stage per render process host. This avoids calling the SetConfigurationOnProcessLockUpdate() mojo method a second time. Also added a CHECK on browser side to ensure static params won't change.

                Open in Gerrit

                Related details

                Attention is currently required from:
                • Alex Moshchuk
                • Daniel Cheng
                • Liang Zhao
                Submit Requirements:
                • requirement satisfiedCode-Coverage
                • requirement is not satisfiedCode-Review
                • requirement is not satisfiedNo-Unresolved-Comments
                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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                Gerrit-Change-Number: 6373046
                Gerrit-PatchSet: 50
                Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
                Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
                Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
                Gerrit-CC: Charlie Reis <cr...@chromium.org>
                Gerrit-CC: Liang Zhao <lz...@microsoft.com>
                Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
                Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                Gerrit-Comment-Date: Mon, 02 Jun 2025 23:05:13 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: No
                Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Liang Zhao (Gerrit)

                unread,
                Jun 2, 2025, 7:46:23 PM6/2/25
                to Wangsong Jin, AyeAye, Daniel Cheng, Charlie Reis, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                Attention needed from Alex Moshchuk, Daniel Cheng and Wangsong Jin

                Liang Zhao added 3 comments

                File chrome/browser/chrome_content_browser_client.cc
                Line 1932, Patchset 50 (Latest): host->GetUserData(kRendererConfigurationStaticParamsKey));
                Liang Zhao . unresolved

                Could we avoid calling GetUserData() twice?

                Line 1934, Patchset 50 (Latest): CHECK(stored_params->Equals(params->Clone()));
                Liang Zhao . unresolved

                Do we have to call Clone() here and when calling SetConfigurationOnProcessLockUpdate?

                File chrome/renderer/chrome_render_thread_observer.cc
                Line 231, Patchset 50 (Latest): if (!static_params_) {
                Liang Zhao . unresolved

                With the CHECK above, don't need this check anymore

                Open in Gerrit

                Related details

                Attention is currently required from:
                • Alex Moshchuk
                • Daniel Cheng
                • Wangsong Jin
                Submit Requirements:
                • requirement satisfiedCode-Coverage
                • requirement is not satisfiedCode-Review
                • requirement is not satisfiedNo-Unresolved-Comments
                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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                Gerrit-Change-Number: 6373046
                Gerrit-PatchSet: 50
                Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
                Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
                Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
                Gerrit-CC: Charlie Reis <cr...@chromium.org>
                Gerrit-CC: Liang Zhao <lz...@microsoft.com>
                Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
                Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                Gerrit-Comment-Date: Mon, 02 Jun 2025 23:46:12 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: No
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Wangsong Jin (Gerrit)

                unread,
                Jun 2, 2025, 8:35:29 PM6/2/25
                to AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                Attention needed from Alex Moshchuk, Daniel Cheng and Liang Zhao

                Wangsong Jin added 3 comments

                File chrome/browser/chrome_content_browser_client.cc
                Line 1934, Patchset 50 (Latest): CHECK(stored_params->Equals(params->Clone()));
                Liang Zhao . resolved

                Do we have to call Clone() here and when calling SetConfigurationOnProcessLockUpdate?

                Wangsong Jin

                Done

                File chrome/renderer/chrome_render_thread_observer.cc
                Line 229, Patchset 47: // once and do not change.
                Daniel Cheng . unresolved

                When would we call this again?

                Wangsong Jin

                Both RenderProcessHostImpl::OnProcessLaunched() and RenderProcessHostImpl::SetProcessLock() call NotifyRendererOfLockedStateUpdate(), which in turn triggers OnRendererProcessLockedStateUpdated() → SetConfigurationOnProcessLockUpdate(). As a result, if params->is_instant_process == true, SetConfigurationOnProcessLockUpdate() may be invoked twice

                More specifically:
                1. Instant process with existing command-line switch:
                SetConfigurationOnProcessLockUpdate() is never called. The configuration setting is skipped, and the command-line switch is used directly in IsInstantProcess() check.

                2. Instant process set with process_state and a spare renderer available:
                SetConfigurationOnProcessLockUpdate() is called only once for third party NTPs. This is because OnProcessLaunched() is triggered during spare renderer creation, but is_instant_process is false at that point, so the update is skipped.

                3. Instant process set with process_state and no spare renderer available:
                A new process is created, and SetConfigurationOnProcessLockUpdate() is called twice for third party NTPs.

                This guard is just to prevent potential issue from future changes. Personally, I think we'd better add some guards for other fields that are also meant to be set only once in NotifyRendererOfLockedStateUpdate() to prevent from unintentionally modifying renderer settings.

                Daniel Cheng

                It feels kind of messy that the static configuration would be sent more than once :)

                Can the browser check if the static config has changed and skip sending the update the second time?

                (And if it has changed, that seems like a browser bug...)

                Wangsong Jin

                Thanks!
                Added GetUserData(kRendererConfigurationStaticParamsKey) to save the stage per render process host. This avoids calling the SetConfigurationOnProcessLockUpdate() mojo method a second time. Also added a CHECK on browser side to ensure static params won't change.

                Wangsong Jin

                Well, this change could affect a case where an instant renderer process crashes. When the crashed page is reloaded, the same RenderProcessHost is reused, which preserves its UserData state. As a result, SetConfigurationOnProcessLockUpdate() is skipped for the new renderer process.

                Line 231, Patchset 50 (Latest): if (!static_params_) {
                Liang Zhao . resolved

                With the CHECK above, don't need this check anymore

                Wangsong Jin

                Removed.

                Open in Gerrit

                Related details

                Attention is currently required from:
                • Alex Moshchuk
                • Daniel Cheng
                • Liang Zhao
                Submit Requirements:
                • requirement satisfiedCode-Coverage
                • requirement is not satisfiedCode-Review
                • requirement is not satisfiedNo-Unresolved-Comments
                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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                Gerrit-Change-Number: 6373046
                Gerrit-PatchSet: 50
                Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
                Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
                Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
                Gerrit-CC: Charlie Reis <cr...@chromium.org>
                Gerrit-CC: Liang Zhao <lz...@microsoft.com>
                Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
                Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                Gerrit-Comment-Date: Tue, 03 Jun 2025 00:35:18 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: No
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Wangsong Jin (Gerrit)

                unread,
                Jun 2, 2025, 8:35:47 PM6/2/25
                to AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                Attention needed from Alex Moshchuk, Daniel Cheng and Liang Zhao

                Wangsong Jin added 1 comment

                File chrome/browser/chrome_content_browser_client.cc
                Line 1932, Patchset 50 (Latest): host->GetUserData(kRendererConfigurationStaticParamsKey));
                Liang Zhao . resolved

                Could we avoid calling GetUserData() twice?

                Wangsong Jin

                Done

                Gerrit-Comment-Date: Tue, 03 Jun 2025 00:35:34 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: No
                Comment-In-Reply-To: Liang Zhao <lz...@microsoft.com>
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Wangsong Jin (Gerrit)

                unread,
                Jun 3, 2025, 12:43:44 PM6/3/25
                to AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                Attention needed from Alex Moshchuk, Daniel Cheng and Liang Zhao

                Wangsong Jin added 1 comment

                File chrome/renderer/chrome_render_thread_observer.cc
                Line 229, Patchset 47: // once and do not change.
                Daniel Cheng . unresolved

                When would we call this again?

                Wangsong Jin

                Both RenderProcessHostImpl::OnProcessLaunched() and RenderProcessHostImpl::SetProcessLock() call NotifyRendererOfLockedStateUpdate(), which in turn triggers OnRendererProcessLockedStateUpdated() → SetConfigurationOnProcessLockUpdate(). As a result, if params->is_instant_process == true, SetConfigurationOnProcessLockUpdate() may be invoked twice

                More specifically:
                1. Instant process with existing command-line switch:
                SetConfigurationOnProcessLockUpdate() is never called. The configuration setting is skipped, and the command-line switch is used directly in IsInstantProcess() check.

                2. Instant process set with process_state and a spare renderer available:
                SetConfigurationOnProcessLockUpdate() is called only once for third party NTPs. This is because OnProcessLaunched() is triggered during spare renderer creation, but is_instant_process is false at that point, so the update is skipped.

                3. Instant process set with process_state and no spare renderer available:
                A new process is created, and SetConfigurationOnProcessLockUpdate() is called twice for third party NTPs.

                This guard is just to prevent potential issue from future changes. Personally, I think we'd better add some guards for other fields that are also meant to be set only once in NotifyRendererOfLockedStateUpdate() to prevent from unintentionally modifying renderer settings.

                Daniel Cheng

                It feels kind of messy that the static configuration would be sent more than once :)

                Can the browser check if the static config has changed and skip sending the update the second time?

                (And if it has changed, that seems like a browser bug...)

                Wangsong Jin

                Thanks!
                Added GetUserData(kRendererConfigurationStaticParamsKey) to save the stage per render process host. This avoids calling the SetConfigurationOnProcessLockUpdate() mojo method a second time. Also added a CHECK on browser side to ensure static params won't change.

                Wangsong Jin

                Well, this change could affect a case where an instant renderer process crashes. When the crashed page is reloaded, the same RenderProcessHost is reused, which preserves its UserData state. As a result, SetConfigurationOnProcessLockUpdate() is skipped for the new renderer process.

                Wangsong Jin

                That might explain why other renderer settings in NotifyRendererOfLockedStateUpdate() aren’t applied just once. Do you have any additional thoughts? Otherwise, I'll revert the change.

                Open in Gerrit

                Related details

                Attention is currently required from:
                • Alex Moshchuk
                • Daniel Cheng
                • Liang Zhao
                Submit Requirements:
                • requirement satisfiedCode-Coverage
                • requirement is not satisfiedCode-Review
                • requirement is not satisfiedNo-Unresolved-Comments
                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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                Gerrit-Change-Number: 6373046
                Gerrit-PatchSet: 51
                Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
                Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
                Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
                Gerrit-CC: Charlie Reis <cr...@chromium.org>
                Gerrit-CC: Liang Zhao <lz...@microsoft.com>
                Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
                Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                Gerrit-Comment-Date: Tue, 03 Jun 2025 16:43:33 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: No
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Wangsong Jin (Gerrit)

                unread,
                Jun 3, 2025, 3:50:22 PM6/3/25
                to AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                File chrome/renderer/chrome_render_thread_observer.cc
                Wangsong Jin

                Updated the code to bypass process spawn after crashing case by checking if host->GetLastInitTime() has changed. Does that approach looks good for you?
                Other options:
                1. We could track the render process creation and deletion directly, though that might be a bit complex.
                2. Do not care the second call.
                3. Find a way to skip the second call for "Instant process set with process_state and no spare renderer available".

                Let me know which option you prefer—or if you have another idea in mind. Thanks!

                Open in Gerrit

                Related details

                Attention is currently required from:
                • Alex Moshchuk
                • Daniel Cheng
                • Liang Zhao
                Submit Requirements:
                • requirement satisfiedCode-Coverage
                • requirement is not satisfiedCode-Review
                • requirement is not satisfiedNo-Unresolved-Comments
                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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                Gerrit-Change-Number: 6373046
                Gerrit-PatchSet: 52
                Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
                Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
                Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
                Gerrit-CC: Charlie Reis <cr...@chromium.org>
                Gerrit-CC: Liang Zhao <lz...@microsoft.com>
                Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
                Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                Gerrit-Comment-Date: Tue, 03 Jun 2025 19:50:13 +0000
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Wangsong Jin (Gerrit)

                unread,
                Jun 4, 2025, 2:13:23 PM6/4/25
                to Paul Adedeji, Reilly Grant, David Trainor, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                Attention needed from Adam Rice, Alex Moshchuk, Daniel Cheng, David Trainor, Frank Liberato, Liang Zhao, Paul Adedeji and Reilly Grant

                Wangsong Jin added 1 comment

                Patchset-level comments
                File-level comment, Patchset 52 (Latest):
                Wangsong Jin . resolved

                Missing required owners added.

                Hi all, please take a look when you get a chance, thanks a lot!

                Open in Gerrit

                Related details

                Attention is currently required from:
                • Adam Rice
                • Alex Moshchuk
                • Daniel Cheng
                • David Trainor
                • Frank Liberato
                • Liang Zhao
                • Paul Adedeji
                • Reilly Grant
                Submit Requirements:
                • requirement satisfiedCode-Coverage
                • requirement is not satisfiedCode-Review
                • requirement is not satisfiedNo-Unresolved-Comments
                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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                Gerrit-Change-Number: 6373046
                Gerrit-PatchSet: 52
                Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
                Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
                Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
                Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
                Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
                Gerrit-Reviewer: Paul Adedeji <paula...@google.com>
                Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
                Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
                Gerrit-CC: Charlie Reis <cr...@chromium.org>
                Gerrit-CC: Liang Zhao <lz...@microsoft.com>
                Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                Gerrit-Attention: Reilly Grant <rei...@chromium.org>
                Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
                Gerrit-Attention: Paul Adedeji <paula...@google.com>
                Gerrit-Attention: David Trainor <dtra...@chromium.org>
                Gerrit-Attention: Frank Liberato <libe...@chromium.org>
                Gerrit-Attention: Adam Rice <ri...@chromium.org>
                Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                Gerrit-Comment-Date: Wed, 04 Jun 2025 18:13:17 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: No
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Reilly Grant (Gerrit)

                unread,
                Jun 4, 2025, 4:07:45 PM6/4/25
                to Wangsong Jin, Reilly Grant, Paul Adedeji, David Trainor, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                Attention needed from Adam Rice, Alex Moshchuk, Daniel Cheng, David Trainor, Frank Liberato, Liang Zhao, Paul Adedeji and Wangsong Jin

                Reilly Grant voted and added 1 comment

                Votes added by Reilly Grant

                Code-Review+1

                1 comment

                Patchset-level comments
                Reilly Grant . resolved

                //chrome/renderer/extensions LGTM

                Open in Gerrit

                Related details

                Attention is currently required from:
                • Adam Rice
                • Alex Moshchuk
                • Daniel Cheng
                • David Trainor
                • Frank Liberato
                • Liang Zhao
                • Paul Adedeji
                • Wangsong Jin
                Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
                Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
                Gerrit-Attention: Paul Adedeji <paula...@google.com>
                Gerrit-Attention: David Trainor <dtra...@chromium.org>
                Gerrit-Attention: Frank Liberato <libe...@chromium.org>
                Gerrit-Attention: Adam Rice <ri...@chromium.org>
                Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                Gerrit-Comment-Date: Wed, 04 Jun 2025 20:07:34 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: Yes
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Alex Moshchuk (Gerrit)

                unread,
                Jun 4, 2025, 7:16:06 PM6/4/25
                to Wangsong Jin, Tibor Goldschwendt, Reilly Grant, David Trainor, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                Attention needed from Adam Rice, Daniel Cheng, David Trainor, Frank Liberato, Liang Zhao, Tibor Goldschwendt and Wangsong Jin

                Alex Moshchuk added 8 comments

                Patchset-level comments
                Alex Moshchuk . resolved

                Thanks, caught up on the latest changes - the mojo plumbing looks much better to me. A couple of questions below on the outstanding threads.

                File chrome/browser/chrome_content_browser_client.cc
                Line 1906, Patchset 48: // If the input |url| should be assigned to the Instant renderer.
                Alex Moshchuk . unresolved

                site_url?

                File chrome/browser/ui/search/third_party_ntp_browsertest.cc
                Line 121, Patchset 52 (Latest): EXPECT_EQ("null", content::EvalJs(subframe, "window.origin"));
                Alex Moshchuk . unresolved

                The origin is opaque presumably because there's an error page loaded in `subframe`? Can we check that window.location or the last committed URL is kUnreachableWebDataURL, just in case we ever change chrome-search: to use opaque origins too?

                File chrome/renderer/chrome_content_renderer_client.cc
                Line 1743, Patchset 29: WebSecurityPolicy::RegisterURLSchemeAsDisplayIsolated(chrome_search_scheme);
                Daniel Cheng . unresolved

                Is there any reason we can't just unconditionally do this always? I thought there was already an extension point in ContentClient or ContentBrowserClient for configuring schemes, and it doesn't seem like it'd hurt to do this in all renderers.

                Alex Moshchuk

                Hmm, if I try to do something like window.location="chrome-search://most-visited/title.html?rid=4&fs=0", Chrome disallows that in normal web pages with a "Not allowed to load local resource" error. Doing this in the instant process (i.e., from the remote NTP) works, though. Would the -1 process_id fix mean that we regress this behavior and allow web pages to potentially navigate to instant processes in main frames? I'm not sure that's desirable.

                File chrome/renderer/chrome_render_thread_observer.cc
                Alex Moshchuk

                Hmm, it's surprising to me that NotifyRendererOfLockedStateUpdate() would be called twice in the case you described, as the lock shouldn't really change once it's set. The original intention of calling it from OnProcessLaunched() was to ensure that it's done after crash recovery - see https://chromium-review.googlesource.com/c/chromium/src/+/1083494. If it's called twice with the same info, it might be a bug that we might want to fix separately at the content layer.

                For the "Instant process set with process_state and no spare renderer available" case - Is the NotifyRendererOfLockedStateUpdate() happening twice for normal non-NTP URLs that don't use the spare too? Are both of those NotifyRendererOfLockedStateUpdate() calls done with the same non-empty chrome-search:// site_url, or is one of them with an empty site_url? Asking because I expect the only case where we might lock a process twice to be when the first lock is an "allow_any_site" lock (basically meaning the process is not really locked) that's created for about:blank (for example), which can later be upgraded to a site-specific lock (see [this](https://source.chromium.org/chromium/chromium/src/+/main:content/browser/child_process_security_policy_impl.cc;l=658-662;drc=8e9c2dff53856916bbbc066f04b7ab0495d57a2f) and [this](https://source.chromium.org/chromium/chromium/src/+/main:content/browser/process_lock.h;l=29-38;drc=8e9c2dff53856916bbbc066f04b7ab0495d57a2f)). NotifyRendererOfLockedStateUpdate() is also [skipped](https://source.chromium.org/chromium/chromium/src/+/main:content/browser/renderer_host/render_process_host_impl.cc;l=3269;drc=8e9c2dff53856916bbbc066f04b7ab0495d57a2f) for invalid/unset process locks, which should be the case for spare processes.

                File content/browser/webui/web_ui_url_loader_factory.cc
                Line 141, Patchset 52 (Latest): // The render process id here only used in
                Alex Moshchuk . unresolved

                nit: \`render_process_id\`

                Line 141, Patchset 52 (Latest): // The render process id here only used in
                Alex Moshchuk . unresolved

                nit: "is only"

                Line 230, Patchset 52 (Latest): // InstantService::ShouldServiceRequest() to block any child frame in
                // a non-instant process from loading chrome-search URLs.
                Alex Moshchuk . unresolved

                Not for this CL, but we've got https://crbug.com/40447789 filed to eventually make chrome-search tiles into OOPIFs. (Today, we keep them in process with a pretty ugly site isolation workaround.) I'm curious if that existing code would get in the way of that?

                Open in Gerrit

                Related details

                Attention is currently required from:
                • Adam Rice
                • Daniel Cheng
                • David Trainor
                • Frank Liberato
                • Liang Zhao
                • Tibor Goldschwendt
                • Wangsong Jin
                Submit Requirements:
                • requirement satisfiedCode-Coverage
                • requirement is not satisfiedCode-Review
                • requirement is not satisfiedNo-Unresolved-Comments
                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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                Gerrit-Change-Number: 6373046
                Gerrit-PatchSet: 52
                Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
                Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
                Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
                Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
                Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
                Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
                Gerrit-Reviewer: Tibor Goldschwendt <tib...@chromium.org>
                Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
                Gerrit-CC: Charlie Reis <cr...@chromium.org>
                Gerrit-CC: Liang Zhao <lz...@microsoft.com>
                Gerrit-Attention: Tibor Goldschwendt <tib...@chromium.org>
                Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
                Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
                Gerrit-Attention: David Trainor <dtra...@chromium.org>
                Gerrit-Attention: Frank Liberato <libe...@chromium.org>
                Gerrit-Attention: Adam Rice <ri...@chromium.org>
                Gerrit-Comment-Date: Wed, 04 Jun 2025 23:15:51 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: No
                Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
                Comment-In-Reply-To: Wangsong Jin <wangs...@microsoft.com>
                Comment-In-Reply-To: Liang Zhao <lz...@microsoft.com>
                Comment-In-Reply-To: Alex Moshchuk <ale...@chromium.org>
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Frank Liberato (Gerrit)

                unread,
                Jun 4, 2025, 9:19:24 PM6/4/25
                to Wangsong Jin, Tibor Goldschwendt, Reilly Grant, David Trainor, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                Attention needed from Adam Rice, Daniel Cheng, David Trainor, Liang Zhao, Tibor Goldschwendt and Wangsong Jin

                Frank Liberato voted and added 1 comment

                Votes added by Frank Liberato

                Code-Review+1

                1 comment

                Patchset-level comments
                Frank Liberato . resolved

                media/ RS lgtm.

                -fl

                Open in Gerrit

                Related details

                Attention is currently required from:
                • Adam Rice
                • Daniel Cheng
                • David Trainor
                • Liang Zhao
                • Tibor Goldschwendt
                • Wangsong Jin
                  Submit Requirements:
                  • requirement satisfiedCode-Coverage
                  • requirement satisfiedCode-Review
                  Gerrit-Attention: Adam Rice <ri...@chromium.org>
                  Gerrit-Comment-Date: Thu, 05 Jun 2025 01:19:13 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: Yes
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Tibor Goldschwendt (Gerrit)

                  unread,
                  Jun 6, 2025, 12:40:28 PM6/6/25
                  to Wangsong Jin, Cliff Smolinsky, Reilly Grant, David Trainor, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Adam Rice, Daniel Cheng, David Trainor, Liang Zhao and Wangsong Jin

                  Tibor Goldschwendt added 2 comments

                  File chrome/browser/ui/search/third_party_ntp_browsertest.cc
                  Line 121, Patchset 52 (Latest): EXPECT_EQ("null", content::EvalJs(subframe, "window.origin"));
                  Alex Moshchuk . unresolved

                  The origin is opaque presumably because there's an error page loaded in `subframe`? Can we check that window.location or the last committed URL is kUnreachableWebDataURL, just in case we ever change chrome-search: to use opaque origins too?

                  Tibor Goldschwendt

                  +1

                  File chrome/browser/ui/webui/ntp/new_tab_ui_browsertest.cc
                  Tibor Goldschwendt . unresolved

                  I don't think the spare renderer variant is necessary. The NTPs tested here are never instant NTPs.

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Adam Rice
                  • Daniel Cheng
                  • David Trainor
                  • Liang Zhao
                  • Wangsong Jin
                  Gerrit-CC: Cliff Smolinsky <clif...@microsoft.com>
                  Gerrit-CC: Liang Zhao <lz...@microsoft.com>
                  Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
                  Gerrit-Attention: David Trainor <dtra...@chromium.org>
                  Gerrit-Attention: Adam Rice <ri...@chromium.org>
                  Gerrit-Comment-Date: Fri, 06 Jun 2025 16:40:18 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  Comment-In-Reply-To: Alex Moshchuk <ale...@chromium.org>
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  David Trainor (Gerrit)

                  unread,
                  Jun 6, 2025, 1:50:45 PM6/6/25
                  to Wangsong Jin, Cliff Smolinsky, Tibor Goldschwendt, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Adam Rice, Daniel Cheng, Liang Zhao and Wangsong Jin

                  David Trainor added 2 comments

                  File chrome/browser/chrome_content_browser_client.cc
                  Line 1906, Patchset 48: // If the input |url| should be assigned to the Instant renderer.
                  Alex Moshchuk . unresolved

                  site_url?

                  David Trainor

                  The comment seems redundant with the method call below - can we elaborate more or remove it?

                  Line 1939, Patchset 52 (Latest): // receive the renderer settings even RenderProcessHost is reused.
                  David Trainor . unresolved

                  even -> even if?

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Adam Rice
                  • Daniel Cheng
                  • Liang Zhao
                  • Wangsong Jin
                  Gerrit-Attention: Adam Rice <ri...@chromium.org>
                  Gerrit-Comment-Date: Fri, 06 Jun 2025 17:50:34 +0000
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Wangsong Jin (Gerrit)

                  unread,
                  Jun 6, 2025, 9:49:58 PM6/6/25
                  to Cliff Smolinsky, Tibor Goldschwendt, Reilly Grant, David Trainor, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Alex Moshchuk, Daniel Cheng, David Trainor, Liang Zhao and Tibor Goldschwendt

                  Wangsong Jin added 7 comments

                  File chrome/browser/chrome_content_browser_client.cc
                  Line 1906, Patchset 48: // If the input |url| should be assigned to the Instant renderer.
                  Alex Moshchuk . resolved

                  site_url?

                  David Trainor

                  The comment seems redundant with the method call below - can we elaborate more or remove it?

                  Wangsong Jin

                  Done

                  Line 1939, Patchset 52: // receive the renderer settings even RenderProcessHost is reused.
                  David Trainor . resolved

                  even -> even if?

                  Wangsong Jin

                  Done

                  File chrome/browser/ui/search/third_party_ntp_browsertest.cc
                  Line 121, Patchset 52: EXPECT_EQ("null", content::EvalJs(subframe, "window.origin"));
                  Alex Moshchuk . resolved

                  The origin is opaque presumably because there's an error page loaded in `subframe`? Can we check that window.location or the last committed URL is kUnreachableWebDataURL, just in case we ever change chrome-search: to use opaque origins too?

                  Tibor Goldschwendt

                  +1

                  Wangsong Jin
                  Thanks! It doesn't seem to return an error page. Found how other tests do it, I will try this first.
                  ```
                  console_observer.SetPattern("Not allowed to load local resource: " +
                  view_source_url.spec());
                  ```
                  File chrome/renderer/chrome_content_renderer_client.cc
                  Wangsong Jin

                  Hi Alex, thanks for your response! I was mostly out of office on June 5, and it took me some time to re-consider - apologies for the delayed reply.
                  You're right about the behavior change: to avoid blocking browser-initiated navigations (e.g., from the address bar) while still blocking window.location = "chrome-search://xxx", we still need to call RegisterURLSchemeAsDisplayIsolated for renderer. However, that brings us back to the earlier issue—invoking RegisterURLSchemeAsDisplayIsolated() at that point could trigger the DCHECK(WTF::IsBeforeThreadCreated()).

                  BTW, Since registering the URL scheme is quite fragile, I’ve updated the code: if the feature is disabled, we’ll retain the scheme registration at its [original location](https://source.chromium.org/chromium/chromium/src/+/main:chrome/renderer/chrome_content_renderer_client.cc;l=541?q=WebSecurityPolicy::RegisterURLSchemeAsDisplayIsolated&ss=chromium%2Fchromium%2Fsrc:chrome%2F) during process startup, after checking the command-line switch. And in below [thread](https://chromium-review.googlesource.com/c/chromium/src/+/6373046/comment/5ec03902_73a538eb/) We've addressed the duplicate call issue, which is something we also want to avoid when registering the URL scheme.

                  Previously, we tried to either relax the DCHECK or register it first then remove for the instant process. Also tried to move OnRendererProcessLockedStateUpdated() before process_lock.IsValid() check to see if that block some cases, but still, we hit the DCHECK for certain tests. e.g. All/UserScriptTrackerBrowserTest.UserScriptViaUserScriptsApi/1 (run with InstantUsesSpareRenderer enabled) I haven't get chance to get all failed tests. Do you have some ideas?

                  File chrome/renderer/chrome_render_thread_observer.cc
                  Wangsong Jin

                  I got below stack:
                  (Start the browser with empty page and open a new tab, disabled spare render)
                  First, SetProcessLock() is called.
                  ```
                  content.dll!content::RenderProcessHostImpl::NotifyRendererOfLockedStateUpdate() Line 3259 (q:\cr\src\content\browser\renderer_host\render_process_host_impl.cc:3259)
                  content.dll!content::RenderProcessHostImpl::SetProcessLock(const content::IsolationContext & isolation_context, const content::ProcessLock & process_lock) Line 3251 (q:\cr\src\content\browser\renderer_host\render_process_host_impl.cc:3251)
                  content.dll!content::SiteInstanceImpl::LockProcessIfNeeded() Line 1541 (q:\cr\src\content\browser\site_instance_impl.cc:1541)
                  content.dll!content::SiteInstanceImpl::SetProcessInternal(content::RenderProcessHost * process) Line 554 (q:\cr\src\content\browser\site_instance_impl.cc:554)
                  content.dll!content::SiteInstanceImpl::GetOrCreateProcess(const content::ProcessAllocationContext & context) Line 485 (q:\cr\src\content\browser\site_instance_impl.cc:485)
                  content.dll!content::RenderFrameHostManager::CreateRenderFrameHost(content::RenderFrameHostManager::CreateFrameCase create_frame_case, content::SiteInstanceImpl * site_instance, int frame_routing_id, mojo::PendingAssociatedRemote<content::mojom::Frame> frame_remote, const base::TokenType<blink::LocalFrameTokenTypeMarker> & frame_token, const base::TokenType<blink::DocumentTokenTypeMarker> & document_token, base::UnguessableToken devtools_frame_token, bool renderer_initiated_creation, scoped_refptr<content::BrowsingContextState> browsing_context_state, const content::ProcessAllocationContext & process_allocation_context) Line 4105 (q:\cr\src\content\browser\renderer_host\render_frame_host_manager.cc:4105)
                  content.dll!content::RenderFrameHostManager::InitRoot(content::SiteInstanceImpl * site_instance, bool renderer_initiated_creation, blink::FramePolicy initial_main_frame_policy, const std::__Cr::basic_string<char,std::__Cr::char_traits<char>,std::__Cr::allocator<char>> & name, const base::UnguessableToken & devtools_frame_token) Line 705 (q:\cr\src\content\browser\renderer_host\render_frame_host_manager.cc:705)
                  content.dll!content::FrameTree::Init(content::SiteInstanceImpl * main_frame_site_instance, bool renderer_initiated_creation, const std::__Cr::basic_string<char,std::__Cr::char_traits<char>,std::__Cr::allocator<char>> & main_frame_name, content::RenderFrameHostImpl * opener_for_origin, const blink::FramePolicy & frame_policy, const base::UnguessableToken & devtools_frame_token) Line 950 (q:\cr\src\content\browser\renderer_host\frame_tree.cc:950)
                  content.dll!content::WebContentsImpl::Init(const content::WebContents::CreateParams & params, blink::FramePolicy primary_main_frame_policy) Line 4099 (q:\cr\src\content\browser\web_contents\web_contents_impl.cc:4099)
                  content.dll!content::WebContentsImpl::CreateWithOpener(const content::WebContents::CreateParams & params, content::RenderFrameHostImpl * opener_rfh) Line 1672 (q:\cr\src\content\browser\web_contents\web_contents_impl.cc:1672)
                  content.dll!content::WebContentsImpl::Create(const content::WebContents::CreateParams & params) Line 779 (q:\cr\src\content\browser\web_contents\web_contents_impl.cc:779)
                  content.dll!content::WebContents::Create(const content::WebContents::CreateParams & params) Line 774 (q:\cr\src\content\browser\web_contents\web_contents_impl.cc:774)
                  chrome.dll!`anonymous namespace'::CreateTargetContents(const NavigateParams & params, const GURL & url) Line 547 (q:\cr\src\chrome\browser\ui\browser_navigator.cc:547)
                  chrome.dll!Navigate(NavigateParams * params) Line 859 (q:\cr\src\chrome\browser\ui\browser_navigator.cc:859)
                  chrome.dll!chrome::AddAndReturnTabAt(Browser * browser, const GURL & url, int idx, bool foreground, std::__Cr::optional<tab_groups::TabGroupId> group) Line 44 (q:\cr\src\chrome\browser\ui\browser_tabstrip.cc:44)
                  chrome.dll!chrome::AddTabAt(Browser * browser, const GURL & url, int idx, bool foreground, std::__Cr::optional<tab_groups::TabGroupId> group) Line 62 (q:\cr\src\chrome\browser\ui\browser_tabstrip.cc:62)
                  chrome.dll!chrome::BrowserTabStripModelDelegate::AddTabAt(const GURL & url, int index, bool foreground, std::__Cr::optional<tab_groups::TabGroupId> group) Line 76 (q:\cr\src\chrome\browser\ui\browser_tab_strip_model_delegate.cc:76)
                  chrome.dll!BrowserTabStripController::CreateNewTab() Line 624
                  ```

                  Then RenderProcessHostImpl::OnProcessLaunched()
                  ```
                  content.dll!content::RenderProcessHostImpl::NotifyRendererOfLockedStateUpdate() Line 3259 (q:\cr\src\content\browser\renderer_host\render_process_host_impl.cc:3259)
                  content.dll!content::RenderProcessHostImpl::OnProcessLaunched() Line 5601 (q:\cr\src\content\browser\renderer_host\render_process_host_impl.cc:5601)
                  content.dll!content::ChildProcessLauncher::Notify(content::internal::ChildProcessLauncherHelper::Process process, unsigned long last_error, int error_code) Line 202 (q:\cr\src\content\browser\child_process_launcher.cc:202)
                  content.dll!content::internal::ChildProcessLauncherHelper::PostLaunchOnClientThread(content::internal::ChildProcessLauncherHelper::Process process, unsigned long last_error, int error_code) Line 497 (q:\cr\src\content\browser\child_process_launcher_helper.cc:497)
                  content.dll!base::internal::DecayedFunctorTraits<void (ChildProcessLauncherHelper::*)(content::internal::ChildProcessLauncherHelper::Process, unsigned long, int),content::internal::ChildProcessLauncherHelper *&&,content::internal::ChildProcessLauncherHelper::Process &&,unsigned long &&,int &&>::Invoke<void (ChildProcessLauncherHelper::*)(content::internal::ChildProcessLauncherHelper::Process, unsigned long, int),scoped_refptr<content::internal::ChildProcessLauncherHelper>,content::internal::ChildProcessLauncherHelper::Process,unsigned long,int>(void(content::internal::ChildProcessLauncherHelper::*)(content::internal::ChildProcessLauncherHelper::Process, unsigned long, int) method, scoped_refptr<content::internal::ChildProcessLauncherHelper> && receiver_ptr, content::internal::ChildProcessLauncherHelper::Process && args, unsigned long && args, int && args) Line 731 (q:\cr\src\base\functional\bind_internal.h:731)
                  content.dll!base::internal::InvokeHelper<0,base::internal::FunctorTraits<void (ChildProcessLauncherHelper::*&&)(content::internal::ChildProcessLauncherHelper::Process, unsigned long, int),content::internal::ChildProcessLauncherHelper *&&,content::internal::ChildProcessLauncherHelper::Process &&,unsigned long &&,int &&>,void,0,1,2,3>::MakeItSo<void (ChildProcessLauncherHelper::*)(content::internal::ChildProcessLauncherHelper::Process, unsigned long, int),std::__Cr::tuple<scoped_refptr<content::internal::ChildProcessLauncherHelper>,content::internal::ChildProcessLauncherHelper::Process,unsigned long,int>>(void(content::internal::ChildProcessLauncherHelper::*)(content::internal::ChildProcessLauncherHelper::Process, unsigned long, int) && functor, std::__Cr::tuple<scoped_refptr<content::internal::ChildProcessLauncherHelper>,content::internal::ChildProcessLauncherHelper::Process,unsigned long,int> && bound) Line 923 (q:\cr\src\base\functional\bind_internal.h:923)
                  content.dll!base::internal::Invoker<base::internal::FunctorTraits<void (ChildProcessLauncherHelper::*&&)(content::internal::ChildProcessLauncherHelper::Process, unsigned long, int),content::internal::ChildProcessLauncherHelper *&&,content::internal::ChildProcessLauncherHelper::Process &&,unsigned long &&,int &&>,base::internal::BindState<1,1,0,void (ChildProcessLauncherHelper::*)(content::internal::ChildProcessLauncherHelper::Process, unsigned long, int),scoped_refptr<content::internal::ChildProcessLauncherHelper>,content::internal::ChildProcessLauncherHelper::Process,unsigned long,int>,void ()>::RunImpl<void (ChildProcessLauncherHelper::*)(content::internal::ChildProcessLauncherHelper::Process, unsigned long, int),std::__Cr::tuple<scoped_refptr<content::internal::ChildProcessLauncherHelper>,content::internal::ChildProcessLauncherHelper::Process,unsigned long,int>,0,1,2,3>(void(content::internal::ChildProcessLauncherHelper::*)(content::internal::ChildProcessLauncherHelper::Process, unsigned long, int) && functor, std::__Cr::tuple<scoped_refptr<content::internal::ChildProcessLauncherHelper>,content::internal::ChildProcessLauncherHelper::Process,unsigned long,int> && bound, std::__Cr::integer_sequence<unsigned long long,0,1,2,3>) Line 1060 (q:\cr\src\base\functional\bind_internal.h:1060)
                  content.dll!base::internal::Invoker<base::internal::FunctorTraits<void (ChildProcessLauncherHelper::*&&)(content::internal::ChildProcessLauncherHelper::Process, unsigned long, int),content::internal::ChildProcessLauncherHelper *&&,content::internal::ChildProcessLauncherHelper::Process &&,unsigned long &&,int &&>,base::internal::BindState<1,1,0,void (ChildProcessLauncherHelper::*)(content::internal::ChildProcessLauncherHelper::Process, unsigned long, int),scoped_refptr<content::internal::ChildProcessLauncherHelper>,content::internal::ChildProcessLauncherHelper::Process,unsigned long,int>,void ()>::RunOnce(base::internal::BindStateBase * base) Line 973
                  ```
                  That's also what I observe when navigating a tab to a different site.
                  And I don't see they get [skipped](https://source.chromium.org/chromium/chromium/src/+/main:content/browser/renderer_host/render_process_host_impl.cc;l=3269;drc=8e9c2dff53856916bbbc066f04b7ab0495d57a2f) And to avoid the second call, we added new flag `renderer_locked_state_updated_` in render_process_host_impl.cc. And reset it on RenderProcessHostImpl::ProcessDied() to cover process spawn after crashing case. We keep CHECK() in render to ensure there's no second call.

                  File content/browser/webui/web_ui_url_loader_factory.cc
                  Line 141, Patchset 52: // The render process id here only used in
                  Alex Moshchuk . resolved

                  nit: \`render_process_id\`

                  Wangsong Jin

                  Done

                  Line 141, Patchset 52: // The render process id here only used in
                  Alex Moshchuk . resolved

                  nit: "is only"

                  Wangsong Jin

                  Done

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Alex Moshchuk
                  • Daniel Cheng
                  • David Trainor
                  • Liang Zhao
                  • Tibor Goldschwendt
                  Submit Requirements:
                  • requirement satisfiedCode-Coverage
                  • requirement is not satisfiedCode-Review
                  • requirement is not satisfiedNo-Unresolved-Comments
                  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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                  Gerrit-Change-Number: 6373046
                  Gerrit-PatchSet: 53
                  Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
                  Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
                  Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
                  Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
                  Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
                  Gerrit-Reviewer: Tibor Goldschwendt <tib...@chromium.org>
                  Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-CC: Charlie Reis <cr...@chromium.org>
                  Gerrit-CC: Cliff Smolinsky <clif...@microsoft.com>
                  Gerrit-CC: Liang Zhao <lz...@microsoft.com>
                  Gerrit-Attention: Tibor Goldschwendt <tib...@chromium.org>
                  Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
                  Gerrit-Attention: David Trainor <dtra...@chromium.org>
                  Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                  Gerrit-Comment-Date: Sat, 07 Jun 2025 01:49:47 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  Comment-In-Reply-To: Tibor Goldschwendt <tib...@chromium.org>
                  Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
                  Comment-In-Reply-To: Wangsong Jin <wangs...@microsoft.com>
                  Comment-In-Reply-To: Liang Zhao <lz...@microsoft.com>
                  Comment-In-Reply-To: David Trainor <dtra...@chromium.org>
                  Comment-In-Reply-To: Alex Moshchuk <ale...@chromium.org>
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Liang Zhao (Gerrit)

                  unread,
                  Jun 9, 2025, 4:55:31 PM6/9/25
                  to Wangsong Jin, Cliff Smolinsky, Tibor Goldschwendt, Reilly Grant, David Trainor, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Alex Moshchuk, Daniel Cheng, David Trainor and Wangsong Jin

                  Liang Zhao added 3 comments

                  File chrome/browser/chrome_content_browser_client.cc
                  Line 798, Patchset 53 (Latest):class StaticParamsUserData : public base::SupportsUserData::Data {
                  Liang Zhao . unresolved

                  We probably don't need this any more.

                  File chrome/browser/ui/webui/ntp/new_tab_ui_browsertest.cc
                  Tibor Goldschwendt . unresolved

                  I don't think the spare renderer variant is necessary. The NTPs tested here are never instant NTPs.

                  Liang Zhao

                  We should revert changes in this file.

                  File content/browser/webui/web_ui_url_loader_factory.cc
                  Line 230, Patchset 52: // InstantService::ShouldServiceRequest() to block any child frame in

                  // a non-instant process from loading chrome-search URLs.
                  Alex Moshchuk . unresolved

                  Not for this CL, but we've got https://crbug.com/40447789 filed to eventually make chrome-search tiles into OOPIFs. (Today, we keep them in process with a pretty ugly site isolation workaround.) I'm curious if that existing code would get in the way of that?

                  Liang Zhao

                  I think that the current URLLoaderFactory restriction is tied to requests from instant process. If we are going to move chrome-search tiles out of instant process, we could update the code to use renderer process id of the main frame if we want to keep ShouldServiceRequest concept to ensure that we only serves iframes related to instant process. Or we could just remove the ShouldServiceRequest related code to not have instant process concept in URLLoaderFactory, which makes it even more important to have the renderer process restriction on the scheme.

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Alex Moshchuk
                  • Daniel Cheng
                  • David Trainor
                  • Wangsong Jin
                  Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-Attention: David Trainor <dtra...@chromium.org>
                  Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                  Gerrit-Comment-Date: Mon, 09 Jun 2025 20:55:20 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  Comment-In-Reply-To: Tibor Goldschwendt <tib...@chromium.org>
                  Comment-In-Reply-To: Alex Moshchuk <ale...@chromium.org>
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Wangsong Jin (Gerrit)

                  unread,
                  Jun 9, 2025, 6:06:32 PM6/9/25
                  to Cliff Smolinsky, Tibor Goldschwendt, Reilly Grant, David Trainor, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Alex Moshchuk, Daniel Cheng, David Trainor, Liang Zhao and Tibor Goldschwendt

                  Wangsong Jin added 3 comments

                  File chrome/browser/chrome_content_browser_client.cc
                  Line 798, Patchset 53:class StaticParamsUserData : public base::SupportsUserData::Data {
                  Liang Zhao . resolved

                  We probably don't need this any more.

                  Wangsong Jin

                  Done

                  File chrome/browser/ui/search/third_party_ntp_browsertest.cc
                  Line 121, Patchset 52: EXPECT_EQ("null", content::EvalJs(subframe, "window.origin"));
                  Alex Moshchuk . unresolved

                  The origin is opaque presumably because there's an error page loaded in `subframe`? Can we check that window.location or the last committed URL is kUnreachableWebDataURL, just in case we ever change chrome-search: to use opaque origins too?

                  Tibor Goldschwendt

                  +1

                  Wangsong Jin
                  Thanks! It doesn't seem to return an error page. Found how other tests do it, I will try this first.
                  ```
                  console_observer.SetPattern("Not allowed to load local resource: " +
                  view_source_url.spec());
                  ```
                  Wangsong Jin

                  Fixed.

                  File chrome/browser/ui/webui/ntp/new_tab_ui_browsertest.cc
                  File-level comment, Patchset 52:
                  Tibor Goldschwendt . resolved

                  I don't think the spare renderer variant is necessary. The NTPs tested here are never instant NTPs.

                  Liang Zhao

                  We should revert changes in this file.

                  Wangsong Jin

                  Done

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Alex Moshchuk
                  • Daniel Cheng
                  • David Trainor
                  • Liang Zhao
                  • Tibor Goldschwendt
                  Submit Requirements:
                  • requirement satisfiedCode-Coverage
                  • requirement is not satisfiedCode-Review
                  • requirement is not satisfiedNo-Unresolved-Comments
                  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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                  Gerrit-Change-Number: 6373046
                  Gerrit-PatchSet: 54
                  Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
                  Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
                  Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Reviewer: David Trainor <dtra...@chromium.org>
                  Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
                  Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
                  Gerrit-Reviewer: Tibor Goldschwendt <tib...@chromium.org>
                  Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-CC: Charlie Reis <cr...@chromium.org>
                  Gerrit-CC: Cliff Smolinsky <clif...@microsoft.com>
                  Gerrit-CC: Liang Zhao <lz...@microsoft.com>
                  Gerrit-Attention: Tibor Goldschwendt <tib...@chromium.org>
                  Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
                  Gerrit-Attention: David Trainor <dtra...@chromium.org>
                  Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                  Gerrit-Comment-Date: Mon, 09 Jun 2025 22:06:21 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  Comment-In-Reply-To: Tibor Goldschwendt <tib...@chromium.org>
                  Comment-In-Reply-To: Liang Zhao <lz...@microsoft.com>
                  Comment-In-Reply-To: Wangsong Jin <wangs...@microsoft.com>
                  Comment-In-Reply-To: Alex Moshchuk <ale...@chromium.org>
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  David Trainor (Gerrit)

                  unread,
                  Jun 9, 2025, 7:16:11 PM6/9/25
                  to Wangsong Jin, Cliff Smolinsky, Tibor Goldschwendt, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Alex Moshchuk, Daniel Cheng, Liang Zhao, Tibor Goldschwendt and Wangsong Jin

                  David Trainor added 1 comment

                  Patchset-level comments
                  File-level comment, Patchset 55 (Latest):
                  David Trainor . resolved

                  Deferring to most of the other folks on this CL as the right people to be reviewing this. If you need me to review or stamp specific files after everyone aligns let me know. Moving myself to CC now, but please feel free to add me back if/when it's necessary. Thanks!

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Alex Moshchuk
                  • Daniel Cheng
                  • Liang Zhao
                  • Tibor Goldschwendt
                  • Wangsong Jin
                  Submit Requirements:
                  • requirement satisfiedCode-Coverage
                  • requirement is not satisfiedCode-Review
                  • requirement is not satisfiedNo-Unresolved-Comments
                  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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                  Gerrit-Change-Number: 6373046
                  Gerrit-PatchSet: 55
                  Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
                  Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
                  Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
                  Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
                  Gerrit-Reviewer: Tibor Goldschwendt <tib...@chromium.org>
                  Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-CC: Charlie Reis <cr...@chromium.org>
                  Gerrit-CC: Cliff Smolinsky <clif...@microsoft.com>
                  Gerrit-CC: David Trainor <dtra...@chromium.org>
                  Gerrit-CC: Liang Zhao <lz...@microsoft.com>
                  Gerrit-Attention: Tibor Goldschwendt <tib...@chromium.org>
                  Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
                  Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                  Gerrit-Comment-Date: Mon, 09 Jun 2025 23:15:59 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Tibor Goldschwendt (Gerrit)

                  unread,
                  Jun 9, 2025, 7:57:44 PM6/9/25
                  to Wangsong Jin, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Alex Moshchuk, Daniel Cheng, Liang Zhao and Wangsong Jin

                  Tibor Goldschwendt voted and added 1 comment

                  Votes added by Tibor Goldschwendt

                  Code-Review+1

                  1 comment

                  Patchset-level comments
                  Tibor Goldschwendt . resolved

                  //chrome/browser/ui/search/third_party_ntp_browsertest.cc LGTM

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Alex Moshchuk
                  • Daniel Cheng
                  • Liang Zhao
                  • Wangsong Jin
                  Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
                  Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                  Gerrit-Comment-Date: Mon, 09 Jun 2025 23:57:35 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: Yes
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Wangsong Jin (Gerrit)

                  unread,
                  Jun 12, 2025, 5:08:39 PM6/12/25
                  to Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Alex Moshchuk, Daniel Cheng and Liang Zhao

                  Wangsong Jin added 3 comments

                  File chrome/browser/ui/search/third_party_ntp_browsertest.cc
                  Line 121, Patchset 52: EXPECT_EQ("null", content::EvalJs(subframe, "window.origin"));
                  Alex Moshchuk . resolved

                  The origin is opaque presumably because there's an error page loaded in `subframe`? Can we check that window.location or the last committed URL is kUnreachableWebDataURL, just in case we ever change chrome-search: to use opaque origins too?

                  Tibor Goldschwendt

                  +1

                  Wangsong Jin
                  Thanks! It doesn't seem to return an error page. Found how other tests do it, I will try this first.
                  ```
                  console_observer.SetPattern("Not allowed to load local resource: " +
                  view_source_url.spec());
                  ```
                  Wangsong Jin

                  Fixed.

                  Wangsong Jin

                  Done

                  File chrome/renderer/chrome_content_renderer_client.cc
                  Wangsong Jin

                  Hi @alexmos@ and @dcheng, we need some inputs to move forward. Here're options we have:
                  1. Remove scheme registration and check ShouldServiceRequest for main and sub frames with the renderer process ID.
                  2. Register the scheme by default and remove it when we determine it is an instant process.

                  For option 1, currently, renderer initiated navigation to chrome-search urls (most visited, local and remote ntp urls) are blocked in renderer process for main frame or sub frame. When we remove the scheme registration, renderer initiated navigations will be allowed for those navigations. If it is an iframe navigation from normal web site, the navigation will fail due to urlloader restriction. However, if it is a main frame navigation, once the navigation is allowed, the frame will be assigned to instant process and the navigation will succeed. So, this will be a behavior change. Is this regression acceptable?

                  If not, we will need to keep RegisterURLSchemeAsDisplayIsolated(). We've tried different places to change where to register the scheme, but each attempt resulted in hitting DCHECK(WTF::IsBeforeThreadCreated()) in various tests. Our latest attempt was in ChromeContentRendererClient::WebViewCreated on patchset [56-57](https://chromium-review.googlesource.com/c/chromium/src/+/6373046/55..57) but still hit the DCHECK. Couldn't think about any other places. The only feasible one is option 2 to register it first and remove it for the instant process, which won't hit any DCHECK and maintains the renderer restriction without the above behavior change.

                  With above context, are you okay with the option 2?

                  File chrome/renderer/chrome_render_thread_observer.cc
                  Line 229, Patchset 47: // once and do not change.
                  Daniel Cheng . resolved
                  Wangsong Jin

                  Included logs below from a test that navigates from example.com to the instant process URL. Two NotifyRendererOfLockedStateUpdate() called for the same process. There is no involvement of an empty site_url.
                  ```
                  [43716:44840:0605/165434.839:INFO:content\browser\renderer_host\render_process_host_impl.cc:3238] SetProcessLock: { https://example.com/ } GetDeprecatedID: 7, site_url: chrome-search://remote-ntp/, process_lock.is_invalid(): 0, process_lock.allows_any_site(): 0, process_lock.IsASiteOrOrigin(): 1
                  [43716:44840:0605/165434.839:INFO:content\browser\renderer_host\render_process_host_impl.cc:3263] NotifyRendererOfLockedStateUpdate: { https://example.com/ } for process 7, site_url: chrome-search://remote-ntp/, process_lock.is_invalid(): 0, process_lock.allows_any_site(): 0, process_lock.IsASiteOrOrigin(): 1
                  [43716:44840:0605/165434.871:INFO:content\browser\renderer_host\render_process_host_impl.cc:5539] RenderProcessHostImpl::OnProcessLaunched() for 41456 (ID: 7)
                  [43716:44840:0605/165434.872:INFO:content\browser\renderer_host\render_process_host_impl.cc:3263] NotifyRendererOfLockedStateUpdate: { https://example.com/ } for process 7, site_url: chrome-search://remote-ntp/, process_lock.is_invalid(): 0, process_lock.allows_any_site(): 0, process_lock.IsASiteOrOrigin(): 1
                  ```

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Alex Moshchuk
                  • Daniel Cheng
                  • Liang Zhao
                  Submit Requirements:
                  • requirement satisfiedCode-Coverage
                  • requirement is not satisfiedCode-Review
                  • requirement is not satisfiedNo-Unresolved-Comments
                  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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                  Gerrit-Change-Number: 6373046
                  Gerrit-PatchSet: 60
                  Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
                  Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
                  Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
                  Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
                  Gerrit-Reviewer: Tibor Goldschwendt <tib...@chromium.org>
                  Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-CC: Charlie Reis <cr...@chromium.org>
                  Gerrit-CC: Cliff Smolinsky <clif...@microsoft.com>
                  Gerrit-CC: David Trainor <dtra...@chromium.org>
                  Gerrit-CC: Liang Zhao <lz...@microsoft.com>
                  Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
                  Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                  Gerrit-Comment-Date: Thu, 12 Jun 2025 21:08:28 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  Comment-In-Reply-To: Tibor Goldschwendt <tib...@chromium.org>
                  Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
                  Comment-In-Reply-To: Wangsong Jin <wangs...@microsoft.com>
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Alex Moshchuk (Gerrit)

                  unread,
                  Jun 13, 2025, 9:15:58 PM6/13/25
                  to Wangsong Jin, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Daniel Cheng, Liang Zhao and Wangsong Jin

                  Alex Moshchuk added 2 comments

                  File chrome/browser/ui/search/third_party_ntp_browsertest.cc
                  Line 121, Patchset 52: EXPECT_EQ("null", content::EvalJs(subframe, "window.origin"));
                  Alex Moshchuk . resolved

                  The origin is opaque presumably because there's an error page loaded in `subframe`? Can we check that window.location or the last committed URL is kUnreachableWebDataURL, just in case we ever change chrome-search: to use opaque origins too?

                  Tibor Goldschwendt

                  +1

                  Wangsong Jin
                  Thanks! It doesn't seem to return an error page. Found how other tests do it, I will try this first.
                  ```
                  console_observer.SetPattern("Not allowed to load local resource: " +
                  view_source_url.spec());
                  ```
                  Wangsong Jin

                  Fixed.

                  Alex Moshchuk

                  Done

                  File chrome/renderer/chrome_content_renderer_client.cc
                  Alex Moshchuk

                  it is a main frame navigation, once the navigation is allowed, the frame will be assigned to instant process and the navigation will succeed. So, this will be a behavior change. Is this regression acceptable?

                  Sigh, I'm personally not fond of giving web pages a new ability to navigate to chrome-search: URLs, so this would be nice to avoid.

                  I'd defer to dcheng@ on option 2 and whether it's workable, though it did sound like it would be problematic. I do want to mention an additional thing to consider here after we discussed this earlier in the week. The browser process also block attempts to request or commit WebUI pages from non-WebUI processes in ChildProcessSecurityPolicy::CanRequestURL(), [here](https://source.chromium.org/chromium/chromium/src/+/main:content/browser/child_process_security_policy_impl.cc;l=1393-1407;drc=9ba7fc14c994ebb3a083726360612d50ec1de26f). This check is invoked in FilterURL ([here](https://source.chromium.org/chromium/chromium/src/+/main:content/browser/renderer_host/render_process_host_impl.cc;l=4479;drc=9ba7fc14c994ebb3a083726360612d50ec1de26f)) on renderer-initiated navigations, so normally, if a web renderer bypasses the blink checks and attempts a navigation to a WebUI scheme, FilterURL would block it by rewriting the target URL to about:blank#blocked. AFAICT, this should apply to chrome-search: as well (with an exception for most visited tiles [here](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/chrome_content_browser_client.cc;l=2058;drc=9ba7fc14c994ebb3a083726360612d50ec1de26f) - sigh).

                  So, I wonder if another option could be to use (or expand) this mechanism to still block navigations to chrome-search:, if the dynamic display-isolated scheme registration turns out to be impractical per @dch...@chromium.org's earlier comments? We'd probably lose the error messages on the blink side, but maybe we can live with that (or generate additional ones from the browser side)?

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Daniel Cheng
                  • Liang Zhao
                  • Wangsong Jin
                  Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
                  Gerrit-Comment-Date: Sat, 14 Jun 2025 01:15:50 +0000
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Wangsong Jin (Gerrit)

                  unread,
                  Jun 20, 2025, 6:26:35 PM6/20/25
                  to Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Alex Moshchuk, Daniel Cheng and Liang Zhao

                  Wangsong Jin added 1 comment

                  File chrome/renderer/chrome_content_renderer_client.cc
                  Wangsong Jin

                  Thanks for your inputs! Based on the suggestion from our sync meeting on 06/17:

                  We investigate more about the the register scheme hit DCHECK(WTF::IsBeforeThreadCreated()) issue. It seems to be related to the order of mojo calls not guaranteed on non associated interfaces. In this case, service worker thread is created via blink::mojom::EmbeddedWorkerInstanceClient interface after we lock the process and calls SetConfigurationOnProcessLockUpdate() in browser. However, in the renderer process, the service worker thread is created before SetConfigurationOnProcessLockUpdate() is received.

                  We confirmed this by disabling the ServiceWorkerAvoidMainThreadForInitialization feature in PatchSet 69 (InstantUsesSpareRenderer is also overridden to expose the DCHECK issue), and all tests passed.

                  Do you have any suggestions on what we should do? Thank you!

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Alex Moshchuk
                  • Daniel Cheng
                  • Liang Zhao
                  Submit Requirements:
                  • requirement satisfiedCode-Coverage
                  • requirement is not satisfiedCode-Review
                  • requirement is not satisfiedNo-Unresolved-Comments
                  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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                  Gerrit-Change-Number: 6373046
                  Gerrit-PatchSet: 69
                  Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
                  Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
                  Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
                  Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
                  Gerrit-Reviewer: Tibor Goldschwendt <tib...@chromium.org>
                  Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-CC: Charlie Reis <cr...@chromium.org>
                  Gerrit-CC: Cliff Smolinsky <clif...@microsoft.com>
                  Gerrit-CC: David Trainor <dtra...@chromium.org>
                  Gerrit-CC: Liang Zhao <lz...@microsoft.com>
                  Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
                  Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                  Gerrit-Comment-Date: Fri, 20 Jun 2025 22:26:26 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Wangsong Jin (Gerrit)

                  unread,
                  Jun 20, 2025, 6:29:32 PM6/20/25
                  to Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Alex Moshchuk, Daniel Cheng and Liang Zhao

                  Wangsong Jin added 1 comment

                  File content/browser/webui/web_ui_url_loader_factory.cc
                  Line 230, Patchset 52: // InstantService::ShouldServiceRequest() to block any child frame in
                  // a non-instant process from loading chrome-search URLs.
                  Alex Moshchuk . resolved

                  Not for this CL, but we've got https://crbug.com/40447789 filed to eventually make chrome-search tiles into OOPIFs. (Today, we keep them in process with a pretty ugly site isolation workaround.) I'm curious if that existing code would get in the way of that?

                  Liang Zhao

                  I think that the current URLLoaderFactory restriction is tied to requests from instant process. If we are going to move chrome-search tiles out of instant process, we could update the code to use renderer process id of the main frame if we want to keep ShouldServiceRequest concept to ensure that we only serves iframes related to instant process. Or we could just remove the ShouldServiceRequest related code to not have instant process concept in URLLoaderFactory, which makes it even more important to have the renderer process restriction on the scheme.

                  Wangsong Jin

                  Close this since we've isolated the WebUIURLLoaderFactory change in this CL.

                  Gerrit-Comment-Date: Fri, 20 Jun 2025 22:29:21 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Wangsong Jin (Gerrit)

                  unread,
                  Jul 9, 2025, 1:04:13 PM7/9/25
                  to Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org

                  Wangsong Jin added 2 comments

                  File chrome/common/chrome_features.cc
                  Line 1043, Patchset 77 (Latest): base::FEATURE_ENABLED_BY_DEFAULT); // [!!NEED RESET] Temporary override
                  Wangsong Jin . unresolved

                  Placeholder to reset the feature flag back

                  File chrome/renderer/chrome_content_renderer_client.cc
                  Wangsong Jin

                  Copied conversion from slack blink channel:
                  Wangsong:
                  > One option to solve this for instant process might be to also add renderer config to EmbeddedWorkerStartParams and from EmbeddedWorkerInstanceClientImpl::StartWorker() calls up a new method like GetContentClient()->renderer()->OnRenderConfigUpdate(config) to register scheme from if we have not done so before. We could also put this config into CreateViewParams so that we have the same pattern. This kind of goes back to the original approach of adding a browser client method to collect the config and and a renderer client method to apply the config and modify the mojo interfaces to carry the config. More changes to interfaces and complicated, but could work.
                  Another option would be have some "ProcessReady" or "RenderThreadReady" event and let the service worker creation thread wait for that event before it tries to create the worker, and we set that event when renderer config (instant flag) and other security related things are set.

                  Daniel:
                  > I personally lean towards this ("ProcessReady"), but I think we'll need to check with the worker team to see what they think, since I think the entire point of this was to make sure worker creation isn't blocked on the main thread.

                  Shunya:
                  > Thanks for looping me in. Could you help me to understand:
                  Why RegisterURLSchemeAsDisplayIsolated() should be called before the worker thread creation()?
                  Can the first-party NTP (google?) see the instant process flag, and use a spare renderer? Why it is difficult for other third-parties?
                  ServiceWorkerAvoidMainThreadForInitialization is the feature that our team recently shipped, we observed positive impacts on the various SW metrics (SW bootstrap time, FCP/LCP in the SW controlled page etc). It’s a bit difficult for us to just revert this flag. It would be nice to come up with some better options, but at least we’d ask you to monitor if there’s no regressions on the SW metrics.

                  Wangsong:
                  > The service worker thread creation calls NonMainThread::CreateThread -> WTF::WillCreateThread(); There's a DCHECK(WTF::IsBeforeThreadCreated()) avoids calling RegisterURLSchemeAsDisplayIsolated() after that. ⁠There're some tests failed for that.
                  1st party NTP does not use instant-process flag, so there's no issue involved. However, 3rd party currently relies on the instant-process command line switch. To enable the use of a spare renderer, we'll need to replace this switch, send the flag afterward, and call RegisterURLSchemeAsDisplayIsolated() at that point. However, this leads to the DCHECK issue because it's invoked after thread creation.
                  I saw this one https://chromium-review.googlesource.com/c/chromium/src/+/5568543 The general question is should we set the security param first before running the code, Currently, it seems we only need the CORS header for Service Workers, but might be a problem for other security related setup?

                  Daniel:
                  > Currently this (instant process) is set on the command-line, so we can make this decision at process startup. But because it is a command-line flag, we cannot reuse the spare process, because it won't have the right flag.
                  So the approach is to send the 'isolation info' down to the renderer when we lock it to a process.
                  Strictly speaking, it's (RegisterURLSchemeAsDisplayIsolated() should be called before the worker thread creation) not "required". But in general, it's a bit dangerous to mutate the URL scheme registry "too late"; once things have started in the process, the mutation might race with things reading the state. We could just exempt this one particular scheme type from these DCHECK()s, but conceptually it is a bit odd to relax it just for this one thing.

                  Shunya:
                  > This is not CORS header, but the CORS exempt header list. The SW need the CORS exempt header list for the startup, previously it was passed from the renderer main thread, but now it’s passed from the browser process.
                  I’m not sure what your question mean, could you elaborate?
                  ServiceWorkerAvoidMainThreadForInitialization is not just a nice-to-heve performance improvement actually, it was a bug fix for the regression introduced a couple of years ago (crbug.com/40753993 for more details). I believe the current behavior (SW doesn’t wait for the main thread) is the original intended behavior, and obviously it’s not welcomed to regress it again.
                  I want to hear what “ProcessReady” or “RenderThreadReady” exactly mean, too. Does that mean “updated the URL scheme registry and now the renderer main thread is ready”?

                  Liang:
                  > I can try to explain a little. There are security related settings that the browser process wants to set into renderer process before it tries to use it, like whether it is cross origin isolated, in RenderProcessHostImpl::NotifyRendererOfLockedStateUpdate(). The "ProcessReady" would be an event set when these settings have processed in renderer process. We are adding a new settings that would register a scheme as display isolated, which would DCHECK if the process has already started parsing a page or created a worker. In the normal case where a process is created for a site, even if the page is under the control of a service worker, the DCHECK was not triggered, suggesting that adding a wait in service worker creation for the ProcessReady would not impact page navigation perf, probably due to enough time between the time we start navigation and create the renderer process for the site and the time we fetch service worker registration data and starts to create service worker. During the test, the DCHECK was only hit for some extension tests and IWA test.

                  Shunya:
                  > That’s good to know, but both extensions and IWA could affect navigations if service workers intercept requests. So not sure the navigation perf wouldn’t be impacted.
                  That’s said, I feel it’s worth trying making the process ready event and let the service worker bootstrap runs after the event.
                  Please don’t involve the renderer main thread to init the service worker, and monitoring service worker related metrics is much appreciated.
                  >

                  Open in Gerrit

                  Related details

                  Attention set is empty
                  Submit Requirements:
                  • requirement satisfiedCode-Coverage
                  • requirement is not satisfiedCode-Owners
                  • requirement is not satisfiedCode-Review
                  • requirement is not satisfiedNo-Unresolved-Comments
                  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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                  Gerrit-Change-Number: 6373046
                  Gerrit-PatchSet: 77
                  Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
                  Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
                  Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
                  Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
                  Gerrit-Reviewer: Tibor Goldschwendt <tib...@chromium.org>
                  Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-CC: Charlie Reis <cr...@chromium.org>
                  Gerrit-CC: Cliff Smolinsky <clif...@microsoft.com>
                  Gerrit-CC: David Trainor <dtra...@chromium.org>
                  Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
                  Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
                  Gerrit-CC: Liang Zhao <lz...@microsoft.com>
                  Gerrit-CC: Stephen Chenney <sche...@chromium.org>
                  Gerrit-Comment-Date: Wed, 09 Jul 2025 17:04:02 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
                  Comment-In-Reply-To: Wangsong Jin <wangs...@microsoft.com>
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Wangsong Jin (Gerrit)

                  unread,
                  Jul 9, 2025, 1:21:27 PM7/9/25
                  to Shunya Shishido, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Daniel Cheng, Liang Zhao and Shunya Shishido

                  Wangsong Jin added 1 comment

                  File chrome/renderer/chrome_content_renderer_client.cc
                  Wangsong Jin

                  Based on the above discussion, we've updated to wait for the ProcessReady signal before starting the service worker thread. The latest changes are somewhat messy due to some rebase modifications. It's more clear to review the change [PatchSet(69->72)](https://chromium-review.googlesource.com/c/chromium/src/+/6373046/69..72)

                  @dcheng and @sisidovski, could you help to take a look? Thanks!

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Daniel Cheng
                  • Liang Zhao
                  • Shunya Shishido
                  Submit Requirements:
                  • requirement satisfiedCode-Coverage
                  • requirement is not satisfiedCode-Owners
                  • requirement is not satisfiedCode-Review
                  • requirement is not satisfiedNo-Unresolved-Comments
                  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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                  Gerrit-Change-Number: 6373046
                  Gerrit-PatchSet: 77
                  Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
                  Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
                  Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
                  Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
                  Gerrit-Reviewer: Shunya Shishido <sisid...@chromium.org>
                  Gerrit-Reviewer: Tibor Goldschwendt <tib...@chromium.org>
                  Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-CC: Charlie Reis <cr...@chromium.org>
                  Gerrit-CC: Cliff Smolinsky <clif...@microsoft.com>
                  Gerrit-CC: David Trainor <dtra...@chromium.org>
                  Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
                  Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
                  Gerrit-CC: Liang Zhao <lz...@microsoft.com>
                  Gerrit-CC: Stephen Chenney <sche...@chromium.org>
                  Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
                  Gerrit-Attention: Shunya Shishido <sisid...@chromium.org>
                  Gerrit-Comment-Date: Wed, 09 Jul 2025 17:21:17 +0000
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Liang Zhao (Gerrit)

                  unread,
                  Jul 9, 2025, 1:56:20 PM7/9/25
                  to Wangsong Jin, Shunya Shishido, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Daniel Cheng, Shunya Shishido and Wangsong Jin

                  Liang Zhao added 2 comments

                  File chrome/browser/chrome_content_browser_client.cc
                  Line 1892, Patchset 77 (Latest): chrome::mojom::StaticParamsPtr params = chrome::mojom::StaticParams::New();
                  Liang Zhao . unresolved

                  Why is this outside of IS_ANDROID? With the current code, renderer_configuration->SetConfigurationOnProcessLockUpdate() is not called for android, should we exclude that mojo method from android builds with [EnableIfNot=is_android]? Not sure whether we want to go further and exclude more functions like this one as a whole from android build instead of making the functions no op on android.

                  File content/public/renderer/content_renderer_client.h
                  Line 266, Patchset 77 (Latest): // Notifies the renderer has processed critical security settings from
                  // the browser. These settings (such as cross-origin isolation) are
                  // sent via `RenderProcessHostImpl::NotifyRendererOfLockedStateUpdate()`
                  // and must be in place before the renderer can safely process web content.
                  virtual void OnProcessReady();
                  Liang Zhao . unresolved

                  Does this has to be declared on ContentRendererClient? It is only called directly on ChromeContentRendererClient.

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Daniel Cheng
                  • Shunya Shishido
                  • Wangsong Jin
                  Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-Attention: Shunya Shishido <sisid...@chromium.org>
                  Gerrit-Comment-Date: Wed, 09 Jul 2025 17:56:09 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Wangsong Jin (Gerrit)

                  unread,
                  Jul 9, 2025, 6:56:45 PM7/9/25
                  to Shunya Shishido, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Daniel Cheng, Liang Zhao and Shunya Shishido

                  Wangsong Jin added 2 comments

                  File chrome/browser/chrome_content_browser_client.cc
                  Line 1892, Patchset 77: chrome::mojom::StaticParamsPtr params = chrome::mojom::StaticParams::New();
                  Liang Zhao . unresolved

                  Why is this outside of IS_ANDROID? With the current code, renderer_configuration->SetConfigurationOnProcessLockUpdate() is not called for android, should we exclude that mojo method from android builds with [EnableIfNot=is_android]? Not sure whether we want to go further and exclude more functions like this one as a whole from android build instead of making the functions no op on android.

                  Wangsong Jin

                  Thanks! I missed moving it inside the build flag earlier. I've now updated the change to exclude the method from the Android build for better readability. Otherwise, it becomes difficult to understand the flow for Android.

                  File content/public/renderer/content_renderer_client.h
                  Line 266, Patchset 77: // Notifies the renderer has processed critical security settings from

                  // the browser. These settings (such as cross-origin isolation) are
                  // sent via `RenderProcessHostImpl::NotifyRendererOfLockedStateUpdate()`
                  // and must be in place before the renderer can safely process web content.
                  virtual void OnProcessReady();
                  Liang Zhao . resolved

                  Does this has to be declared on ContentRendererClient? It is only called directly on ChromeContentRendererClient.

                  Wangsong Jin

                  Removed.

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Daniel Cheng
                  • Liang Zhao
                  • Shunya Shishido
                  Submit Requirements:
                  • requirement satisfiedCode-Coverage
                  • requirement is not satisfiedCode-Owners
                  • requirement is not satisfiedCode-Review
                  • requirement is not satisfiedNo-Unresolved-Comments
                  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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                  Gerrit-Change-Number: 6373046
                  Gerrit-PatchSet: 78
                  Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
                  Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
                  Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
                  Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
                  Gerrit-Reviewer: Shunya Shishido <sisid...@chromium.org>
                  Gerrit-Reviewer: Tibor Goldschwendt <tib...@chromium.org>
                  Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-CC: Charlie Reis <cr...@chromium.org>
                  Gerrit-CC: Cliff Smolinsky <clif...@microsoft.com>
                  Gerrit-CC: David Trainor <dtra...@chromium.org>
                  Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
                  Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
                  Gerrit-CC: Liang Zhao <lz...@microsoft.com>
                  Gerrit-CC: Stephen Chenney <sche...@chromium.org>
                  Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
                  Gerrit-Attention: Shunya Shishido <sisid...@chromium.org>
                  Gerrit-Comment-Date: Wed, 09 Jul 2025 22:56:34 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  Comment-In-Reply-To: Liang Zhao <lz...@microsoft.com>
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Liang Zhao (Gerrit)

                  unread,
                  Jul 9, 2025, 7:53:00 PM7/9/25
                  to Wangsong Jin, Shunya Shishido, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Daniel Cheng, Shunya Shishido and Wangsong Jin

                  Liang Zhao added 2 comments

                  File chrome/browser/chrome_content_browser_client.cc
                  Line 1892, Patchset 77: chrome::mojom::StaticParamsPtr params = chrome::mojom::StaticParams::New();
                  Liang Zhao . resolved

                  Why is this outside of IS_ANDROID? With the current code, renderer_configuration->SetConfigurationOnProcessLockUpdate() is not called for android, should we exclude that mojo method from android builds with [EnableIfNot=is_android]? Not sure whether we want to go further and exclude more functions like this one as a whole from android build instead of making the functions no op on android.

                  Wangsong Jin

                  Thanks! I missed moving it inside the build flag earlier. I've now updated the change to exclude the method from the Android build for better readability. Otherwise, it becomes difficult to understand the flow for Android.

                  Liang Zhao

                  Done

                  File chrome/renderer/chrome_content_renderer_client.cc
                  Line 1216, Patchset 78 (Latest): base::ScopedAllowBaseSyncPrimitivesOutsideBlockingScope allow_wait;
                  process_ready_event_.Wait();
                  Liang Zhao . unresolved

                  We probably want to not wait if kInstantUsesSpareRenderer is disabled. When the feature is disabled, OnProcessReady() would not be called.

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Daniel Cheng
                  • Shunya Shishido
                  • Wangsong Jin
                  Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-Attention: Shunya Shishido <sisid...@chromium.org>
                  Gerrit-Comment-Date: Wed, 09 Jul 2025 23:52:51 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Wangsong Jin (Gerrit)

                  unread,
                  Jul 10, 2025, 3:48:23 PM7/10/25
                  to Shunya Shishido, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Daniel Cheng, Liang Zhao and Shunya Shishido

                  Wangsong Jin added 2 comments

                  File chrome/browser/chrome_content_browser_client.cc
                  Line 1892, Patchset 77: chrome::mojom::StaticParamsPtr params = chrome::mojom::StaticParams::New();
                  Liang Zhao . resolved

                  Why is this outside of IS_ANDROID? With the current code, renderer_configuration->SetConfigurationOnProcessLockUpdate() is not called for android, should we exclude that mojo method from android builds with [EnableIfNot=is_android]? Not sure whether we want to go further and exclude more functions like this one as a whole from android build instead of making the functions no op on android.

                  Wangsong Jin

                  Thanks! I missed moving it inside the build flag earlier. I've now updated the change to exclude the method from the Android build for better readability. Otherwise, it becomes difficult to understand the flow for Android.

                  Wangsong Jin

                  Done

                  File chrome/renderer/chrome_content_renderer_client.cc
                  Line 1216, Patchset 78: base::ScopedAllowBaseSyncPrimitivesOutsideBlockingScope allow_wait;
                  process_ready_event_.Wait();
                  Liang Zhao . resolved

                  We probably want to not wait if kInstantUsesSpareRenderer is disabled. When the feature is disabled, OnProcessReady() would not be called.

                  Wangsong Jin

                  Yep we should, marked as resolved.

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Daniel Cheng
                  • Liang Zhao
                  • Shunya Shishido
                  Submit Requirements:
                  • requirement satisfiedCode-Coverage
                  • requirement is not satisfiedCode-Owners
                  • requirement is not satisfiedCode-Review
                  • requirement is not satisfiedNo-Unresolved-Comments
                  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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                  Gerrit-Change-Number: 6373046
                  Gerrit-PatchSet: 79
                  Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
                  Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
                  Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
                  Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
                  Gerrit-Reviewer: Shunya Shishido <sisid...@chromium.org>
                  Gerrit-Reviewer: Tibor Goldschwendt <tib...@chromium.org>
                  Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-CC: Charlie Reis <cr...@chromium.org>
                  Gerrit-CC: Cliff Smolinsky <clif...@microsoft.com>
                  Gerrit-CC: David Trainor <dtra...@chromium.org>
                  Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
                  Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
                  Gerrit-CC: Liang Zhao <lz...@microsoft.com>
                  Gerrit-CC: Stephen Chenney <sche...@chromium.org>
                  Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
                  Gerrit-Attention: Shunya Shishido <sisid...@chromium.org>
                  Gerrit-Comment-Date: Thu, 10 Jul 2025 19:48:14 +0000
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Shunya Shishido (Gerrit)

                  unread,
                  Jul 10, 2025, 9:45:10 PM7/10/25
                  to Wangsong Jin, Yoshisato Yanagisawa, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Daniel Cheng, Liang Zhao, Wangsong Jin and Yoshisato Yanagisawa

                  Shunya Shishido added 4 comments

                  Patchset-level comments
                  File-level comment, Patchset 79 (Latest):
                  Shunya Shishido . resolved

                  adding yyanagisawa as another SW owner.

                  File chrome/common/chrome_features.h
                  Line 605, Patchset 79 (Latest):BASE_DECLARE_FEATURE(kInstantUsesSpareRenderer);
                  Shunya Shishido . unresolved

                  What is the plan to rollout this feature? We basically use [Finch](https://developer.chrome.com/docs/web-platform/chrome-finch) and run a/b testing. Wondering how this is going to be tested in the field.

                  File chrome/renderer/chrome_content_renderer_client.cc
                  Line 1215, Patchset 79 (Latest):void ChromeContentRendererClient::WaitProcessReady() {
                  Shunya Shishido . unresolved

                  Do you mind adding the metrics to measure the taken time of this method?

                  File content/browser/renderer_host/render_process_host_impl.cc
                  Line 3289, Patchset 79 (Latest): if (!renderer_locked_state_updated_) {
                  Shunya Shishido . unresolved

                  Can you elaborate on why `renderer_locked_state_updated_` is newly introduced? `NotifyRendererOfLockedStateUpdate()` is called multiple times but `OnRendererProcessLockedStateUpdated()` should be called only once unlike other parts in this method?

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Daniel Cheng
                  • Liang Zhao
                  • Wangsong Jin
                  • Yoshisato Yanagisawa
                  Submit Requirements:
                  • requirement satisfiedCode-Coverage
                  • requirement is not satisfiedCode-Owners
                  • requirement is not satisfiedCode-Review
                  • requirement is not satisfiedNo-Unresolved-Comments
                  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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                  Gerrit-Change-Number: 6373046
                  Gerrit-PatchSet: 79
                  Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
                  Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
                  Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
                  Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
                  Gerrit-Reviewer: Shunya Shishido <sisid...@chromium.org>
                  Gerrit-Reviewer: Tibor Goldschwendt <tib...@chromium.org>
                  Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-Reviewer: Yoshisato Yanagisawa <yyana...@chromium.org>
                  Gerrit-CC: Charlie Reis <cr...@chromium.org>
                  Gerrit-CC: Cliff Smolinsky <clif...@microsoft.com>
                  Gerrit-CC: David Trainor <dtra...@chromium.org>
                  Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
                  Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
                  Gerrit-CC: Liang Zhao <lz...@microsoft.com>
                  Gerrit-CC: Stephen Chenney <sche...@chromium.org>
                  Gerrit-Attention: Yoshisato Yanagisawa <yyana...@chromium.org>
                  Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
                  Gerrit-Comment-Date: Fri, 11 Jul 2025 01:44:45 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Wangsong Jin (Gerrit)

                  unread,
                  Jul 11, 2025, 7:05:02 PM7/11/25
                  to Yoshisato Yanagisawa, Shunya Shishido, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Daniel Cheng, Liang Zhao, Shunya Shishido and Yoshisato Yanagisawa

                  Wangsong Jin added 3 comments

                  File chrome/common/chrome_features.h
                  Line 605, Patchset 79:BASE_DECLARE_FEATURE(kInstantUsesSpareRenderer);
                  Shunya Shishido . unresolved

                  What is the plan to rollout this feature? We basically use [Finch](https://developer.chrome.com/docs/web-platform/chrome-finch) and run a/b testing. Wondering how this is going to be tested in the field.

                  Wangsong Jin

                  Since this is a third-party NTP feature, we will initially keep it disabled in Chromium and then roll it out downstream. We plan to collect performance data on the creation of third-party NTPs and the time token for WaitProcessReady(). We will then return to the upstream team to discuss whether we want to roll out it in Chromium.

                  File chrome/renderer/chrome_content_renderer_client.cc
                  Line 1215, Patchset 79:void ChromeContentRendererClient::WaitProcessReady() {
                  Shunya Shishido . unresolved

                  Do you mind adding the metrics to measure the taken time of this method?

                  Wangsong Jin

                  Sure, added. Previous testing results revealed that mostly extension processes require this wait time. Therefore, we separated extension and non-extension processes for the metrics. From local testing, we found that in most cases, the wait time is around 20ms. We log instances where the wait time exceeds 20ms to identify potential performance issues.

                  File content/browser/renderer_host/render_process_host_impl.cc
                  Line 3289, Patchset 79: if (!renderer_locked_state_updated_) {
                  Shunya Shishido . unresolved

                  Can you elaborate on why `renderer_locked_state_updated_` is newly introduced? `NotifyRendererOfLockedStateUpdate()` is called multiple times but `OnRendererProcessLockedStateUpdated()` should be called only once unlike other parts in this method?

                  Wangsong Jin

                  I'm aware that these settings can be applied multiple times, which is unnecessary. Specifically, OnRendererProcessLockedStateUpdated() also triggers display as isolated scheme registration in the renderer, and we only need to register it once. I believe it's better for the other static settings to be set only once as well. However, to mitigate any risks in case of changes, I want to isolate this.
                  There's a previous thread we discuss why we add `renderer_locked_state_updated_ ` https://chromium-review.googlesource.com/c/chromium/src/+/6373046/comment/5ec03902_73a538eb/

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Daniel Cheng
                  • Liang Zhao
                  • Shunya Shishido
                  • Yoshisato Yanagisawa
                  Submit Requirements:
                  • requirement satisfiedCode-Coverage
                  • requirement is not satisfiedCode-Owners
                  • requirement is not satisfiedCode-Review
                  • requirement is not satisfiedNo-Unresolved-Comments
                  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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                  Gerrit-Change-Number: 6373046
                  Gerrit-PatchSet: 80
                  Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
                  Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
                  Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
                  Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
                  Gerrit-Reviewer: Shunya Shishido <sisid...@chromium.org>
                  Gerrit-Reviewer: Tibor Goldschwendt <tib...@chromium.org>
                  Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-Reviewer: Yoshisato Yanagisawa <yyana...@chromium.org>
                  Gerrit-CC: Charlie Reis <cr...@chromium.org>
                  Gerrit-CC: Cliff Smolinsky <clif...@microsoft.com>
                  Gerrit-CC: David Trainor <dtra...@chromium.org>
                  Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
                  Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
                  Gerrit-CC: Liang Zhao <lz...@microsoft.com>
                  Gerrit-CC: Stephen Chenney <sche...@chromium.org>
                  Gerrit-Attention: Yoshisato Yanagisawa <yyana...@chromium.org>
                  Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Attention: Shunya Shishido <sisid...@chromium.org>
                  Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
                  Gerrit-Comment-Date: Fri, 11 Jul 2025 23:04:53 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  Comment-In-Reply-To: Shunya Shishido <sisid...@chromium.org>
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Wangsong Jin (Gerrit)

                  unread,
                  Jul 11, 2025, 7:05:54 PM7/11/25
                  to Yoshisato Yanagisawa, Shunya Shishido, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Daniel Cheng, Liang Zhao, Shunya Shishido and Yoshisato Yanagisawa

                  Wangsong Jin added 3 comments

                  File chrome/common/chrome_features.h
                  Line 605, Patchset 79:BASE_DECLARE_FEATURE(kInstantUsesSpareRenderer);
                  Shunya Shishido . resolved

                  What is the plan to rollout this feature? We basically use [Finch](https://developer.chrome.com/docs/web-platform/chrome-finch) and run a/b testing. Wondering how this is going to be tested in the field.

                  Wangsong Jin

                  Since this is a third-party NTP feature, we will initially keep it disabled in Chromium and then roll it out downstream. We plan to collect performance data on the creation of third-party NTPs and the time token for WaitProcessReady(). We will then return to the upstream team to discuss whether we want to roll out it in Chromium.

                  Wangsong Jin

                  Done

                  File chrome/renderer/chrome_content_renderer_client.cc
                  Line 1215, Patchset 79:void ChromeContentRendererClient::WaitProcessReady() {
                  Shunya Shishido . resolved

                  Do you mind adding the metrics to measure the taken time of this method?

                  Wangsong Jin

                  Sure, added. Previous testing results revealed that mostly extension processes require this wait time. Therefore, we separated extension and non-extension processes for the metrics. From local testing, we found that in most cases, the wait time is around 20ms. We log instances where the wait time exceeds 20ms to identify potential performance issues.

                  Wangsong Jin

                  Done

                  File content/browser/renderer_host/render_process_host_impl.cc
                  Line 3289, Patchset 79: if (!renderer_locked_state_updated_) {
                  Shunya Shishido . resolved

                  Can you elaborate on why `renderer_locked_state_updated_` is newly introduced? `NotifyRendererOfLockedStateUpdate()` is called multiple times but `OnRendererProcessLockedStateUpdated()` should be called only once unlike other parts in this method?

                  Wangsong Jin

                  I'm aware that these settings can be applied multiple times, which is unnecessary. Specifically, OnRendererProcessLockedStateUpdated() also triggers display as isolated scheme registration in the renderer, and we only need to register it once. I believe it's better for the other static settings to be set only once as well. However, to mitigate any risks in case of changes, I want to isolate this.
                  There's a previous thread we discuss why we add `renderer_locked_state_updated_ ` https://chromium-review.googlesource.com/c/chromium/src/+/6373046/comment/5ec03902_73a538eb/

                  Wangsong Jin

                  Done

                  Gerrit-Comment-Date: Fri, 11 Jul 2025 23:05:45 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  Comment-In-Reply-To: Wangsong Jin <wangs...@microsoft.com>
                  Comment-In-Reply-To: Shunya Shishido <sisid...@chromium.org>
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Shunya Shishido (Gerrit)

                  unread,
                  Jul 14, 2025, 2:27:56 AM7/14/25
                  to Wangsong Jin, Chromium Metrics Reviews, Yoshisato Yanagisawa, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Daniel Cheng, Liang Zhao, Wangsong Jin and Yoshisato Yanagisawa

                  Shunya Shishido added 4 comments

                  File chrome/renderer/chrome_content_renderer_client.cc
                  Line 1215, Patchset 79:void ChromeContentRendererClient::WaitProcessReady() {
                  Shunya Shishido . unresolved

                  Do you mind adding the metrics to measure the taken time of this method?

                  Wangsong Jin

                  Sure, added. Previous testing results revealed that mostly extension processes require this wait time. Therefore, we separated extension and non-extension processes for the metrics. From local testing, we found that in most cases, the wait time is around 20ms. We log instances where the wait time exceeds 20ms to identify potential performance issues.

                  Wangsong Jin

                  Done

                  Shunya Shishido

                  Thanks. It doesn't make sense to me that we log the time only when it exceeds 20ms. Can we record this every time?

                  Line 1225, Patchset 80 (Latest): if (wait_duration >= base::Milliseconds(20)) {
                  Shunya Shishido . unresolved

                  I want to understand 1) the frequency of waiting for the process here, and 2) the taken time even under 20ms.

                  Line 1228, Patchset 80 (Latest): ? "ServiceWorker.InitiatorThread.WaitTime.Over20ms.ExtensionProcess"
                  Shunya Shishido . unresolved

                  WaitTimeForProcessReady?

                  Line 1228, Patchset 80 (Latest): ? "ServiceWorker.InitiatorThread.WaitTime.Over20ms.ExtensionProcess"
                  Shunya Shishido . unresolved

                  Maybe we don't need this?

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Daniel Cheng
                  • Liang Zhao
                  • Wangsong Jin
                  • Yoshisato Yanagisawa
                  Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
                  Gerrit-CC: Cliff Smolinsky <clif...@microsoft.com>
                  Gerrit-CC: David Trainor <dtra...@chromium.org>
                  Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
                  Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
                  Gerrit-CC: Liang Zhao <lz...@microsoft.com>
                  Gerrit-CC: Stephen Chenney <sche...@chromium.org>
                  Gerrit-Attention: Yoshisato Yanagisawa <yyana...@chromium.org>
                  Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
                  Gerrit-Comment-Date: Mon, 14 Jul 2025 06:27:27 +0000
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Wangsong Jin (Gerrit)

                  unread,
                  Jul 14, 2025, 5:20:57 PM7/14/25
                  to Chromium Metrics Reviews, Yoshisato Yanagisawa, Shunya Shishido, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Daniel Cheng, Liang Zhao, Shunya Shishido and Yoshisato Yanagisawa

                  Wangsong Jin added 4 comments

                  File chrome/renderer/chrome_content_renderer_client.cc
                  Line 1215, Patchset 79:void ChromeContentRendererClient::WaitProcessReady() {
                  Shunya Shishido . resolved

                  Do you mind adding the metrics to measure the taken time of this method?

                  Wangsong Jin

                  Sure, added. Previous testing results revealed that mostly extension processes require this wait time. Therefore, we separated extension and non-extension processes for the metrics. From local testing, we found that in most cases, the wait time is around 20ms. We log instances where the wait time exceeds 20ms to identify potential performance issues.

                  Wangsong Jin

                  Done

                  Shunya Shishido

                  Thanks. It doesn't make sense to me that we log the time only when it exceeds 20ms. Can we record this every time?

                  Wangsong Jin

                  Thank you! I've updated to record every time.

                  Line 1225, Patchset 80: if (wait_duration >= base::Milliseconds(20)) {
                  Shunya Shishido . resolved

                  I want to understand 1) the frequency of waiting for the process here, and 2) the taken time even under 20ms.

                  Wangsong Jin

                  Thanks for clarifying! I've added the metric to record whether the wait time has been taken for Frequency. Also, I've removed the > 20ms threshold.

                  Line 1228, Patchset 80: ? "ServiceWorker.InitiatorThread.WaitTime.Over20ms.ExtensionProcess"
                  Shunya Shishido . resolved

                  WaitTimeForProcessReady?

                  Wangsong Jin

                  Updated.

                  Line 1228, Patchset 80: ? "ServiceWorker.InitiatorThread.WaitTime.Over20ms.ExtensionProcess"
                  Shunya Shishido . resolved

                  Maybe we don't need this?

                  Wangsong Jin

                  Removed.

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Daniel Cheng
                  • Liang Zhao
                  • Shunya Shishido
                  • Yoshisato Yanagisawa
                  Submit Requirements:
                  • requirement satisfiedCode-Coverage
                  • requirement is not satisfiedCode-Owners
                  • requirement is not satisfiedCode-Review
                  • requirement is not satisfiedNo-Unresolved-Comments
                  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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                  Gerrit-Change-Number: 6373046
                  Gerrit-PatchSet: 81
                  Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
                  Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
                  Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
                  Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
                  Gerrit-Reviewer: Shunya Shishido <sisid...@chromium.org>
                  Gerrit-Reviewer: Tibor Goldschwendt <tib...@chromium.org>
                  Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-Reviewer: Yoshisato Yanagisawa <yyana...@chromium.org>
                  Gerrit-CC: Charlie Reis <cr...@chromium.org>
                  Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
                  Gerrit-CC: Cliff Smolinsky <clif...@microsoft.com>
                  Gerrit-CC: David Trainor <dtra...@chromium.org>
                  Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
                  Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
                  Gerrit-CC: Liang Zhao <lz...@microsoft.com>
                  Gerrit-CC: Stephen Chenney <sche...@chromium.org>
                  Gerrit-Attention: Yoshisato Yanagisawa <yyana...@chromium.org>
                  Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Attention: Shunya Shishido <sisid...@chromium.org>
                  Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
                  Gerrit-Comment-Date: Mon, 14 Jul 2025 21:20:44 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  Comment-In-Reply-To: Shunya Shishido <sisid...@chromium.org>
                  Comment-In-Reply-To: Wangsong Jin <wangs...@microsoft.com>
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Wangsong Jin (Gerrit)

                  unread,
                  Jul 16, 2025, 8:07:07 PM7/16/25
                  to Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Shunya Shishido, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Shunya Shishido

                  Wangsong Jin added 1 comment

                  Patchset-level comments
                  File-level comment, Patchset 82 (Latest):
                  Wangsong Jin . resolved

                  Hi sisidovski@, thank you for reviewing the worker-related changes! Let me know if you have any further feedback. If not, I’ll go ahead and ask the owner of the other area to take a look. Thanks again!

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Shunya Shishido
                  Submit Requirements:
                  • requirement satisfiedCode-Coverage
                  • requirement is not satisfiedCode-Owners
                  • requirement is not satisfiedCode-Review
                  • requirement is not satisfiedNo-Unresolved-Comments
                  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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                  Gerrit-Change-Number: 6373046
                  Gerrit-PatchSet: 82
                  Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
                  Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
                  Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
                  Gerrit-Reviewer: Jiacheng Guo <g...@google.com>
                  Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
                  Gerrit-Reviewer: Shunya Shishido <sisid...@chromium.org>
                  Gerrit-Reviewer: Tibor Goldschwendt <tib...@chromium.org>
                  Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-Reviewer: Yoshisato Yanagisawa <yyana...@chromium.org>
                  Gerrit-CC: Andrea Orru <andre...@chromium.org>
                  Gerrit-CC: Charlie Reis <cr...@chromium.org>
                  Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
                  Gerrit-CC: Cliff Smolinsky <clif...@microsoft.com>
                  Gerrit-CC: David Trainor <dtra...@chromium.org>
                  Gerrit-CC: Devlin Cronin <rdevlin...@chromium.org>
                  Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
                  Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
                  Gerrit-CC: Justin Lulejian <jlul...@chromium.org>
                  Gerrit-CC: Liang Zhao <lz...@microsoft.com>
                  Gerrit-CC: Stephen Chenney <sche...@chromium.org>
                  Gerrit-Attention: Shunya Shishido <sisid...@chromium.org>
                  Gerrit-Comment-Date: Thu, 17 Jul 2025 00:06:51 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Shunya Shishido (Gerrit)

                  unread,
                  Jul 17, 2025, 1:44:20 AM7/17/25
                  to Wangsong Jin, Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Wangsong Jin

                  Shunya Shishido added 5 comments

                  Patchset-level comments
                  Wangsong Jin . resolved

                  Hi sisidovski@, thank you for reviewing the worker-related changes! Let me know if you have any further feedback. If not, I’ll go ahead and ask the owner of the other area to take a look. Thanks again!

                  Shunya Shishido

                  Thanks, added metrics looks good, I still have a couple of questions though. Please don't try to get +1 one by one, just ask more broader reviews.

                  File chrome/browser/chrome_content_browser_client.cc
                  Line 1895, Patchset 82 (Latest): chrome::mojom::StaticParamsPtr params = chrome::mojom::StaticParams::New();
                  Shunya Shishido . unresolved

                  `params` should be created when it's actually used. Could you move this after the feature flag check?

                  Line 1902, Patchset 82 (Latest): if (search::ShouldAssignURLToInstantRenderer(site_url, profile)) {
                  Shunya Shishido . unresolved

                  Does this mean some other pages which are not third-party NTPs may dynamically update the renderer process with the instant process flag after this CL? Also what about 1st party NTP (chrome://new-tab-page)? The 1st party NTP will also run this new code path?

                  File chrome/common/renderer_configuration.mojom
                  Line 38, Patchset 82 (Latest):struct StaticParams {
                  Shunya Shishido . unresolved

                  I feel `StaticParams` is not appropriate since `is_instant_process` is dynamically updated.

                  File chrome/renderer/chrome_content_renderer_client.cc
                  Line 1228, Patchset 82 (Latest): process_ready_event_.Wait();
                  Shunya Shishido . unresolved

                  I'm not familiar with `base::WaitableEvent`, but what happens if `OnProcessReady()` is not called? `EmbeddedWorkerInstanceClientImpl::StartWorker()` is called regardless of whether the third-party NTP is involved or not. Just wondering if it will work without `OnProcessReady()`, or calling `OnProcessReady()` is guaranteed?

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Wangsong Jin
                  Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-Comment-Date: Thu, 17 Jul 2025 05:43:50 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  Comment-In-Reply-To: Wangsong Jin <wangs...@microsoft.com>
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Shunya Shishido (Gerrit)

                  unread,
                  Jul 17, 2025, 2:19:18 AM7/17/25
                  to Wangsong Jin, Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Wangsong Jin

                  Shunya Shishido added 1 comment

                  Patchset-level comments
                  Shunya Shishido . unresolved

                  @wangs...@microsoft.com Overall I feel that it would be great if `SetConfigurationOnProcessLockUpdate()` is called only when it's needed. Since it introduces additional mojo call in the service worker startup dependency, in the worst case a deadlock could happen in the initiator thread. If `SetConfigurationOnProcessLockUpdate()` and the lock mechanism are used only from third-party NTPs, this change is less concerning. WDYT?

                  Gerrit-Comment-Date: Thu, 17 Jul 2025 06:18:55 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Wangsong Jin (Gerrit)

                  unread,
                  Jul 17, 2025, 7:42:56 PM7/17/25
                  to Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Shunya Shishido, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Shunya Shishido

                  Wangsong Jin added 5 comments

                  Patchset-level comments
                  Shunya Shishido . unresolved

                  @wangs...@microsoft.com Overall I feel that it would be great if `SetConfigurationOnProcessLockUpdate()` is called only when it's needed. Since it introduces additional mojo call in the service worker startup dependency, in the worst case a deadlock could happen in the initiator thread. If `SetConfigurationOnProcessLockUpdate()` and the lock mechanism are used only from third-party NTPs, this change is less concerning. WDYT?

                  Wangsong Jin

                  We call SetConfigurationOnProcessLockUpdate() for all renderer processes, not just third-party NTPs, because we need to ensure that: `RegisterURLSchemeAsDisplayIsolated(chrome_search_scheme)` is called for non-instant processes. And `SetConfigurationOnProcessLockUpdate()` is the earliest earliest safe point to do so. Theoretically, it's possible to set a flag only for third-party NTPs and find a later place to check the flag and register the URL scheme. But as we have to ensure that RegisterURLSchemeAsDisplayIsolated() is called before `WTF::IsBeforeThreadCreated()`, we would require more delays in `WaitForProcessReady()` before initiating the thread.

                  File chrome/browser/chrome_content_browser_client.cc
                  Line 1895, Patchset 82: chrome::mojom::StaticParamsPtr params = chrome::mojom::StaticParams::New();
                  Shunya Shishido . resolved

                  `params` should be created when it's actually used. Could you move this after the feature flag check?

                  Wangsong Jin

                  Fixed.

                  Line 1902, Patchset 82: if (search::ShouldAssignURLToInstantRenderer(site_url, profile)) {
                  Shunya Shishido . resolved

                  Does this mean some other pages which are not third-party NTPs may dynamically update the renderer process with the instant process flag after this CL? Also what about 1st party NTP (chrome://new-tab-page)? The 1st party NTP will also run this new code path?

                  Wangsong Jin

                  Yes — since we late bind the is-instant process flag. and every renderer needs to check that flag in its logic. This also applies to the first-party NTPs

                  File chrome/common/renderer_configuration.mojom
                  Line 38, Patchset 82:struct StaticParams {
                  Shunya Shishido . resolved

                  I feel `StaticParams` is not appropriate since `is_instant_process` is dynamically updated.

                  Wangsong Jin

                  This `is_instant_process` flag is set only once per renderer process. In ChromeRenderThreadObserver::SetConfigurationOnProcessLockUpdate(), we have CHECK(!static_params_) to enforce that this value once set once.

                  File chrome/renderer/chrome_content_renderer_client.cc
                  Line 1228, Patchset 82: process_ready_event_.Wait();
                  Shunya Shishido . unresolved

                  I'm not familiar with `base::WaitableEvent`, but what happens if `OnProcessReady()` is not called? `EmbeddedWorkerInstanceClientImpl::StartWorker()` is called regardless of whether the third-party NTP is involved or not. Just wondering if it will work without `OnProcessReady()`, or calling `OnProcessReady()` is guaranteed?

                  Wangsong Jin

                  Wait won’t end until `OnProcessReady()` is called. But the design is based on `OnProcessReady()` is always happen after the renderer process is created and its security is set up. The caller `NotifyRendererOfLockedStateUpdate()->SetConfigurationOnProcessLockUpdate()` also has other settings which should be always called for renderers.

                  If `OnProcessReady()` isn’t called, it indicates a security issue - missing a call to `RegisterURLSchemeAsDisplayIsolated(chrome_search_scheme)` for renderer processes. To make this more robust, maybe we can add a timeout and call DwC to avoid hanging. What do you think? And What value do you think would be a good threshold? Thanks!

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Shunya Shishido
                  Submit Requirements:
                  • requirement satisfiedCode-Coverage
                  • requirement is not satisfiedCode-Owners
                  • requirement is not satisfiedCode-Review
                  • requirement is not satisfiedNo-Unresolved-Comments
                  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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                  Gerrit-Change-Number: 6373046
                  Gerrit-PatchSet: 83
                  Gerrit-Attention: Shunya Shishido <sisid...@chromium.org>
                  Gerrit-Comment-Date: Thu, 17 Jul 2025 23:42:48 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  Comment-In-Reply-To: Shunya Shishido <sisid...@chromium.org>
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Wangsong Jin (Gerrit)

                  unread,
                  Jul 21, 2025, 6:18:02 PM7/21/25
                  to Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Shunya Shishido, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Daniel Cheng and Shunya Shishido

                  Wangsong Jin added 3 comments

                  Patchset-level comments
                  Wangsong Jin . resolved

                  Hi sisidovski@, thank you for reviewing the worker-related changes! Let me know if you have any further feedback. If not, I’ll go ahead and ask the owner of the other area to take a look. Thanks again!

                  Shunya Shishido

                  Thanks, added metrics looks good, I still have a couple of questions though. Please don't try to get +1 one by one, just ask more broader reviews.

                  Wangsong Jin

                  I missed this message earlier and have re-added Daniel to review the other part of the change

                  File-level comment, Patchset 82:
                  Shunya Shishido . resolved

                  @wangs...@microsoft.com Overall I feel that it would be great if `SetConfigurationOnProcessLockUpdate()` is called only when it's needed. Since it introduces additional mojo call in the service worker startup dependency, in the worst case a deadlock could happen in the initiator thread. If `SetConfigurationOnProcessLockUpdate()` and the lock mechanism are used only from third-party NTPs, this change is less concerning. WDYT?

                  Wangsong Jin

                  We call SetConfigurationOnProcessLockUpdate() for all renderer processes, not just third-party NTPs, because we need to ensure that: `RegisterURLSchemeAsDisplayIsolated(chrome_search_scheme)` is called for non-instant processes. And `SetConfigurationOnProcessLockUpdate()` is the earliest earliest safe point to do so. Theoretically, it's possible to set a flag only for third-party NTPs and find a later place to check the flag and register the URL scheme. But as we have to ensure that RegisterURLSchemeAsDisplayIsolated() is called before `WTF::IsBeforeThreadCreated()`, we would require more delays in `WaitForProcessReady()` before initiating the thread.

                  Wangsong Jin

                  Done

                  File chrome/renderer/chrome_content_renderer_client.cc
                  Line 1228, Patchset 82: process_ready_event_.Wait();
                  Shunya Shishido . resolved

                  I'm not familiar with `base::WaitableEvent`, but what happens if `OnProcessReady()` is not called? `EmbeddedWorkerInstanceClientImpl::StartWorker()` is called regardless of whether the third-party NTP is involved or not. Just wondering if it will work without `OnProcessReady()`, or calling `OnProcessReady()` is guaranteed?

                  Wangsong Jin

                  Wait won’t end until `OnProcessReady()` is called. But the design is based on `OnProcessReady()` is always happen after the renderer process is created and its security is set up. The caller `NotifyRendererOfLockedStateUpdate()->SetConfigurationOnProcessLockUpdate()` also has other settings which should be always called for renderers.

                  If `OnProcessReady()` isn’t called, it indicates a security issue - missing a call to `RegisterURLSchemeAsDisplayIsolated(chrome_search_scheme)` for renderer processes. To make this more robust, maybe we can add a timeout and call DwC to avoid hanging. What do you think? And What value do you think would be a good threshold? Thanks!

                  Wangsong Jin

                  Added a 5-second timeout followed by a DwC action. Let me know if you have any alternative suggestions.

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Daniel Cheng
                  • Shunya Shishido
                  Submit Requirements:
                  • requirement satisfiedCode-Coverage
                  • requirement is not satisfiedCode-Owners
                  • requirement is not satisfiedCode-Review
                  • requirement is not satisfiedNo-Unresolved-Comments
                  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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                  Gerrit-Change-Number: 6373046
                  Gerrit-PatchSet: 84
                  Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Attention: Shunya Shishido <sisid...@chromium.org>
                  Gerrit-Comment-Date: Mon, 21 Jul 2025 22:17:57 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  Comment-In-Reply-To: Shunya Shishido <sisid...@chromium.org>
                  Comment-In-Reply-To: Wangsong Jin <wangs...@microsoft.com>
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Wangsong Jin (Gerrit)

                  unread,
                  Jul 22, 2025, 1:05:54 PM7/22/25
                  to Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Shunya Shishido, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Daniel Cheng and Shunya Shishido

                  Wangsong Jin added 1 comment

                  File chrome/renderer/chrome_content_renderer_client.cc
                  Line 1743, Patchset 29: WebSecurityPolicy::RegisterURLSchemeAsDisplayIsolated(chrome_search_scheme);
                  Daniel Cheng . resolved
                  Wangsong Jin

                  Updated to WaitProcessReady() before starting the service worker thread solve the issue. Close this thread now.

                  Gerrit-Comment-Date: Tue, 22 Jul 2025 17:05:43 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
                  Comment-In-Reply-To: Wangsong Jin <wangs...@microsoft.com>
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Shunya Shishido (Gerrit)

                  unread,
                  Jul 23, 2025, 5:31:43 AM7/23/25
                  to Wangsong Jin, Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Daniel Cheng and Wangsong Jin

                  Shunya Shishido added 1 comment

                  Patchset-level comments
                  File-level comment, Patchset 82:
                  Shunya Shishido . unresolved

                  @wangs...@microsoft.com Overall I feel that it would be great if `SetConfigurationOnProcessLockUpdate()` is called only when it's needed. Since it introduces additional mojo call in the service worker startup dependency, in the worst case a deadlock could happen in the initiator thread. If `SetConfigurationOnProcessLockUpdate()` and the lock mechanism are used only from third-party NTPs, this change is less concerning. WDYT?

                  Wangsong Jin

                  We call SetConfigurationOnProcessLockUpdate() for all renderer processes, not just third-party NTPs, because we need to ensure that: `RegisterURLSchemeAsDisplayIsolated(chrome_search_scheme)` is called for non-instant processes. And `SetConfigurationOnProcessLockUpdate()` is the earliest earliest safe point to do so. Theoretically, it's possible to set a flag only for third-party NTPs and find a later place to check the flag and register the URL scheme. But as we have to ensure that RegisterURLSchemeAsDisplayIsolated() is called before `WTF::IsBeforeThreadCreated()`, we would require more delays in `WaitForProcessReady()` before initiating the thread.

                  Wangsong Jin

                  Done

                  Shunya Shishido

                  Does RegisterURLSchemeAsDisplayIsolated(chrome_search_scheme) have to be called only when the instant process flag is not enabled? We can't just call it unconditionally?

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Daniel Cheng
                  • Wangsong Jin
                  Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-Comment-Date: Wed, 23 Jul 2025 09:31:09 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Wangsong Jin (Gerrit)

                  unread,
                  Jul 23, 2025, 4:42:41 PM7/23/25
                  to Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Shunya Shishido, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Daniel Cheng and Shunya Shishido

                  Wangsong Jin added 2 comments

                  Patchset-level comments
                  Shunya Shishido . unresolved

                  @wangs...@microsoft.com Overall I feel that it would be great if `SetConfigurationOnProcessLockUpdate()` is called only when it's needed. Since it introduces additional mojo call in the service worker startup dependency, in the worst case a deadlock could happen in the initiator thread. If `SetConfigurationOnProcessLockUpdate()` and the lock mechanism are used only from third-party NTPs, this change is less concerning. WDYT?

                  Wangsong Jin

                  We call SetConfigurationOnProcessLockUpdate() for all renderer processes, not just third-party NTPs, because we need to ensure that: `RegisterURLSchemeAsDisplayIsolated(chrome_search_scheme)` is called for non-instant processes. And `SetConfigurationOnProcessLockUpdate()` is the earliest earliest safe point to do so. Theoretically, it's possible to set a flag only for third-party NTPs and find a later place to check the flag and register the URL scheme. But as we have to ensure that RegisterURLSchemeAsDisplayIsolated() is called before `WTF::IsBeforeThreadCreated()`, we would require more delays in `WaitForProcessReady()` before initiating the thread.

                  Wangsong Jin

                  Done

                  Shunya Shishido

                  Does RegisterURLSchemeAsDisplayIsolated(chrome_search_scheme) have to be called only when the instant process flag is not enabled? We can't just call it unconditionally?

                  Wangsong Jin

                  Yep.

                  File-level comment, Patchset 82:
                  Shunya Shishido . resolved

                  @wangs...@microsoft.com Overall I feel that it would be great if `SetConfigurationOnProcessLockUpdate()` is called only when it's needed. Since it introduces additional mojo call in the service worker startup dependency, in the worst case a deadlock could happen in the initiator thread. If `SetConfigurationOnProcessLockUpdate()` and the lock mechanism are used only from third-party NTPs, this change is less concerning. WDYT?

                  Wangsong Jin

                  We call SetConfigurationOnProcessLockUpdate() for all renderer processes, not just third-party NTPs, because we need to ensure that: `RegisterURLSchemeAsDisplayIsolated(chrome_search_scheme)` is called for non-instant processes. And `SetConfigurationOnProcessLockUpdate()` is the earliest earliest safe point to do so. Theoretically, it's possible to set a flag only for third-party NTPs and find a later place to check the flag and register the URL scheme. But as we have to ensure that RegisterURLSchemeAsDisplayIsolated() is called before `WTF::IsBeforeThreadCreated()`, we would require more delays in `WaitForProcessReady()` before initiating the thread.

                  Wangsong Jin

                  Done

                  Shunya Shishido

                  Does RegisterURLSchemeAsDisplayIsolated(chrome_search_scheme) have to be called only when the instant process flag is not enabled? We can't just call it unconditionally?

                  Wangsong Jin

                  Unfortunately, we can’t. This was also discussed [here](https://chromium-review.googlesource.com/c/chromium/src/+/6373046/comment/ca0b133a_d9863f35/). There’s historical context behind the special handling of chrome-search and display-isolated schemes (https://issues.chromium.org/issues/40309067 and https://chromiumcodereview.appspot.com/12621008/). We can’t simply register this for the instant process, as that would introduce behavior change.

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Daniel Cheng
                  • Shunya Shishido
                  Gerrit-Attention: Shunya Shishido <sisid...@chromium.org>
                  Gerrit-Comment-Date: Wed, 23 Jul 2025 20:42:31 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Shunya Shishido (Gerrit)

                  unread,
                  Jul 23, 2025, 9:26:27 PM7/23/25
                  to Wangsong Jin, Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Daniel Cheng and Wangsong Jin

                  Shunya Shishido voted and added 5 comments

                  Votes added by Shunya Shishido

                  Code-Review+1

                  5 comments

                  Patchset-level comments
                  Shunya Shishido . resolved

                  @wangs...@microsoft.com Overall I feel that it would be great if `SetConfigurationOnProcessLockUpdate()` is called only when it's needed. Since it introduces additional mojo call in the service worker startup dependency, in the worst case a deadlock could happen in the initiator thread. If `SetConfigurationOnProcessLockUpdate()` and the lock mechanism are used only from third-party NTPs, this change is less concerning. WDYT?

                  Wangsong Jin

                  We call SetConfigurationOnProcessLockUpdate() for all renderer processes, not just third-party NTPs, because we need to ensure that: `RegisterURLSchemeAsDisplayIsolated(chrome_search_scheme)` is called for non-instant processes. And `SetConfigurationOnProcessLockUpdate()` is the earliest earliest safe point to do so. Theoretically, it's possible to set a flag only for third-party NTPs and find a later place to check the flag and register the URL scheme. But as we have to ensure that RegisterURLSchemeAsDisplayIsolated() is called before `WTF::IsBeforeThreadCreated()`, we would require more delays in `WaitForProcessReady()` before initiating the thread.

                  Wangsong Jin

                  Done

                  Shunya Shishido

                  Does RegisterURLSchemeAsDisplayIsolated(chrome_search_scheme) have to be called only when the instant process flag is not enabled? We can't just call it unconditionally?

                  Wangsong Jin

                  Yep.

                  Shunya Shishido

                  Thanks for explaining. I understood chrome-search shouldn't be registered as display isolated for third-party NTP.

                  File-level comment, Patchset 84 (Latest):
                  Shunya Shishido . resolved

                  LGTM w/ nits.

                  As the Chrome loading perspective, we'd like to ask the Chrome side POC to run the Finch experiment with monitoring ServiceWorker metrics to ensure the regression is negligible. I would appreciate if someone from the CSA team take this.

                  File chrome/renderer/chrome_content_renderer_client.cc
                  Line 521, Patchset 84 (Latest): WebSecurityPolicy::RegisterURLSchemeAsDisplayIsolated(chrome_search_scheme);
                  Shunya Shishido . unresolved

                  Based on the discussion in this CL, could you add a comment why chrome-search scheme should not be registered as display isolated when 1) the process doesn't have instant flag, or 2) kInstantUsesSpareRenderer is enabled?

                  File chrome/renderer/chrome_render_thread_observer.cc
                  Line 89, Patchset 84 (Latest):void RegisterDisplayIsolatedURLScheme() {
                  Shunya Shishido . unresolved

                  Could you make this more concrete? e.g. `ResisterChromeSearchSchemeDisplayIsolated()`.

                  Line 93, Patchset 84 (Latest): WebString chrome_search_scheme(
                  Shunya Shishido . unresolved

                  ditto. Adding a comment would be helpful.

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Daniel Cheng
                  • Wangsong Jin
                  Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-Comment-Date: Thu, 24 Jul 2025 01:25:55 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: Yes
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Shunya Shishido (Gerrit)

                  unread,
                  Jul 23, 2025, 9:29:01 PM7/23/25
                  to Wangsong Jin, Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Alex Moshchuk, Daniel Cheng and Wangsong Jin

                  Shunya Shishido added 1 comment

                  Patchset-level comments
                  Shunya Shishido . unresolved

                  LGTM w/ nits.

                  As the Chrome loading perspective, we'd like to ask the Chrome side POC to run the Finch experiment with monitoring ServiceWorker metrics to ensure the regression is negligible. I would appreciate if someone from the CSA team take this.

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Alex Moshchuk
                  • Daniel Cheng
                  • Wangsong Jin
                  Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                  Gerrit-Comment-Date: Thu, 24 Jul 2025 01:28:30 +0000
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Wangsong Jin (Gerrit)

                  unread,
                  Jul 24, 2025, 3:28:59 PM7/24/25
                  to Shunya Shishido, Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Alex Moshchuk, Daniel Cheng and Shunya Shishido

                  Wangsong Jin added 3 comments

                  File chrome/renderer/chrome_content_renderer_client.cc
                  Line 521, Patchset 84: WebSecurityPolicy::RegisterURLSchemeAsDisplayIsolated(chrome_search_scheme);
                  Shunya Shishido . resolved

                  Based on the discussion in this CL, could you add a comment why chrome-search scheme should not be registered as display isolated when 1) the process doesn't have instant flag, or 2) kInstantUsesSpareRenderer is enabled?

                  Wangsong Jin

                  Sure, added!

                  File chrome/renderer/chrome_render_thread_observer.cc
                  Line 89, Patchset 84:void RegisterDisplayIsolatedURLScheme() {
                  Shunya Shishido . resolved

                  Could you make this more concrete? e.g. `ResisterChromeSearchSchemeDisplayIsolated()`.

                  Wangsong Jin

                  Yeah, updated.

                  Line 93, Patchset 84: WebString chrome_search_scheme(
                  Shunya Shishido . resolved

                  ditto. Adding a comment would be helpful.

                  Wangsong Jin

                  Done

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Alex Moshchuk
                  • Daniel Cheng
                  • Shunya Shishido
                  Submit Requirements:
                  • requirement satisfiedCode-Coverage
                  • requirement is not satisfiedCode-Owners
                  • requirement is not satisfiedCode-Review
                  • requirement is not satisfiedNo-Unresolved-Comments
                  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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                  Gerrit-Change-Number: 6373046
                  Gerrit-PatchSet: 85
                  Gerrit-Attention: Shunya Shishido <sisid...@chromium.org>
                  Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                  Gerrit-Comment-Date: Thu, 24 Jul 2025 19:28:49 +0000
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Daniel Cheng (Gerrit)

                  unread,
                  Jul 28, 2025, 4:28:45 PM7/28/25
                  to Wangsong Jin, Shunya Shishido, Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Alex Moshchuk and Wangsong Jin

                  Daniel Cheng added 4 comments

                  File chrome/renderer/chrome_render_thread_observer.cc
                  Line 254, Patchset 85 (Latest): renderer_client_->OnProcessReady();
                  Daniel Cheng . unresolved

                  Layering-wise, I think it would make more sense for the WaitableEvent to be here, and for ChromeContentRendererClient to delegate the WaitForProcessReady() call to the render thread observer.

                  Then we don't need to set a back pointer to the content renderer client implementation.

                  File content/browser/renderer_host/render_process_host_impl.h
                  Line 1418, Patchset 85 (Latest): bool renderer_locked_state_updated_ = false;
                  Daniel Cheng . unresolved

                  Our convention here isn't very strong, but I personally like it when bools start with "is_" or "did_" or "has_", so this would be something like `did_update_renderer_locked_state_`. But I guess that doesn't pair quite as well with the method name... so I'll leave this up to you.

                  File content/browser/renderer_host/render_process_host_impl.cc
                  Line 3285, Patchset 85 (Latest): if (!renderer_locked_state_updated_) {
                  Daniel Cheng . unresolved

                  In earlier patchsets, I believe we mentioned that this can be called more than once?

                  We should maybe document why in a comment... but ideally we just would not call this more than once.

                  (e.g. it's not clear why we need to guard this but not `SetIsLockedToSite()`; it seems like some of these methods are idempotent while others aren't or might be dynamically updated, and it becomes a bit hard to understand what's going on here)

                  File content/public/renderer/content_renderer_client.h
                  Line 271, Patchset 85 (Latest): virtual void WaitProcessReady();
                  Daniel Cheng . unresolved

                  Nit: `WaitForProcessReady()`

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Alex Moshchuk
                  • Wangsong Jin
                  Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                  Gerrit-Comment-Date: Mon, 28 Jul 2025 20:28:35 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Wangsong Jin (Gerrit)

                  unread,
                  Jul 28, 2025, 7:58:24 PM7/28/25
                  to Shunya Shishido, Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Alex Moshchuk and Daniel Cheng

                  Wangsong Jin added 4 comments

                  File chrome/renderer/chrome_render_thread_observer.cc
                  Line 254, Patchset 85: renderer_client_->OnProcessReady();
                  Daniel Cheng . resolved

                  Layering-wise, I think it would make more sense for the WaitableEvent to be here, and for ChromeContentRendererClient to delegate the WaitForProcessReady() call to the render thread observer.

                  Then we don't need to set a back pointer to the content renderer client implementation.

                  Wangsong Jin

                  Yeah, that's a good idea. I’ve refactored the code. Thanks!

                  File content/browser/renderer_host/render_process_host_impl.h
                  Line 1418, Patchset 85: bool renderer_locked_state_updated_ = false;
                  Daniel Cheng . resolved

                  Our convention here isn't very strong, but I personally like it when bools start with "is_" or "did_" or "has_", so this would be something like `did_update_renderer_locked_state_`. But I guess that doesn't pair quite as well with the method name... so I'll leave this up to you.

                  Wangsong Jin

                  Updated to `did_update_renderer_locked_state_`.

                  File content/browser/renderer_host/render_process_host_impl.cc
                  Line 3285, Patchset 85: if (!renderer_locked_state_updated_) {
                  Daniel Cheng . resolved

                  In earlier patchsets, I believe we mentioned that this can be called more than once?

                  We should maybe document why in a comment... but ideally we just would not call this more than once.

                  (e.g. it's not clear why we need to guard this but not `SetIsLockedToSite()`; it seems like some of these methods are idempotent while others aren't or might be dynamically updated, and it becomes a bit hard to understand what's going on here)

                  Wangsong Jin

                  I’ve added a comment. I think it's better for other settings that are intended to be configured only once should also be gated, or we should find a place where they are invoked just once per renderer. I’ve created a separate task to for this: http://crbug.com/434735272.

                  File content/public/renderer/content_renderer_client.h
                  Line 271, Patchset 85: virtual void WaitProcessReady();
                  Daniel Cheng . resolved

                  Nit: `WaitForProcessReady()`

                  Wangsong Jin

                  Done

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Alex Moshchuk
                  • Daniel Cheng
                  Submit Requirements:
                  • requirement satisfiedCode-Coverage
                  • requirement is not satisfiedCode-Owners
                  • requirement is not satisfiedCode-Review
                  • requirement is not satisfiedNo-Unresolved-Comments
                  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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                  Gerrit-Change-Number: 6373046
                  Gerrit-PatchSet: 86
                  Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                  Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                  Gerrit-Comment-Date: Mon, 28 Jul 2025 23:58:12 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Wangsong Jin (Gerrit)

                  unread,
                  Jul 29, 2025, 6:18:35 PM7/29/25
                  to Shunya Shishido, Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Alex Moshchuk, Daniel Cheng and Shunya Shishido

                  Wangsong Jin added 2 comments

                  Patchset-level comments
                  File-level comment, Patchset 84:
                  Shunya Shishido . resolved

                  LGTM w/ nits.

                  As the Chrome loading perspective, we'd like to ask the Chrome side POC to run the Finch experiment with monitoring ServiceWorker metrics to ensure the regression is negligible. I would appreciate if someone from the CSA team take this.

                  Shunya Shishido

                  @dch...@chromium.org @ale...@chromium.org WDYT?

                  Wangsong Jin

                  Thanks for highlighting this. Discussed with CSA team today (07/29/), the take away is that the feature will firstly be rolled out downstream. We'll monitor 3rd NTP and SW creation time metrics and share the result to the CSA team. If the metrics look fine, the CSA team proceed with a rollout with monitoring the default set of guardrails. cc: @dch...@chromium.org @ale...@chromium.org

                  File chrome/common/chrome_features.cc
                  Line 1043, Patchset 77: base::FEATURE_ENABLED_BY_DEFAULT); // [!!NEED RESET] Temporary override
                  Wangsong Jin . unresolved

                  Placeholder to reset the feature flag back

                  Wangsong Jin

                  Will revert this after passing the DRY CQ Run.

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Alex Moshchuk
                  • Daniel Cheng
                  • Shunya Shishido
                  Submit Requirements:
                  • requirement satisfiedCode-Coverage
                  • requirement is not satisfiedCode-Owners
                  • requirement is not satisfiedCode-Review
                  • requirement is not satisfiedNo-Unresolved-Comments
                  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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                  Gerrit-Change-Number: 6373046
                  Gerrit-PatchSet: 87
                  Gerrit-Attention: Shunya Shishido <sisid...@chromium.org>
                  Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                  Gerrit-Comment-Date: Tue, 29 Jul 2025 22:18:25 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Shunya Shishido (Gerrit)

                  unread,
                  Jul 29, 2025, 10:50:13 PM7/29/25
                  to Wangsong Jin, Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Alex Moshchuk, Daniel Cheng and Wangsong Jin

                  Shunya Shishido added 1 comment

                  Patchset-level comments
                  Shunya Shishido . resolved

                  LGTM w/ nits.

                  As the Chrome loading perspective, we'd like to ask the Chrome side POC to run the Finch experiment with monitoring ServiceWorker metrics to ensure the regression is negligible. I would appreciate if someone from the CSA team take this.

                  Shunya Shishido

                  @dch...@chromium.org @ale...@chromium.org WDYT?

                  Wangsong Jin

                  Thanks for highlighting this. Discussed with CSA team today (07/29/), the take away is that the feature will firstly be rolled out downstream. We'll monitor 3rd NTP and SW creation time metrics and share the result to the CSA team. If the metrics look fine, the CSA team proceed with a rollout with monitoring the default set of guardrails. cc: @dch...@chromium.org @ale...@chromium.org

                  Shunya Shishido

                  SGTM. Here is our key metrics. Please monitor these metrics when you rollout:

                  • `ServiceWorker.LoadTiming.MainFrame.MainResource.ForwardServiceWorkerToWorkerReady2`
                  • `Extensions.ServiceWorkerBackground.StartWorkerTime`
                  • `PageLoad.Clients.ServiceWorker2.ParseTiming.NavigationToParseStart`
                  • `PageLoad.Clients.ServiceWorker2.PaintTiming.NavigationToLargestContentfulPaint2`
                  • `PageLoad.ParseTiming.NavigationToParseStart`
                  • `PageLoad.PaintTiming.NavigationToLargestContentfulPaint2`
                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Alex Moshchuk
                  • Daniel Cheng
                  • Wangsong Jin
                  Submit Requirements:
                  • requirement satisfiedCode-Coverage
                  • requirement is not satisfiedCode-Owners
                  • requirement is not satisfiedCode-Review
                  • requirement is not satisfiedNo-Unresolved-Comments
                  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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                  Gerrit-Change-Number: 6373046
                  Gerrit-PatchSet: 88
                  Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
                  Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                  Gerrit-Comment-Date: Wed, 30 Jul 2025 02:49:45 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Wangsong Jin (Gerrit)

                  unread,
                  Jul 30, 2025, 1:45:58 PM7/30/25
                  to Shunya Shishido, Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Alex Moshchuk and Daniel Cheng

                  Wangsong Jin added 1 comment

                  File chrome/common/chrome_features.cc
                  Line 1043, Patchset 77: base::FEATURE_ENABLED_BY_DEFAULT); // [!!NEED RESET] Temporary override
                  Wangsong Jin . resolved

                  Placeholder to reset the feature flag back

                  Wangsong Jin

                  Will revert this after passing the DRY CQ Run.

                  Wangsong Jin

                  PatchSet 87 passed all the tests. https://chromium-review.googlesource.com/c/chromium/src/+/6373046/87?tab=checks
                  Reverted to disable the feature flag by default.

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Alex Moshchuk
                  • Daniel Cheng
                  Submit Requirements:
                  • requirement satisfiedCode-Coverage
                  • requirement is not satisfiedCode-Owners
                  • requirement is not satisfiedCode-Review
                  Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                  Gerrit-Comment-Date: Wed, 30 Jul 2025 17:45:47 +0000
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Wangsong Jin (Gerrit)

                  unread,
                  Jul 31, 2025, 2:25:51 PM7/31/25
                  to Shunya Shishido, Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Alex Moshchuk and Daniel Cheng

                  Wangsong Jin added 1 comment

                  Patchset-level comments
                  File-level comment, Patchset 89 (Latest):
                  Wangsong Jin . resolved

                  Hi @ale...@chromium.org and @dch...@chromium.org, could you help to take a look when you get a chance? Thanks a lot!

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Alex Moshchuk
                  • Daniel Cheng
                  Submit Requirements:
                  • requirement satisfiedCode-Coverage
                  • requirement is not satisfiedCode-Owners
                  • requirement is not satisfiedCode-Review
                  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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                  Gerrit-Change-Number: 6373046
                  Gerrit-PatchSet: 89
                  Gerrit-Comment-Date: Thu, 31 Jul 2025 18:25:42 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Daniel Cheng (Gerrit)

                  unread,
                  Aug 1, 2025, 1:15:33 PM8/1/25
                  to Wangsong Jin, Shunya Shishido, Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                  Attention needed from Alex Moshchuk and Wangsong Jin

                  Daniel Cheng added 10 comments

                  Patchset-level comments
                  Daniel Cheng . resolved

                  Thanks, this is looking close; a few more comments from my side and we should be good.

                  File chrome/browser/chrome_content_browser_client.cc
                  Line 1007, Patchset 89 (Latest): if (!channel) {
                  Daniel Cheng . unresolved

                  Do we need to handle this case? We effectively return a `nullptr` here, but we don't handle `nullptr` in the caller, which implies that this isn't reached; having no channel usually means the renderer crashed (I think?), and we shouldn't be committing things in that state.

                  Line 1903, Patchset 89 (Latest): if (profile) {
                  Daniel Cheng . unresolved

                  Do we really need a null check here? It looks like this can only happen in incorrectly-configured tests.

                  File chrome/browser/ui/search/third_party_ntp_browsertest.cc
                  Line 108, Patchset 89 (Latest): const char* kChromeSearchIframeUrl =
                  Daniel Cheng . unresolved
                  ```suggestion
                  const char kChromeSearchIframeUrl[] =
                  ```

                  (As written, this is a **mutable** pointer to a string literal, so `kChromeSearchIframeUrl` can be assigned)

                  Line 114, Patchset 89 (Latest): std::string script = std::string(
                  "const frame = document.createElement('iframe');"
                  "frame.src = '") +
                  kChromeSearchIframeUrl +
                  "';"
                  "document.body.appendChild(frame);";
                  Daniel Cheng . unresolved

                  Nit: use `base::StrCat()` instead of `std::string::operator+`, which has bad code generation and algorithmic complexity)

                  Line 148, Patchset 89 (Latest): std::string("window.location= '") + kChromeSearchIframeUrl + "';";
                  Daniel Cheng . unresolved

                  Same comment: use `base::StrCat()` here please.

                  File chrome/renderer/chrome_content_renderer_client.cc
                  Line 511, Patchset 89 (Latest): bool should_register_chrome_search_scheme =
                  Daniel Cheng . unresolved
                  Naming suggestion:
                  ```suggestion
                  bool should_restrict_chrome_search_scheme =
                  ```
                  Line 1241, Patchset 89 (Latest): LOG(ERROR) << "ServiceWorker.InitiatorThread: Process ready wait time took "
                  Daniel Cheng . unresolved

                  Do you expect anyone to consume this log message? Otherwise let's use `DLOG`

                  File content/public/browser/content_browser_client.h
                  Line 423, Patchset 89 (Latest): content::BrowserContext* browser_context,
                  Daniel Cheng . unresolved

                  I might suggest only passing the `RenderProcessHost` here; the caller can grab the `BrowserContext` from it if it needs it.

                  Line 421, Patchset 89 (Latest): // Called when the locked state of a renderer process is updated.
                  Daniel Cheng . unresolved

                  Nit: it would be nice to be a bit more specific here. When is the locked state updated? Can this be called more than once? et cetera

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Alex Moshchuk
                  • Wangsong Jin
                  Submit Requirements:
                    • requirement satisfiedCode-Coverage
                    • requirement is not satisfiedCode-Owners
                    • requirement is not satisfiedCode-Review
                    • requirement is not satisfiedNo-Unresolved-Comments
                    Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
                    Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                    Gerrit-Comment-Date: Fri, 01 Aug 2025 17:15:24 +0000
                    Gerrit-HasComments: Yes
                    Gerrit-Has-Labels: No
                    satisfied_requirement
                    unsatisfied_requirement
                    open
                    diffy

                    Wangsong Jin (Gerrit)

                    unread,
                    Aug 1, 2025, 4:12:24 PM8/1/25
                    to Shunya Shishido, Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                    Attention needed from Alex Moshchuk and Daniel Cheng

                    Wangsong Jin added 9 comments

                    File chrome/browser/chrome_content_browser_client.cc
                    Line 1007, Patchset 89: if (!channel) {
                    Daniel Cheng . resolved

                    Do we need to handle this case? We effectively return a `nullptr` here, but we don't handle `nullptr` in the caller, which implies that this isn't reached; having no channel usually means the renderer crashed (I think?), and we shouldn't be committing things in that state.

                    Wangsong Jin

                    Thanks! We don't need to call if there's no channel - renderer crashed. I've added the non nullptr check in the caller to handle this case.

                    Line 1903, Patchset 89: if (profile) {
                    Daniel Cheng . resolved

                    Do we really need a null check here? It looks like this can only happen in incorrectly-configured tests.

                    Wangsong Jin

                    Removed.

                    File chrome/browser/ui/search/third_party_ntp_browsertest.cc
                    Line 108, Patchset 89: const char* kChromeSearchIframeUrl =
                    Daniel Cheng . resolved
                    ```suggestion
                    const char kChromeSearchIframeUrl[] =
                    ```

                    (As written, this is a **mutable** pointer to a string literal, so `kChromeSearchIframeUrl` can be assigned)

                    Wangsong Jin

                    Done

                    Line 114, Patchset 89: std::string script = std::string(

                    "const frame = document.createElement('iframe');"
                    "frame.src = '") +
                    kChromeSearchIframeUrl +
                    "';"
                    "document.body.appendChild(frame);";
                    Daniel Cheng . resolved

                    Nit: use `base::StrCat()` instead of `std::string::operator+`, which has bad code generation and algorithmic complexity)

                    Wangsong Jin

                    Thanks! Refined.

                    Line 148, Patchset 89: std::string("window.location= '") + kChromeSearchIframeUrl + "';";
                    Daniel Cheng . resolved

                    Same comment: use `base::StrCat()` here please.

                    Wangsong Jin

                    Done

                    File chrome/renderer/chrome_content_renderer_client.cc
                    Line 511, Patchset 89: bool should_register_chrome_search_scheme =
                    Daniel Cheng . resolved
                    Naming suggestion:
                    ```suggestion
                    bool should_restrict_chrome_search_scheme =
                    ```
                    Wangsong Jin

                    Done

                    Line 1241, Patchset 89: LOG(ERROR) << "ServiceWorker.InitiatorThread: Process ready wait time took "
                    Daniel Cheng . resolved

                    Do you expect anyone to consume this log message? Otherwise let's use `DLOG`

                    Wangsong Jin

                    Done

                    File content/public/browser/content_browser_client.h
                    Line 423, Patchset 89: content::BrowserContext* browser_context,
                    Daniel Cheng . resolved

                    I might suggest only passing the `RenderProcessHost` here; the caller can grab the `BrowserContext` from it if it needs it.

                    Wangsong Jin

                    Thanks! I’ve removed `BrowserContext`. I kept site_url because including content/browser/process_lock.h in chrome_content_browser_client.cc didn’t feel appropriate.

                    Line 421, Patchset 89: // Called when the locked state of a renderer process is updated.
                    Daniel Cheng . resolved

                    Nit: it would be nice to be a bit more specific here. When is the locked state updated? Can this be called more than once? et cetera

                    Wangsong Jin

                    Sure, added.

                    Open in Gerrit

                    Related details

                    Attention is currently required from:
                    • Alex Moshchuk
                    • Daniel Cheng
                    Submit Requirements:
                    • requirement satisfiedCode-Coverage
                    • requirement is not satisfiedCode-Owners
                    • requirement is not satisfiedCode-Review
                    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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                    Gerrit-Change-Number: 6373046
                    Gerrit-PatchSet: 90
                    Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                    Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                    Gerrit-Comment-Date: Fri, 01 Aug 2025 20:12:13 +0000
                    Gerrit-HasComments: Yes
                    Gerrit-Has-Labels: No
                    Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
                    satisfied_requirement
                    unsatisfied_requirement
                    open
                    diffy

                    Daniel Cheng (Gerrit)

                    unread,
                    Aug 1, 2025, 7:05:23 PM8/1/25
                    to Wangsong Jin, Shunya Shishido, Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                    Attention needed from Alex Moshchuk and Wangsong Jin

                    Daniel Cheng added 1 comment

                    File chrome/browser/chrome_content_browser_client.cc
                    Line 1908, Patchset 90 (Latest): if (renderer_configuration) {
                    Daniel Cheng . unresolved

                    To be very clear: did you test this? My expectation is that we would **not** call `OnRendererProcessLockedStateUpdated()` at all if the process is crashed. I **would** expect it to be called again after the renderer crashes–but only after the renderer is re-created, so the channel would exist. So none of the null checks should be needed, unless i'm missing something.

                    Open in Gerrit

                    Related details

                    Attention is currently required from:
                    • Alex Moshchuk
                    • Wangsong Jin
                    Submit Requirements:
                      • requirement satisfiedCode-Coverage
                      • requirement is not satisfiedCode-Owners
                      • requirement is not satisfiedCode-Review
                      • requirement is not satisfiedNo-Unresolved-Comments
                      Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
                      Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                      Gerrit-Comment-Date: Fri, 01 Aug 2025 23:05:14 +0000
                      Gerrit-HasComments: Yes
                      Gerrit-Has-Labels: No
                      satisfied_requirement
                      unsatisfied_requirement
                      open
                      diffy

                      Wangsong Jin (Gerrit)

                      unread,
                      Aug 1, 2025, 8:06:01 PM8/1/25
                      to Shunya Shishido, Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Daniel Cheng, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                      Attention needed from Alex Moshchuk and Daniel Cheng

                      Wangsong Jin added 1 comment

                      File chrome/browser/chrome_content_browser_client.cc
                      Line 1908, Patchset 90 (Latest): if (renderer_configuration) {
                      Daniel Cheng . resolved

                      To be very clear: did you test this? My expectation is that we would **not** call `OnRendererProcessLockedStateUpdated()` at all if the process is crashed. I **would** expect it to be called again after the renderer crashes–but only after the renderer is re-created, so the channel would exist. So none of the null checks should be needed, unless i'm missing something.

                      Wangsong Jin

                      Yeah, I've tested the renderer crash case. As we reset the `did_update_renderer_locked_state_` flag in `RenderProcessHostImpl::ProcessDied()`. Once after the process is re-created, we will call it again (channel recreated)
                      ```
                      chrome.dll!`anonymous namespace'::GetRendererConfiguration(content::RenderProcessHost * render_process_host) Line 1007 (q:\cr\src\chrome\browser\chrome_content_browser_client.cc:1007)
                      chrome.dll!ChromeContentBrowserClient::OnRendererProcessLockedStateUpdated(content::RenderProcessHost * host, const GURL & site_url) Line 1908 (q:\cr\src\chrome\browser\chrome_content_browser_client.cc:1908)
                      content.dll!content::RenderProcessHostImpl::NotifyRendererOfLockedStateUpdate() Line 3290 (q:\cr\src\content\browser\renderer_host\render_process_host_impl.cc:3290)
                      content.dll!content::RenderProcessHostImpl::OnProcessLaunched() Line 5590 (q:\cr\src\content\browser\renderer_host\render_process_host_impl.cc:5590)
                      content.dll!content::ChildProcessLauncher::Notify(content::internal::ChildProcessLauncherHelper::Process process, unsigned long last_error, int error_code) Line 204 (q:\cr\src\content\browser\child_process_launcher.cc:204)
                      ```
                      So yes, we don't expect the channel/configuration to be nullptr. I removed those checks.

                      Open in Gerrit

                      Related details

                      Attention is currently required from:
                      • Alex Moshchuk
                      • Daniel Cheng
                      Submit Requirements:
                      • requirement satisfiedCode-Coverage
                      • requirement is not satisfiedCode-Owners
                      • requirement is not satisfiedCode-Review
                      Gerrit-Attention: Daniel Cheng <dch...@chromium.org>
                      Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                      Gerrit-Comment-Date: Sat, 02 Aug 2025 00:05:50 +0000
                      Gerrit-HasComments: Yes
                      Gerrit-Has-Labels: No
                      Comment-In-Reply-To: Daniel Cheng <dch...@chromium.org>
                      satisfied_requirement
                      unsatisfied_requirement
                      open
                      diffy

                      Daniel Cheng (Gerrit)

                      unread,
                      Aug 4, 2025, 6:18:36 PM8/4/25
                      to Wangsong Jin, Daniel Cheng, Shunya Shishido, Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                      Attention needed from Alex Moshchuk and Wangsong Jin

                      Daniel Cheng voted and added 1 comment

                      Votes added by Daniel Cheng

                      Code-Review+1

                      1 comment

                      Patchset-level comments
                      Open in Gerrit

                      Related details

                      Attention is currently required from:
                      • Alex Moshchuk
                      • Wangsong Jin
                      Submit Requirements:
                      • requirement satisfiedCode-Coverage
                      • requirement is not satisfiedCode-Owners
                      • requirement is not satisfiedCode-Review
                      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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                      Gerrit-Change-Number: 6373046
                      Gerrit-PatchSet: 91
                      Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
                      Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                      Gerrit-Comment-Date: Mon, 04 Aug 2025 22:18:24 +0000
                      Gerrit-HasComments: Yes
                      Gerrit-Has-Labels: Yes
                      satisfied_requirement
                      unsatisfied_requirement
                      open
                      diffy

                      Wangsong Jin (Gerrit)

                      unread,
                      Aug 4, 2025, 6:38:56 PM8/4/25
                      to Marc Treib, Daniel Cheng, Shunya Shishido, Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                      Attention needed from Alex Moshchuk, Marc Treib and Yoshisato Yanagisawa

                      Wangsong Jin added 1 comment

                      Patchset-level comments
                      Wangsong Jin . resolved

                      Hi folks, could you help to take a look when you get a chance? Thanks!

                      Open in Gerrit

                      Related details

                      Attention is currently required from:
                      • Alex Moshchuk
                      • Marc Treib
                      • Yoshisato Yanagisawa
                      Submit Requirements:
                      • requirement satisfiedCode-Coverage
                      • requirement is not satisfiedCode-Owners
                      • requirement is not satisfiedCode-Review
                      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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                      Gerrit-Change-Number: 6373046
                      Gerrit-PatchSet: 91
                      Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
                      Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
                      Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
                      Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                      Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
                      Gerrit-Reviewer: Jiacheng Guo <g...@google.com>
                      Gerrit-Reviewer: Marc Treib <tr...@chromium.org>
                      Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
                      Gerrit-Reviewer: Shunya Shishido <sisid...@chromium.org>
                      Gerrit-Reviewer: Tibor Goldschwendt <tib...@chromium.org>
                      Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
                      Gerrit-Reviewer: Yoshisato Yanagisawa <yyana...@chromium.org>
                      Gerrit-CC: Andrea Orru <andre...@chromium.org>
                      Gerrit-CC: Charlie Reis <cr...@chromium.org>
                      Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
                      Gerrit-CC: Cliff Smolinsky <clif...@microsoft.com>
                      Gerrit-CC: David Trainor <dtra...@chromium.org>
                      Gerrit-CC: Devlin Cronin <rdevlin...@chromium.org>
                      Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
                      Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
                      Gerrit-CC: Justin Lulejian <jlul...@chromium.org>
                      Gerrit-CC: Liang Zhao <lz...@microsoft.com>
                      Gerrit-CC: Stephen Chenney <sche...@chromium.org>
                      Gerrit-Attention: Yoshisato Yanagisawa <yyana...@chromium.org>
                      Gerrit-Attention: Marc Treib <tr...@chromium.org>
                      Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                      Gerrit-Comment-Date: Mon, 04 Aug 2025 22:38:46 +0000
                      Gerrit-HasComments: Yes
                      Gerrit-Has-Labels: No
                      satisfied_requirement
                      unsatisfied_requirement
                      open
                      diffy

                      Shunya Shishido (Gerrit)

                      unread,
                      Aug 5, 2025, 2:20:34 AM8/5/25
                      to Wangsong Jin, Marc Treib, Daniel Cheng, Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                      Attention needed from Alex Moshchuk, Marc Treib, Wangsong Jin and Yoshisato Yanagisawa

                      Shunya Shishido voted and added 2 comments

                      Votes added by Shunya Shishido

                      Code-Review+1

                      2 comments

                      Patchset-level comments
                      Shunya Shishido . resolved

                      LGTM w/ nit

                      File content/browser/renderer_host/render_process_host_impl.cc
                      Line 3288, Patchset 91 (Latest): // also meant to be aplied once but may currently be updated dynamically.
                      Shunya Shishido . unresolved

                      Please fix this WARNING reported by Spellchecker: "aplied" is a possible misspelling of "applied".

                      To bypass Spellchecker, add a ...

                      "aplied" is a possible misspelling of "applied".

                      To bypass Spellchecker, add a footer with DISABLE_SPELLCHECKER

                      Open in Gerrit

                      Related details

                      Attention is currently required from:
                      • Alex Moshchuk
                      • Marc Treib
                      • Wangsong Jin
                      • Yoshisato Yanagisawa
                      Submit Requirements:
                        • requirement satisfiedCode-Coverage
                        • requirement is not satisfiedCode-Owners
                        • requirement satisfiedCode-Review
                        • requirement is not satisfiedNo-Unresolved-Comments
                        Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
                        Gerrit-Attention: Marc Treib <tr...@chromium.org>
                        Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                        Gerrit-Comment-Date: Tue, 05 Aug 2025 06:20:10 +0000
                        Gerrit-HasComments: Yes
                        Gerrit-Has-Labels: Yes
                        satisfied_requirement
                        unsatisfied_requirement
                        open
                        diffy

                        Marc Treib (Gerrit)

                        unread,
                        Aug 5, 2025, 3:57:31 AM8/5/25
                        to Wangsong Jin, Shunya Shishido, Marc Treib, Daniel Cheng, Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                        Attention needed from Alex Moshchuk, Wangsong Jin and Yoshisato Yanagisawa

                        Marc Treib added 1 comment

                        Patchset-level comments
                        Wangsong Jin . unresolved

                        Hi folks, could you help to take a look when you get a chance? Thanks!

                        Marc Treib

                        Can you please specify what you want me to look at? (I'm in chrome/OWNERS so I own most of the files here, but I'm not the ideal reviewer for many of them.)

                        Open in Gerrit

                        Related details

                        Attention is currently required from:
                        • Alex Moshchuk
                        • Wangsong Jin
                        • Yoshisato Yanagisawa
                        Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                        Gerrit-Comment-Date: Tue, 05 Aug 2025 07:57:16 +0000
                        Gerrit-HasComments: Yes
                        Gerrit-Has-Labels: No
                        Comment-In-Reply-To: Wangsong Jin <wangs...@microsoft.com>
                        satisfied_requirement
                        unsatisfied_requirement
                        open
                        diffy

                        Wangsong Jin (Gerrit)

                        unread,
                        Aug 5, 2025, 1:00:07 PM8/5/25
                        to Shunya Shishido, Marc Treib, Daniel Cheng, Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                        Attention needed from Alex Moshchuk, Marc Treib, Shunya Shishido and Yoshisato Yanagisawa

                        Wangsong Jin added 2 comments

                        Patchset-level comments
                        File-level comment, Patchset 91:
                        Wangsong Jin . resolved

                        Hi folks, could you help to take a look when you get a chance? Thanks!

                        Marc Treib

                        Can you please specify what you want me to look at? (I'm in chrome/OWNERS so I own most of the files here, but I'm not the ideal reviewer for many of them.)

                        Wangsong Jin

                        I see. Could you help look at the following files or areas that might need your input?

                        • chrome/renderer/ chrome_render_frame_observer.cc
                        • chrome/renderer/ chrome_render_thread_observer.h
                        • chrome/renderer/ chrome_render_thread_observer.cc
                        • chrome/renderer/ process_state.h
                        • chrome/renderer/ process_state.cc
                        File content/browser/renderer_host/render_process_host_impl.cc
                        Line 3288, Patchset 91: // also meant to be aplied once but may currently be updated dynamically.
                        Shunya Shishido . resolved

                        Please fix this WARNING reported by Spellchecker: "aplied" is a possible misspelling of "applied".

                        To bypass Spellchecker, add a ...

                        "aplied" is a possible misspelling of "applied".

                        To bypass Spellchecker, add a footer with DISABLE_SPELLCHECKER

                        Wangsong Jin

                        Thx! Fixed typo.

                        Open in Gerrit

                        Related details

                        Attention is currently required from:
                        • Alex Moshchuk
                        • Marc Treib
                        • Shunya Shishido
                        • Yoshisato Yanagisawa
                        Submit Requirements:
                          • requirement satisfiedCode-Coverage
                          • requirement is not satisfiedCode-Owners
                          • requirement is not satisfiedCode-Review
                          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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                          Gerrit-Change-Number: 6373046
                          Gerrit-PatchSet: 92
                          Gerrit-Attention: Shunya Shishido <sisid...@chromium.org>
                          Gerrit-Attention: Marc Treib <tr...@chromium.org>
                          Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                          Gerrit-Comment-Date: Tue, 05 Aug 2025 16:59:54 +0000
                          Gerrit-HasComments: Yes
                          Gerrit-Has-Labels: No
                          Comment-In-Reply-To: Wangsong Jin <wangs...@microsoft.com>
                          Comment-In-Reply-To: Shunya Shishido <sisid...@chromium.org>
                          Comment-In-Reply-To: Marc Treib <tr...@chromium.org>
                          satisfied_requirement
                          unsatisfied_requirement
                          open
                          diffy

                          Marc Treib (Gerrit)

                          unread,
                          Aug 6, 2025, 4:19:28 AM8/6/25
                          to Wangsong Jin, Marc Treib, Shunya Shishido, Daniel Cheng, Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                          Attention needed from Alex Moshchuk, Wangsong Jin and Yoshisato Yanagisawa

                          Marc Treib voted and added 5 comments

                          Votes added by Marc Treib

                          Code-Review+1

                          5 comments

                          Patchset-level comments
                          Wangsong Jin . resolved

                          Hi folks, could you help to take a look when you get a chance? Thanks!

                          Marc Treib

                          Can you please specify what you want me to look at? (I'm in chrome/OWNERS so I own most of the files here, but I'm not the ideal reviewer for many of them.)

                          Wangsong Jin

                          I see. Could you help look at the following files or areas that might need your input?

                          • chrome/renderer/ chrome_render_frame_observer.cc
                          • chrome/renderer/ chrome_render_thread_observer.h
                          • chrome/renderer/ chrome_render_thread_observer.cc
                          • chrome/renderer/ process_state.h
                          • chrome/renderer/ process_state.cc
                          Marc Treib

                          LGTM % nits for these files. I have *not* reviewed the overall change - seems like this has plenty of coverage from the other reviewers.

                          File chrome/renderer/chrome_content_renderer_client.cc
                          Line 1234, Patchset 92 (Latest): chrome_observer_->WaitForProcessReady(base::Seconds(5));
                          Marc Treib . unresolved

                          optional: If there's any question about the timeout duration, you might want to make this a FeatureParam, so it can be configured remotely. See [example](https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_features.h;drc=9f18cc08f11f0d844a9f80af9eb900cd28f76224;l=474) for how to define such a FeatureParam.

                          File chrome/renderer/chrome_render_thread_observer.cc
                          Line 89, Patchset 92 (Latest):void RegisterChromeSearchSchemeDisplayIsolated() {
                          Marc Treib . unresolved

                          `MaybeRegisterChromeSearchSchemeDisplayIsolated`? Since it might or might not actually do it.

                          Line 246, Patchset 92 (Latest): chrome::mojom::StaticParamsPtr params) {
                          // Ensure static renderer configuration parameters are set
                          // once.
                          Marc Treib . unresolved

                          nit: fits on one line

                          Line 251, Patchset 92 (Latest): static_params_ = std::move(params);
                          Marc Treib . unresolved

                          `static_params_` is unused, except for the `CHECK` above - do we really need to store it?
                          If there are no plans to use it, I'd replace it with something like `bool set_configuration_on_process_lock_update_called_` or `bool static_renderer_params_set_`.

                          Open in Gerrit

                          Related details

                          Attention is currently required from:
                          • Alex Moshchuk
                          • Wangsong Jin
                          • Yoshisato Yanagisawa
                          Submit Requirements:
                            • requirement satisfiedCode-Coverage
                            • requirement is not satisfiedCode-Owners
                            • requirement is not satisfiedCode-Review
                            • requirement is not satisfiedNo-Unresolved-Comments
                            Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
                            Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                            Gerrit-Comment-Date: Wed, 06 Aug 2025 08:19:08 +0000
                            Gerrit-HasComments: Yes
                            Gerrit-Has-Labels: Yes
                            Comment-In-Reply-To: Wangsong Jin <wangs...@microsoft.com>
                            Comment-In-Reply-To: Marc Treib <tr...@chromium.org>
                            satisfied_requirement
                            unsatisfied_requirement
                            open
                            diffy

                            Wangsong Jin (Gerrit)

                            unread,
                            Aug 6, 2025, 2:56:03 PM8/6/25
                            to Marc Treib, Shunya Shishido, Daniel Cheng, Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                            Attention needed from Adam Rice, Alex Moshchuk and Yoshisato Yanagisawa

                            Wangsong Jin added 5 comments

                            Patchset-level comments
                            File-level comment, Patchset 93 (Latest):
                            Wangsong Jin . resolved

                            Hi folks, when you get a chance, could you please take a look at the remaining files? Thank you!

                            Add ricea@ for c/r/n:

                            • chrome/renderer/net/net_error_helper.cc
                            • (This file is auto-covered by Treib@, but it would be great if the area owner could review it. The update is minor and only involves the method namespace).

                            Add yyanagisawa@ for service worker histograms:

                            • tools/metrics/histograms/metadata/service/histograms.xml

                            Add alexmos@ for content/:

                            • content/browser/renderer_host/render_process_host_impl.h
                            • content/browser/renderer_host/render_process_host_impl.cc
                            • content/public/browser/content_browser_client.h
                            • content/public/browser/content_browser_client.cc
                            • content/public/renderer/content_renderer_client.h
                            • content/public/renderer/content_renderer_client.cc
                            File chrome/renderer/chrome_content_renderer_client.cc
                            Line 1234, Patchset 92: chrome_observer_->WaitForProcessReady(base::Seconds(5));
                            Marc Treib . resolved

                            optional: If there's any question about the timeout duration, you might want to make this a FeatureParam, so it can be configured remotely. See [example](https://source.chromium.org/chromium/chromium/src/+/main:chrome/common/chrome_features.h;drc=9f18cc08f11f0d844a9f80af9eb900cd28f76224;l=474) for how to define such a FeatureParam.

                            Wangsong Jin

                            Done

                            File chrome/renderer/chrome_render_thread_observer.cc
                            Line 89, Patchset 92:void RegisterChromeSearchSchemeDisplayIsolated() {
                            Marc Treib . resolved

                            `MaybeRegisterChromeSearchSchemeDisplayIsolated`? Since it might or might not actually do it.

                            Wangsong Jin

                            Done

                            Line 246, Patchset 92: chrome::mojom::StaticParamsPtr params) {

                            // Ensure static renderer configuration parameters are set
                            // once.
                            Marc Treib . resolved

                            nit: fits on one line

                            Wangsong Jin

                            Done

                            Line 251, Patchset 92: static_params_ = std::move(params);
                            Marc Treib . resolved

                            `static_params_` is unused, except for the `CHECK` above - do we really need to store it?
                            If there are no plans to use it, I'd replace it with something like `bool set_configuration_on_process_lock_update_called_` or `bool static_renderer_params_set_`.

                            Wangsong Jin

                            Thx! Replaced with `bool static_renderer_params_set_`

                            Open in Gerrit

                            Related details

                            Attention is currently required from:
                            • Adam Rice
                            • Alex Moshchuk
                            • Yoshisato Yanagisawa
                            Submit Requirements:
                            • requirement satisfiedCode-Coverage
                            • requirement is not satisfiedCode-Owners
                            • requirement is not satisfiedCode-Review
                            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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                            Gerrit-Change-Number: 6373046
                            Gerrit-PatchSet: 93
                            Gerrit-Attention: Adam Rice <ri...@chromium.org>
                            Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                            Gerrit-Comment-Date: Wed, 06 Aug 2025 18:55:51 +0000
                            Gerrit-HasComments: Yes
                            Gerrit-Has-Labels: No
                            Comment-In-Reply-To: Marc Treib <tr...@chromium.org>
                            satisfied_requirement
                            unsatisfied_requirement
                            open
                            diffy

                            Alex Moshchuk (Gerrit)

                            unread,
                            Aug 7, 2025, 2:57:04 PM8/7/25
                            to Wangsong Jin, Marc Treib, Shunya Shishido, Daniel Cheng, Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Charlie Reis, Liang Zhao, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                            Attention needed from Adam Rice, Wangsong Jin and Yoshisato Yanagisawa

                            Alex Moshchuk added 2 comments

                            Patchset-level comments
                            Alex Moshchuk . resolved

                            Thanks, happy to see that this is getting close! One question below, otherwise content/ looks good.

                            File content/browser/renderer_host/render_process_host_impl.cc
                            Line 3284, Patchset 93 (Latest):#if !BUILDFLAG(IS_ANDROID)
                            Alex Moshchuk . unresolved

                            Sorry if this was already discussed, but why do we want to gate all the content bits behind !IS_ANDROID? Seems that at least the content/ parts of this are fairly platform-agnostic and something that we'd want on Android too, and if the chrome content client doesn't ever use the instant process on Android, the OnRendererProcessLockedStateUpdated(), etc. can just be a no-op at that layer?

                            Open in Gerrit

                            Related details

                            Attention is currently required from:
                            • Adam Rice
                            • Wangsong Jin
                            • Yoshisato Yanagisawa
                            Submit Requirements:
                              • requirement satisfiedCode-Coverage
                              • requirement is not satisfiedCode-Owners
                              • requirement is not satisfiedCode-Review
                              • requirement is not satisfiedNo-Unresolved-Comments
                              Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
                              Gerrit-Attention: Adam Rice <ri...@chromium.org>
                              Gerrit-Comment-Date: Thu, 07 Aug 2025 18:56:58 +0000
                              Gerrit-HasComments: Yes
                              Gerrit-Has-Labels: No
                              satisfied_requirement
                              unsatisfied_requirement
                              open
                              diffy

                              Liang Zhao (Gerrit)

                              unread,
                              Aug 7, 2025, 5:44:02 PM8/7/25
                              to Wangsong Jin, Marc Treib, Shunya Shishido, Daniel Cheng, Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Charlie Reis, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                              Attention needed from Adam Rice, Wangsong Jin and Yoshisato Yanagisawa

                              Liang Zhao added 1 comment

                              File chrome/browser/chrome_content_browser_client.cc
                              Line 1904, Patchset 95 (Latest):#else // BUILDFLAG(IS_ANDROID)
                              return;
                              Liang Zhao . unresolved

                              probably don't need these. It will return naturally.

                              Open in Gerrit

                              Related details

                              Attention is currently required from:
                              • Adam Rice
                              • Wangsong Jin
                              • Yoshisato Yanagisawa
                              Submit Requirements:
                              • requirement satisfiedCode-Coverage
                              • requirement is not satisfiedCode-Owners
                              • requirement is not satisfiedCode-Review
                              • requirement is not satisfiedNo-Unresolved-Comments
                              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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                              Gerrit-Change-Number: 6373046
                              Gerrit-PatchSet: 95
                              Gerrit-Comment-Date: Thu, 07 Aug 2025 21:43:49 +0000
                              Gerrit-HasComments: Yes
                              Gerrit-Has-Labels: No
                              satisfied_requirement
                              unsatisfied_requirement
                              open
                              diffy

                              Wangsong Jin (Gerrit)

                              unread,
                              Aug 7, 2025, 5:52:14 PM8/7/25
                              to Marc Treib, Shunya Shishido, Daniel Cheng, Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Charlie Reis, Liang Zhao, Alex Moshchuk, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                              Attention needed from Adam Rice, Alex Moshchuk, Liang Zhao and Yoshisato Yanagisawa

                              Wangsong Jin added 2 comments

                              File chrome/browser/chrome_content_browser_client.cc
                              Line 1904, Patchset 95:#else // BUILDFLAG(IS_ANDROID)
                              return;
                              Liang Zhao . resolved

                              probably don't need these. It will return naturally.

                              Wangsong Jin

                              Done

                              File content/browser/renderer_host/render_process_host_impl.cc
                              Line 3284, Patchset 93:#if !BUILDFLAG(IS_ANDROID)
                              Alex Moshchuk . resolved

                              Sorry if this was already discussed, but why do we want to gate all the content bits behind !IS_ANDROID? Seems that at least the content/ parts of this are fairly platform-agnostic and something that we'd want on Android too, and if the chrome content client doesn't ever use the instant process on Android, the OnRendererProcessLockedStateUpdated(), etc. can just be a no-op at that layer?

                              Wangsong Jin

                              Thanks! There wasn’t a strong preference around this. We made the change primarily for code readability—excluding Android made the flow easier to understand, as Android doesn’t involve the instant process. But considering that the content/ parts might be useful for Android in the future, it makes sense to include Android. I’ve updated both OnRendererProcessLockedStateUpdated() and WaitForProcessReady() to be defined across all platforms, with no-op implementations for Android.

                              Open in Gerrit

                              Related details

                              Attention is currently required from:
                              • Adam Rice
                              • Alex Moshchuk
                              • Liang Zhao
                              • Yoshisato Yanagisawa
                              Submit Requirements:
                              • requirement satisfiedCode-Coverage
                              • requirement is not satisfiedCode-Owners
                              • requirement is not satisfiedCode-Review
                              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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                              Gerrit-Change-Number: 6373046
                              Gerrit-PatchSet: 96
                              Gerrit-Attention: Liang Zhao <lz...@microsoft.com>
                              Gerrit-Attention: Adam Rice <ri...@chromium.org>
                              Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                              Gerrit-Comment-Date: Thu, 07 Aug 2025 21:52:02 +0000
                              Gerrit-HasComments: Yes
                              Gerrit-Has-Labels: No
                              satisfied_requirement
                              unsatisfied_requirement
                              open
                              diffy

                              Alex Moshchuk (Gerrit)

                              unread,
                              Aug 7, 2025, 6:59:38 PM8/7/25
                              to Wangsong Jin, Marc Treib, Shunya Shishido, Daniel Cheng, Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Charlie Reis, Liang Zhao, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                              Attention needed from Adam Rice, Wangsong Jin and Yoshisato Yanagisawa

                              Alex Moshchuk voted and added 1 comment

                              Votes added by Alex Moshchuk

                              Code-Review+1

                              1 comment

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

                              Thanks! content/ LGTM

                              Open in Gerrit

                              Related details

                              Attention is currently required from:
                              • Adam Rice
                              • Wangsong Jin
                              • Yoshisato Yanagisawa
                              Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
                              Gerrit-Attention: Adam Rice <ri...@chromium.org>
                              Gerrit-Comment-Date: Thu, 07 Aug 2025 22:59:30 +0000
                              Gerrit-HasComments: Yes
                              Gerrit-Has-Labels: Yes
                              satisfied_requirement
                              unsatisfied_requirement
                              open
                              diffy

                              Wangsong Jin (Gerrit)

                              unread,
                              Aug 7, 2025, 7:13:38 PM8/7/25
                              to Takashi Toyoshima, Alex Moshchuk, Marc Treib, Shunya Shishido, Daniel Cheng, Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Charlie Reis, Liang Zhao, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                              Attention needed from Adam Rice, Takashi Toyoshima and Yoshisato Yanagisawa

                              Wangsong Jin added 1 comment

                              Patchset-level comments
                              Wangsong Jin . resolved

                              Hi toyoshim@, Could you help to take a look below service worker histogram change when you have time? Thank you!

                              • tools/metrics/histograms/metadata/service/histograms.xml
                              Open in Gerrit

                              Related details

                              Attention is currently required from:
                              • Adam Rice
                              • Takashi Toyoshima
                              • Yoshisato Yanagisawa
                              Submit Requirements:
                              • requirement satisfiedCode-Coverage
                              • requirement is not satisfiedCode-Owners
                              • requirement is not satisfiedCode-Review
                              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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                              Gerrit-Change-Number: 6373046
                              Gerrit-PatchSet: 96
                              Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
                              Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
                              Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
                              Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                              Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
                              Gerrit-Reviewer: Jiacheng Guo <g...@google.com>
                              Gerrit-Reviewer: Marc Treib <tr...@chromium.org>
                              Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
                              Gerrit-Reviewer: Shunya Shishido <sisid...@chromium.org>
                              Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
                              Gerrit-Reviewer: Tibor Goldschwendt <tib...@chromium.org>
                              Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
                              Gerrit-Reviewer: Yoshisato Yanagisawa <yyana...@chromium.org>
                              Gerrit-CC: Andrea Orru <andre...@chromium.org>
                              Gerrit-CC: Charlie Reis <cr...@chromium.org>
                              Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
                              Gerrit-CC: Cliff Smolinsky <clif...@microsoft.com>
                              Gerrit-CC: David Trainor <dtra...@chromium.org>
                              Gerrit-CC: Devlin Cronin <rdevlin...@chromium.org>
                              Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
                              Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
                              Gerrit-CC: Justin Lulejian <jlul...@chromium.org>
                              Gerrit-CC: Liang Zhao <lz...@microsoft.com>
                              Gerrit-CC: Stephen Chenney <sche...@chromium.org>
                              Gerrit-Attention: Yoshisato Yanagisawa <yyana...@chromium.org>
                              Gerrit-Attention: Adam Rice <ri...@chromium.org>
                              Gerrit-Attention: Takashi Toyoshima <toyo...@chromium.org>
                              Gerrit-Comment-Date: Thu, 07 Aug 2025 23:13:22 +0000
                              Gerrit-HasComments: Yes
                              Gerrit-Has-Labels: No
                              satisfied_requirement
                              unsatisfied_requirement
                              open
                              diffy

                              Robert Liao (Gerrit)

                              unread,
                              Aug 7, 2025, 8:07:34 PM8/7/25
                              to Wangsong Jin, Keren Zhu, Takashi Toyoshima, Alex Moshchuk, Marc Treib, Shunya Shishido, Daniel Cheng, Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Charlie Reis, Liang Zhao, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                              Attention needed from Keren Zhu, Takashi Toyoshima, Wangsong Jin and Yoshisato Yanagisawa

                              Robert Liao added 1 comment

                              Patchset-level comments
                              Robert Liao . resolved

                              Adding kerenzhu as a starting point for the spare renderer.

                              Open in Gerrit

                              Related details

                              Attention is currently required from:
                              • Keren Zhu
                              • Takashi Toyoshima
                              • Wangsong Jin
                              • Yoshisato Yanagisawa
                              Submit Requirements:
                              • requirement satisfiedCode-Coverage
                              • requirement is not satisfiedCode-Owners
                              • requirement is not satisfiedCode-Review
                              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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                              Gerrit-Change-Number: 6373046
                              Gerrit-PatchSet: 96
                              Gerrit-Owner: Wangsong Jin <wangs...@microsoft.com>
                              Gerrit-Reviewer: Adam Rice <ri...@chromium.org>
                              Gerrit-Reviewer: Alex Moshchuk <ale...@chromium.org>
                              Gerrit-Reviewer: Daniel Cheng <dch...@chromium.org>
                              Gerrit-Reviewer: Frank Liberato <libe...@chromium.org>
                              Gerrit-Reviewer: Jiacheng Guo <g...@google.com>
                              Gerrit-Reviewer: Keren Zhu <kere...@chromium.org>
                              Gerrit-Reviewer: Marc Treib <tr...@chromium.org>
                              Gerrit-Reviewer: Reilly Grant <rei...@chromium.org>
                              Gerrit-Reviewer: Shunya Shishido <sisid...@chromium.org>
                              Gerrit-Reviewer: Takashi Toyoshima <toyo...@chromium.org>
                              Gerrit-Reviewer: Tibor Goldschwendt <tib...@chromium.org>
                              Gerrit-Reviewer: Wangsong Jin <wangs...@microsoft.com>
                              Gerrit-Reviewer: Yoshisato Yanagisawa <yyana...@chromium.org>
                              Gerrit-CC: Andrea Orru <andre...@chromium.org>
                              Gerrit-CC: Charlie Reis <cr...@chromium.org>
                              Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
                              Gerrit-CC: Cliff Smolinsky <clif...@microsoft.com>
                              Gerrit-CC: David Trainor <dtra...@chromium.org>
                              Gerrit-CC: Devlin Cronin <rdevlin...@chromium.org>
                              Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
                              Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
                              Gerrit-CC: Justin Lulejian <jlul...@chromium.org>
                              Gerrit-CC: Liang Zhao <lz...@microsoft.com>
                              Gerrit-CC: Robert Liao <rob...@chromium.org>
                              Gerrit-CC: Stephen Chenney <sche...@chromium.org>
                              Gerrit-Attention: Yoshisato Yanagisawa <yyana...@chromium.org>
                              Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
                              Gerrit-Attention: Keren Zhu <kere...@chromium.org>
                              Gerrit-Attention: Takashi Toyoshima <toyo...@chromium.org>
                              Gerrit-Comment-Date: Fri, 08 Aug 2025 00:07:18 +0000
                              Gerrit-HasComments: Yes
                              Gerrit-Has-Labels: No
                              satisfied_requirement
                              unsatisfied_requirement
                              open
                              diffy

                              Takashi Toyoshima (Gerrit)

                              unread,
                              Aug 8, 2025, 5:40:33 AM8/8/25
                              to Wangsong Jin, Keren Zhu, Robert Liao, Alex Moshchuk, Marc Treib, Shunya Shishido, Daniel Cheng, Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Charlie Reis, Liang Zhao, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                              Attention needed from Keren Zhu, Wangsong Jin and Yoshisato Yanagisawa

                              Takashi Toyoshima added 10 comments

                              File base/threading/thread_restrictions.h
                              Line 858, Patchset 96 (Latest): friend class ::ChromeContentRendererClient;
                              Takashi Toyoshima . unresolved

                              nit: Should this be after the `::BrowserProcessImpl` at the line 835?

                              File chrome/renderer/chrome_content_renderer_client.cc
                              Line 1222, Patchset 96 (Latest):void ChromeContentRendererClient::WaitForProcessReady() {
                              Takashi Toyoshima . unresolved

                              This method is defined as a content public API, and there is no guarantee that this should be called by ServiceWorker renderers.
                              So, having this assumption here seems strange, and can be wrong easily?

                              Line 1233, Patchset 96 (Latest): bool ready_within_timeout =
                              chrome_observer_->WaitForProcessReady(base::Seconds(5));
                              Takashi Toyoshima . unresolved

                              Should we call this always? (regardless of the `process_was_ready` check result?


                              << "ServiceWorker.InitiatorThread: Process ready wait time took "
                              "more than 5 seconds for "
                              << (is_extension ? "extension" : "regular") << " process";
                              Takashi Toyoshima . unresolved

                              This is one part that has an assumption for the caller.
                              I'm not sure this log is useful for debugging or investigation.
                              Instead, how about using the SCOPED_CRASH_KEY_BOOL macro to ensure this check result is included in the dump report?
                              Otherwise, you may remove the "ServiceWorker.InitiatorThreaad" prefix in the log.

                              Line 1247, Patchset 96 (Latest): base::TimeDelta wait_duration = base::TimeTicks::Now() - start_time;
                              base::UmaHistogramBoolean(is_extension
                              ? "ServiceWorker.InitiatorThread."
                              "ProcessReadyWaitRequired.ExtensionProcess"
                              : "ServiceWorker.InitiatorThread."
                              "ProcessReadyWaitRequired.RegularProcess",
                              !process_was_ready);
                              base::UmaHistogramTimes(is_extension
                              ? "ServiceWorker.InitiatorThread."
                              "WaitTimeForProcessReady.ExtensionProcess"
                              : "ServiceWorker.InitiatorThread."
                              "WaitTimeForProcessReady.RegularProcess",
                              wait_duration);
                              Takashi Toyoshima . unresolved

                              This is the second part, and I think we want to report this in the call site, content/renderer/service_worker/embedded_worker_instance_client_impl.cc

                              We may return `!process_was_ready` if we want the ProcessReadyWaitRequired.

                              File chrome/renderer/process_state.cc
                              Line 13, Patchset 96 (Latest):bool g_is_instant_process = false;
                              Takashi Toyoshima . unresolved

                              Is it possible to have this as optional<bool>, and have CHECK(g_is_instance_process.has_value()) in IsInstantProcess?

                              File content/browser/renderer_host/render_process_host_impl.cc
                              Line 3286, Patchset 96 (Latest): // TODO: http://crbug.com/434735272 — Handle other settings that are
                              Takashi Toyoshima . unresolved
                              File tools/metrics/histograms/metadata/service/histograms.xml
                              Line 651, Patchset 96 (Latest): Whether a service worker thread start required waiting for the corresponding
                              Takashi Toyoshima . unresolved

                              https://chromium.googlesource.com/chromium/src/tools/+/refs/heads/main/metrics/histograms/README.md#State-When-It-Is-Recorded

                              Can we also state when this is recorded?
                              The sentence contains `when ...`, but it's more like a condition, but we want timing information, i.e. when a new renderer process starts for SW.

                              Line 658, Patchset 96 (Latest): <variant name="ExtensionProcess" summary="extension renderer processes"/>
                              Takashi Toyoshima . unresolved

                              summary is defined, but not used?
                              fyi, If you embed {ProcessType} in the summary tag's document, this attribute value is expanded there. So, combined with my previous comment, you can use this like, e.g.
                              ```
                              ...
                              This metric is emitted when a {ProcessType} is created for a Service Worker.
                              ```

                              Line 673, Patchset 96 (Latest): than regular processes.
                              Takashi Toyoshima . unresolved

                              ditto

                              Open in Gerrit

                              Related details

                              Attention is currently required from:
                              • Keren Zhu
                              • Wangsong Jin
                              • Yoshisato Yanagisawa
                              Submit Requirements:
                                • requirement satisfiedCode-Coverage
                                • requirement is not satisfiedCode-Owners
                                • requirement is not satisfiedCode-Review
                                • requirement is not satisfiedNo-Unresolved-Comments
                                Gerrit-Comment-Date: Fri, 08 Aug 2025 09:40:00 +0000
                                Gerrit-HasComments: Yes
                                Gerrit-Has-Labels: No
                                satisfied_requirement
                                unsatisfied_requirement
                                open
                                diffy

                                Liang Zhao (Gerrit)

                                unread,
                                Aug 8, 2025, 7:23:35 PM8/8/25
                                to Wangsong Jin, Keren Zhu, Robert Liao, Takashi Toyoshima, Alex Moshchuk, Marc Treib, Shunya Shishido, Daniel Cheng, Andrea Orru, Justin Lulejian, Devlin Cronin, Jiacheng Guo, Chromium Metrics Reviews, Yoshisato Yanagisawa, Dirk Schulze, Stephen Chenney, Hiroki Nakagawa, Tibor Goldschwendt, David Trainor, Cliff Smolinsky, Reilly Grant, Adam Rice, AyeAye, Charlie Reis, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, jmedle...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, fmalit...@chromium.org, drott+bl...@chromium.org, shimazu+se...@chromium.org, horo+...@chromium.org, servicewor...@chromium.org, kinuko+ser...@chromium.org, blink-work...@chromium.org, net-r...@chromium.org, feature-me...@chromium.org, eme-r...@chromium.org, ajwong...@chromium.org, alexmo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, chromium-a...@chromium.org, creis...@chromium.org, extension...@chromium.org, ipc-securi...@chromium.org, kinuko...@chromium.org, navigation...@chromium.org, ntp-dev...@chromium.org
                                Attention needed from Alex Moshchuk, Keren Zhu and Wangsong Jin

                                Liang Zhao added 1 comment

                                File tools/metrics/histograms/metadata/renderer/histograms.xml
                                Line 553, Patchset 97 (Latest): ready. Currently, service worker thread start required waiting for the
                                corresponding renderer process to become ready. Records true when security
                                Liang Zhao . unresolved

                                Should we remove these statements. The statements below already explains that it is currently only useful for service worker startup.

                                Open in Gerrit

                                Related details

                                Attention is currently required from:
                                • Alex Moshchuk
                                • Keren Zhu
                                • Wangsong Jin
                                Submit Requirements:
                                • requirement satisfiedCode-Coverage
                                • requirement is not satisfiedCode-Owners
                                • requirement is not satisfiedCode-Review
                                • requirement is not satisfiedNo-Unresolved-Comments
                                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: Ib7c3a7ca1bedae9174cd415e313ef43cfaf06b7a
                                Gerrit-Change-Number: 6373046
                                Gerrit-PatchSet: 97
                                Gerrit-Attention: Wangsong Jin <wangs...@microsoft.com>
                                Gerrit-Attention: Keren Zhu <kere...@chromium.org>
                                Gerrit-Attention: Alex Moshchuk <ale...@chromium.org>
                                Gerrit-Comment-Date: Fri, 08 Aug 2025 23:23:20 +0000
                                Gerrit-HasComments: Yes
                                Gerrit-Has-Labels: No
                                satisfied_requirement
                                unsatisfied_requirement
                                open
                                diffy
                                It is loading more messages.
                                0 new messages