accessing preference setting from RenderProcessHostImpl

45 views
Skip to first unread message

Guo-wei Shieh

unread,
Aug 10, 2015, 6:00:48 PM8/10/15
to chromium-dev
Hi,

I want to access users preference to change some behavior of RenderProcessHostImpl (content). More specifically, I want to change the bahvior of P2PSocketDispatchHost which is a member of RPHI. Preference (and Profile) live in chrome/browser so it can't be included by content directly.

It seems that I have 2 ways to go about this.

1. RenderViewHostImpl has access to Preference. I could get the value from RenderViewHostImpl and set it to RenderProcessHostImpl everytime I have a new RenderViewHost. However, it's a 1:N relationship b/w RenderProcessHost to RenderViewHost though. (This is effectively getting it from WebContentsImpl)

2. I could also use content_browser_client.h which allows embedder like chrome to provide info to RenderProcessHostImpl.

Is there any preference which way I do this? 
Or, is there any better way? 

Thanks,
Guowei

Avi Drissman

unread,
Aug 10, 2015, 6:21:47 PM8/10/15
to guo...@chromium.org, chromium-dev, John Abd-El-Malek
+jam

What kind of behavior change were you thinking of?

Avi

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev

Guo-wei Shieh

unread,
Aug 10, 2015, 6:26:00 PM8/10/15
to Avi Drissman, chromium-dev, John Abd-El-Malek
1. When users choose to use defualt route only (by setting an existing preference webrtc:enable_multiple_routes to false), I want to make sure only no real interface information is passed by P2PSocketDispatcherHost to renderer process. 
2. When users choose not to use UDP through a new preference I'm adding (as it could leak their IP address when using proxy), I'd like to stop all UDP socket creation and the DNS resolution inside P2PSocketDispatcherHost.

Thanks,
Guowei

Avi Drissman

unread,
Aug 10, 2015, 6:41:06 PM8/10/15
to Guo-wei Shieh, chromium-dev, John Abd-El-Malek
These sounds like highly-technical things, and there's no way we can expose those to users and expect them to make a meaningful choice.

Guo-wei Shieh

unread,
Aug 10, 2015, 6:42:48 PM8/10/15
to Avi Drissman, chromium-dev, John Abd-El-Malek
I agree. The approach is not to expose it through UI. We're exposing it to the preference API so we could publish extension to modify it on behalf of users. The extension itself will have the explanation on what it is and the tradeoff. 

John Abd-El-Malek

unread,
Aug 10, 2015, 6:52:42 PM8/10/15
to Guo-wei Shieh, Avi Drissman, chromium-dev
On Mon, Aug 10, 2015 at 3:25 PM, Guo-wei Shieh <guo...@chromium.org> wrote:
1. When users choose to use defualt route only (by setting an existing preference webrtc:enable_multiple_routes to false), I want to make sure only no real interface information is passed by P2PSocketDispatcherHost to renderer process. 
2. When users choose not to use UDP through a new preference I'm adding (as it could leak their IP address when using proxy), I'd like to stop all UDP socket creation and the DNS resolution inside P2PSocketDispatcherHost.

Thanks,
Guowei

On Mon, Aug 10, 2015 at 3:20 PM, Avi Drissman <a...@chromium.org> wrote:
+jam

What kind of behavior change were you thinking of?

Avi

On Mon, Aug 10, 2015 at 5:59 PM, Guo-wei Shieh <guo...@chromium.org> wrote:
Hi,

I want to access users preference to change some behavior of RenderProcessHostImpl (content). More specifically, I want to change the bahvior of P2PSocketDispatchHost which is a member of RPHI. Preference (and Profile) live in chrome/browser so it can't be included by content directly.

It seems that I have 2 ways to go about this.

1. RenderViewHostImpl has access to Preference. I could get the value from RenderViewHostImpl and set it to RenderProcessHostImpl everytime I have a new RenderViewHost. However, it's a 1:N relationship b/w RenderProcessHost to RenderViewHost though. (This is effectively getting it from WebContentsImpl)

Where is the code that will ultimately check these two settings? i.e. do they have a RenderViewHost or RenderView that they can get this setting from?
 

2. I could also use content_browser_client.h which allows embedder like chrome to provide info to RenderProcessHostImpl.

For two booleans like this, generally we use RendererPreferences.

Guo-wei Shieh

unread,
Aug 10, 2015, 7:00:30 PM8/10/15
to John Abd-El-Malek, Avi Drissman, chromium-dev
On Mon, Aug 10, 2015 at 3:51 PM, John Abd-El-Malek <j...@chromium.org> wrote:


On Mon, Aug 10, 2015 at 3:25 PM, Guo-wei Shieh <guo...@chromium.org> wrote:
1. When users choose to use defualt route only (by setting an existing preference webrtc:enable_multiple_routes to false), I want to make sure only no real interface information is passed by P2PSocketDispatcherHost to renderer process. 
2. When users choose not to use UDP through a new preference I'm adding (as it could leak their IP address when using proxy), I'd like to stop all UDP socket creation and the DNS resolution inside P2PSocketDispatcherHost.

Thanks,
Guowei

On Mon, Aug 10, 2015 at 3:20 PM, Avi Drissman <a...@chromium.org> wrote:
+jam

What kind of behavior change were you thinking of?

Avi

On Mon, Aug 10, 2015 at 5:59 PM, Guo-wei Shieh <guo...@chromium.org> wrote:
Hi,

I want to access users preference to change some behavior of RenderProcessHostImpl (content). More specifically, I want to change the bahvior of P2PSocketDispatchHost which is a member of RPHI. Preference (and Profile) live in chrome/browser so it can't be included by content directly.

It seems that I have 2 ways to go about this.

1. RenderViewHostImpl has access to Preference. I could get the value from RenderViewHostImpl and set it to RenderProcessHostImpl everytime I have a new RenderViewHost. However, it's a 1:N relationship b/w RenderProcessHost to RenderViewHost though. (This is effectively getting it from WebContentsImpl)

Where is the code that will ultimately check these two settings? i.e. do they have a RenderViewHost or RenderView that they can get this setting from?
The code is here and it doesn't have a RenderViewHost to get this. The object is a member of RenderProcessHostImpl. 
 
 

2. I could also use content_browser_client.h which allows embedder like chrome to provide info to RenderProcessHostImpl.

For two booleans like this, generally we use RendererPreferences.
Yes, that's my plan too but to get the RendererProferences in the place I need it (inside RPHI), I'll need to do either way of these 2 approaches. Hence the question here. 
Reply all
Reply to author
Forward
0 new messages