New issue
Advanced search Search tips

Issue 706771 link

Starred by 0 users

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 3
Type: Bug



Sign in to add a comment

ContentAutofillDriver::RendererIsAvailable() always returns true

Project Member Reported by vabr@chromium.org, Mar 30 2017

Issue description

ContentAutofillDriver::RendererIsAvailable() is defined as:

  return render_frame_host_->GetRenderViewHost() != NULL;

However, the comment at RenderFrameHostImpl::render_view_host_ indicates that the returned value is never null.

Perhaps ContentAutofillDriver::RendererIsAvailable() should be implemented as 

  return render_frame_host_->IsRenderFrameLive();
 

Comment 1 by vabr@chromium.org, Mar 30 2017

Cc: rogerm@chromium.org
For completeness, we should verify what is expected of ContentAutofillDriver::RendererIsAvailable() at its callsites. If it is about RenderViewHost then we can likely drop ContentAutofillDriver::RendererIsAvailable completely and replace with "true". Otherwise the above suggested rewrite might be in order.

Cc-ing rogerm@ for triaging this. I'm afraid I won't be able to get to this quickly, so don't want to delay this.
Yeah, IsRenderFrameLive() *sounds* like what RendererIsAvailable() is supposed to be returning. But how does that compare to

  auto* rvh = render_frame_host_>GetRenderViewHost();
  return rvh && rvh->IsRenderViewLive();

or some uber-test like:

  render_frame_host_->isRenderFrameLive() && ...

Comment 3 by vabr@chromium.org, Apr 7 2017

Cc: ekaramad@chromium.org
Perhaps ekaramad@ knows how IsRenderViewLive() compares to IsRenderFrameLive()?

Roger, I'm not sure I understand the last two lines of #2. Are you asking whether there are other checks we should make in addition to IsRenderFrameLive to convey the meaning of "RendererIsAvailable"? If so, then I think this depends on the callsites, which are our only way to reverse-engineer to definition of "RendererIsAvailable". One thing we could do, short of a proper audit of the code, is to stick with IsRenderFrameLive() and watch for crashes.
I just meant we could "check all the things".
Cc: creis@chromium.org
I am actually not quite certain of this. cc-ing creis@ who probably knows more.

My own understanding:
InRenderFrameLive() returns true when there is a connection to the process and the RenderFrame has been created. InRenderViewLive() also checks for the connection but verifies if RenderWiget has been initialized 'once'. So they both have the process connection part. But based on the comment for |render_frame_created_| (https://cs.chromium.org/chromium/src/content/browser/frame_host/render_frame_host_impl.h?rcl=33d6af4002ee5d40343ecff63d4ce017461cfa44&l=986) IsRenderFrameLive() should be used for OOPIFs.

So I would say IsRenderFrameLive() should be fine for all frames including the main frame. But generally, that also implies RendererIsAlive() should no longer be needed due two A) ContentAutofillDriver's lifetime seems to be tied to that of the RenderFrameHost and its connection to the renderer (cannot outlive the frame/connection?) and B) It has been returning true for a while now so why not as well remove it (agreeing with comment #1)?

Sign in to add a comment