These (and possibly other binding conversion helpers) should only accept LocalFrame/LocalDOMWindow / return LocalFrame/LocalDOMWindow, as only a local frame will be able to have a full v8 context. The current design leads to nearly all of the callers of toDOMWindow() downcasting to LocalDOMWindow, which is discouraged. Instead, toDOMWindow() should just return a LocalDOMWindow directly.
The original reason for using Frame/DOMWindow is because of a hack for remote frames, where we need to expose the global object. Once https://codereview.chromium.org/2626183003/ lands, it should no longer be necessary to use this hack.
Comment 1 by bugdroid1@chromium.org
, Mar 13 2017