Introduce LocalFrame::GetWidgetForLocalRoot()
For LocalFrames that are in a Page owned by a WebView, each LocalFrame has a WebLocalFrameImpl which has a WebFrameWidget. This is always present except very early during initialization which most code can ignore. For LocalFrames in non-ordinary Pages, which live without a WebView (such as WebPagePopupImpl, devtools agent, unit tests) the LocalFrame has an EmptyLocalFrameClient instead of WebLocalFrameImpl and thus there are no WebFrameWidgets. Currently parts of core/ can not get to the WebFrameWidget because WebLocalFrameImpl is banned due to the layering mess being unresolved. It is also difficult to find the path there as going from LocalFrame requires: WebLocalFrameImpl::FromFrame(local_frame)->LocalRootFrameWidget() Since the conversion to WebLocalFrameImpl isn't a member of LocalFrame it's very hard to find and remember this path! We introduce here a well-lit road from LocalFrame to its WebFrameWidget and use it throughout ChromeClientImpl. While updating ChromeClientImpl we note that it was early-outting on WebViewImpl::does_composite() due to a null WebWidgetClient which it is no longer using, as it defers to the WebFrameWidget. Since ChromeClient means we have a WebView, we also know that WebFrameWidget does exist, and it is a better place to early out. So these are moved. This change will allow my display-mode CL for 1060336 to find the WebFrameWidget from code in core/css/ without changing blink layering more dramatically. And it is a long time coming to make this path clearer. R=dtapuska@chromium.org Bug: 1060336, 844547, 1058633 Change-Id: Iabb71ebf0c5ebaf7daea924425c9d3a3a2c23d54 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2101847Reviewed-by:Dave Tapuska <dtapuska@chromium.org> Commit-Queue: danakj <danakj@chromium.org> Cr-Commit-Position: refs/heads/master@{#751064}
Showing
This diff is collapsed.
Please register or sign in to comment