New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 798712 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Last visit > 30 days ago
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Convert prerender_messages.h to mojom

Project Member Reported by cm.san...@samsung.com, Jan 3 2018

Issue description

This is a tracking bug to eliminate legacy prerender_messages.h and convert to mojom
 

Comment 1 Deleted

@dominickn,

I tried to convert "PrerenderMsg_SetIsPrerendering" dispatcher message but could see 3 listeners. Do I need to register mojom services for all? Plz suggest.

src/chrome/common/prerender_messages.h	 (1 occurrence)
     61 IPC_MESSAGE_ROUTED1(PrerenderMsg_SetIsPrerendering, prerender::PrerenderMode)

References (5 occurrences)
		src/chrome/browser/prerender/prerender_contents.cc	 (2 occurrences)
    540 render_frame_host->Send(new PrerenderMsg_SetIsPrerendering(
    742 new PrerenderMsg_SetIsPrerendering(MSG_ROUTING_NONE, NO_PRERENDER));



Listeners:
----------------
		src/chrome/renderer/chrome_render_frame_observer.cc	 (1 occurrence)
    164 IPC_MESSAGE_HANDLER(PrerenderMsg_SetIsPrerendering, OnSetIsPrerendering)

		src/chrome/renderer/plugins/chrome_plugin_placeholder.cc	 (1 occurrence)
    175 IPC_MESSAGE_HANDLER(PrerenderMsg_SetIsPrerendering, OnSetPrerenderMode)

		src/chrome/renderer/prerender/prerender_helper.cc	 (1 occurrence)
     75 IPC_MESSAGE_HANDLER(PrerenderMsg_SetIsPrerendering, OnSetIsPrerendering)

Unfortunately, it seems like this can't be directly converted to Mojo without some refactoring. Mojo really only supports a 1-1 sender-receiver model, and you can't cascade a message like legacy IPC.

What will have to happen is that one of the three listeners will become the Mojo endpoint, and the other two should be called from that endpoint to pass on the message.

I'd suggest making ChromeRenderFrameObserver the endpoint as it already creates/accesses the PrerenderHelper in OnSetIsPrerendering. You'll then need to work out how to call the ChromePluginPlaceholder from ChromeRenderFrameObserver to pass on the message there.
Project Member

Comment 4 by bugdroid1@chromium.org, Jan 15 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c54c999da2f84e262769df93171e07c3498bcc8e

commit c54c999da2f84e262769df93171e07c3498bcc8e
Author: cm.sanchi <cm.sanchi@samsung.com>
Date: Mon Jan 15 05:27:24 2018

Convert PrerenderDispatcher Messages to use mojo.

This patch mojofies the PrerenderDispatcher Messages

Bug: 798712
Change-Id: Icba1bb1bbd98c1b219a5313a2eb2cbb7be31b2e7
Reviewed-on: https://chromium-review.googlesource.com/848434
Commit-Queue: Chandramouli Sanchi <cm.sanchi@samsung.com>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#529202}
[modify] https://crrev.com/c54c999da2f84e262769df93171e07c3498bcc8e/chrome/browser/chrome_content_renderer_manifest_overlay.json
[modify] https://crrev.com/c54c999da2f84e262769df93171e07c3498bcc8e/chrome/browser/prerender/prerender_contents.cc
[modify] https://crrev.com/c54c999da2f84e262769df93171e07c3498bcc8e/chrome/browser/prerender/prerender_link_manager.cc
[modify] https://crrev.com/c54c999da2f84e262769df93171e07c3498bcc8e/chrome/common/prerender.mojom
[modify] https://crrev.com/c54c999da2f84e262769df93171e07c3498bcc8e/chrome/common/prerender_messages.h
[modify] https://crrev.com/c54c999da2f84e262769df93171e07c3498bcc8e/chrome/renderer/prerender/prerender_dispatcher.cc
[modify] https://crrev.com/c54c999da2f84e262769df93171e07c3498bcc8e/chrome/renderer/prerender/prerender_dispatcher.h
[modify] https://crrev.com/c54c999da2f84e262769df93171e07c3498bcc8e/chrome/renderer/prerender/prerender_dispatcher_unittest.cc

Cc: dcheng@chromium.org
@dcheng, dominickn,
Any reference to convert multiple listeners IPC to mojom?
Thanks in advance
As I mentioned in #6, you'll need to do some refactoring to make this conversion.

You'll need to make one of chrome_render_frame_observer.cc, chrome_plugin_placeholder.cc, or prerender_helper.cc the endpoint for the Mojo message. Then that class needs to explicitly call the others.

As I suggested, ChromeRenderFrameObserver might be the best endpoint as it already creates/accesses the PrerenderHelper in OnSetIsPrerendering. Then what remains is to work out how to get to ChromePluginPlaceholder from ChromeRenderFrameObserver to pass on the message there.
Status: Available (was: Assigned)
Currently busy with other activities...if anyone interested to work on this bug...plz feel free.
Status: Assigned (was: Available)

Sign in to add a comment