One of my IPC message not being received after I moved code around

27 views
Skip to first unread message

Demetrios Tsillas

unread,
Jul 26, 2016, 10:22:59 AM7/26/16
to Chromium-dev
The code I am working on adds to CONTROL IPC messages.

Previously these messages were defined in render_messages.h and I was able to send and receive both messages.

One of the messages is send from the browser to a newly created renderer using a RenderProcessHost to send the message which is received using a RenderThreadObserver::OnControlMessageReceived. This message still works after I moved the code.

The second message is sent from a renderer to the browser. The sender uses a RenderView to send the message and the receiver uses a BrowserMessageFilter.
This message no longer is being received after my modification.

The modification was to move the message IPC definitions from render_message.h to their own file. I also defined a new MsgStart enum for the new file. I followed the pattern I saw being used for other messages. I added my new message header file to chrome/common/common_message_generator.h.

I tried CHROME_IPC_LOGGING=1 and I see the working message but I don't see the message which is not being received.

I tried running chrome under Ubuntu/gdb but have had little luck in getting gdb to run on the renderer. Something seems to SIGTERM it after it starts. I'm hoping there's some other way to debug this other than reading many files of code.

thanks!!!
-Jim.

Avi Drissman

unread,
Jul 26, 2016, 10:34:08 AM7/26/16
to Demetrios Tsillas, Chromium-dev
My immediate thought is that if you moved the message to a new message class, you may need to make sure you're overriding the GetSupportedMessageClasses() function in the filter to return the new class of messages.

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

Demetrios Tsillas

unread,
Jul 26, 2016, 10:40:56 AM7/26/16
to Chromium-dev, jtsi...@gmail.com
I am not, nor was I in the past. I simply call host->AddFilter(...) in ChromeContentBrowserClient::RenderProcessWillLaunch. Can you provide an example in the code of how GetSupportedMessageClasses should be use? It seemed to be working previously without having to do this.

Avi Drissman

unread,
Jul 26, 2016, 10:48:30 AM7/26/16
to Demetrios Tsillas, Chromium-dev
It's an override in MessageFilter. If you don't override it then you're fine and the issue is elsewhere. But make sure you check in your MessageFilter to see.

Avi

Demetrios Tsillas

unread,
Jul 26, 2016, 10:50:46 AM7/26/16
to Chromium-dev, jtsi...@gmail.com
OK, I found the problem. My constructor for BrowserMessageFilter was still using the ChromeMsgStart enum. Thanks!!!

Avi Drissman

unread,
Jul 26, 2016, 11:06:10 AM7/26/16
to Demetrios Tsillas, Chromium-dev
Happy to help. That bit me a while back, so I couldn't forget.

Avi
Reply all
Reply to author
Forward
0 new messages