Thanks to this:
// FIXME: This is a temporary hack to ensure that we return a LocalFrame, even
// when the mainFrame is remote. FocusController needs to be refactored to
// deal with RemoteFrames cross-process focus transfers.
for (Frame* frame = &page_->MainFrame()->Tree().Top(); frame;
frame = frame->Tree().TraverseNext()) {
if (frame->IsLocalFrame() && ToLocalFrame(frame)->IsLocalRoot())
return frame;
}
this function essentially picks a random frame. We should see if we can reduce usage of this to zero.