SendProcessMessage message not recieved after process switch

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

SendProcessMessage message not recieved after process switch

Postby amaitland » Mon Jan 01, 2018 9:56 pm

After upgrading to 3239 I'm seeing problems with CefBrowser::SendProcessMessage when called from the render process

I'm sending a message from the render process to browser process when OnContextCreated is called, the problem occurs when the render process switches (change of domain), `CefRenderProcessHandler::OnContextCreated` is called, the message is sent, just never received by the browser process. If I call `CefBrowser::Reload` the message is sent and received successfully. Was working in previous 3202 branch, just not in the 3239. I see changes were made in https://bitbucket.org/chromiumembedded/ ... 84?at=3239 and I'm wondering if additional changes are required?

Tested with:
CEF 3.3239.1716.g735b746 - Not received
CEF 3.3239.1705.gf6d6dfc - Not received
CEF 3.3202.1686.gd665578 - Message received

Also seeing messages from the browser process being sent to the old render process when a process switch occurs, this isn't a new behavior and I'm guessing it's likely hard to fix, just mentioning incase it's possible.

Let me know if additional info is required.
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1291
Joined: Wed Jan 14, 2015 2:35 am

Re: SendProcessMessage message not recieved after process sw

Postby amaitland » Tue Jan 02, 2018 2:21 am

With default logging I'm seeing the following warning, which doesn't seem related.

Code: Select all
[0102/165056.514:WARNING:angle_platform_impl.cc(51)] rx::HLSLCompiler::compileToBinary(228):
C:\fakepath(49,8-56): warning X3571: pow(f, e) will not work for negative f, use abs(f) or conditionally handle negative values if you expect them
C:\fakepath(55,8-26): warning X3571: pow(f, e) will not work for negative f, use abs(f) or conditionally handle negative values if you expect them


Will update the log level to `Verbose` and post any relevant parts when I have a minute.
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1291
Joined: Wed Jan 14, 2015 2:35 am

Re: SendProcessMessage message not recieved after process sw

Postby magreenblatt » Tue Jan 02, 2018 1:52 pm

Are you saying that process messages sent from CefRenderProcessHandler::OnContextCreated after a cross-origin navigation are never received by CefClient::OnProcessMessageReceived?
magreenblatt
Site Admin
 
Posts: 12407
Joined: Fri May 29, 2009 6:57 pm

Re: SendProcessMessage message not recieved after process sw

Postby amaitland » Tue Jan 02, 2018 4:46 pm

Yes, a much more concise summary, thanks.

Reproduces reliably in CefSharp. What was working doesn't after the branch upgrade.

Any additional information that would be helpful?
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1291
Joined: Wed Jan 14, 2015 2:35 am

Re: SendProcessMessage message not recieved after process sw

Postby magreenblatt » Tue Jan 02, 2018 5:01 pm

There have been a number of navigation-related changes recently in Chromium that might account for this behavior change, but it still sounds like a bug to me. Please add an issue.
magreenblatt
Site Admin
 
Posts: 12407
Joined: Fri May 29, 2009 6:57 pm

Re: SendProcessMessage message not recieved after process sw

Postby amaitland » Mon Apr 01, 2019 6:56 am

Revisiting this and I'm still able to reproduce the problem with `cef_binary_73.1.12+gee4b49f+chromium-73.0.3683.75_windows32`

Works as expected in `cef_binary_3.3202.1694.gf061c23_windows32`.

Only basic changes required to reproduce the problem with `cefclient`
Code: Select all
void OnContextCreated(CefRefPtr<ClientAppRenderer> app,
   CefRefPtr<CefBrowser> browser,
   CefRefPtr<CefFrame> frame,
   CefRefPtr<CefV8Context> context) OVERRIDE {
   message_router_->OnContextCreated(browser, frame, context);

   browser->SendProcessMessage(CefProcessId::PID_BROWSER,
      CefProcessMessage::Create("OnContextCreated"));
}


Code: Select all
bool ClientHandler::OnProcessMessageReceived(
   CefRefPtr<CefBrowser> browser,
   CefProcessId source_process,
   CefRefPtr<CefProcessMessage> message) {
   CEF_REQUIRE_UI_THREAD();

   if (message->GetName() == "OnContextCreated") {
      LOG(INFO) << "OnContextCreated - Message from Render Process.";
      return true;
   }
}


Will open an issue tomorrow unless there's an objection. Please let me know if there's any additional information that's required.
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1291
Joined: Wed Jan 14, 2015 2:35 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 27 guests