FocusController::focusedOrMainFrame(): this should only return a frame if the focused frame (or the main frame?) is local to the renderer process. In particular, this should return a *reference* if possible: it should be invalid to call this in a process if the focused/main frame is not local.
WebView::focusedFrame(): this uses focusedOrMainFrame() internally, so it should have the same semantics. Callers should not null-check the value… probably. There might be some edge cases where this is null around frame detach? It's something to investigate.
I don't think there are any others in Blink, but there might be some things to fix up in //content as well (we've already fixed FocusController::focusedFrame() to use these semantics).
Motivation: in the long-run, this will help us ensure the important invariant that operations that require a DOM are routed to the renderer with the local frame. It will also provide overall simplification of code, with less downcasting from WebFrame to WebLocalFrame.
Comment 1 by dcheng@chromium.org
, Apr 19 2016