ContentAutofillDriver::RendererIsAvailable() always returns true |
|||
Issue descriptionContentAutofillDriver::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();
,
Apr 7 2017
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() && ...
,
Apr 7 2017
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.
,
Apr 7 2017
I just meant we could "check all the things".
,
Apr 7 2017
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 |
|||
Comment 1 by vabr@chromium.org
, Mar 30 2017