Discussion:
[chromium-dev] Is it possible to IPC with a RenderFrameHost via a RenderFrameProxy?
Demetrios Tsillas
2018-11-15 18:38:23 UTC
Permalink
Hello,

I have a component which runs in the renderer and spends most of its time
handling frame events.

This component needs access to the main frame, so if the event happens to
be for a sub frame, the component will walk up the parent tree until it
finds its main frame and use a little bit of state from that main frame.

This worked fine for all cases until recently when the site isolation was
turned on. Now, for third party sub frames, I find that walking up the
parent tree gets me to a non-local frame.

So I am trying to implement some IPC code which will move that state I need
from the WebLocalFrame to its associated RenderFrameHost in the browser.

Then I will use another IPC to get that state via a synchronous message.
This is the IPC which is giving me trouble.

I use the RenderFrameProxy, accessed via the client, of the WebRemoteFrame
to Send my new synchronous IPC. But it appears this IPC does not go to the
RenderProcessHost accociated with the WebRemoteFrame. Instead it goes to
the RenderProcessHost of the local child frame. When the wrong
RenderProcessHost sees the message it cannot find the listener for the
given routing_id and the message is not handled.

Two questions:

*Is there something I can do here so that the message will go to the
correct RenderProcessHost?*

very speculative second question:

*Is it possible to IPC directly between renderer processes?*

thanks!!!
-Jim.
--
--
Chromium Developers mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+***@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/a526bdc1-2f17-4df5-aae6-90851624c938%40chromium.org.
Lucas Gadani
2018-11-16 01:47:14 UTC
Permalink
Post by Demetrios Tsillas
Hello,
I have a component which runs in the renderer and spends most of its time
handling frame events.
This component needs access to the main frame, so if the event happens to
be for a sub frame, the component will walk up the parent tree until it
finds its main frame and use a little bit of state from that main frame.
This worked fine for all cases until recently when the site isolation was
turned on. Now, for third party sub frames, I find that walking up the
parent tree gets me to a non-local frame.
So I am trying to implement some IPC code which will move that state I
need from the WebLocalFrame to its associated RenderFrameHost in the
browser.
Then I will use another IPC to get that state via a synchronous message.
This is the IPC which is giving me trouble.
I use the RenderFrameProxy, accessed via the client, of the WebRemoteFrame
to Send my new synchronous IPC. But it appears this IPC does not go to the
RenderProcessHost accociated with the WebRemoteFrame. Instead it goes to
the RenderProcessHost of the local child frame. When the wrong
RenderProcessHost sees the message it cannot find the listener for the
given routing_id and the message is not handled.
*Is there something I can do here so that the message will go to the
correct RenderProcessHost?*
In general you send the message via the RenderFrameProxy up to the
RenderFrameProxyHost, which can find the correct RenderFrameHost via the
FrameTreeNode. See for example how postmessage between frames handles this:
https://cs.chromium.org/chromium/src/content/browser/frame_host/render_frame_proxy_host.cc?l=343
Post by Demetrios Tsillas
*Is it possible to IPC directly between renderer processes?*
In general, yes, though you should be careful when doing that. This can be
accomplished by passing a mojo interface from the browser to both renderers.
--
--
Chromium Developers mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+***@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAEgCuoErB2Eh1Xq360vFLCD8WMqAkv2Zg%2B3b8MZiQ3qrt4ZD3A%40mail.gmail.com.
Loading...