diff options
author | dcheng <dcheng@chromium.org> | 2015-10-26 16:30:55 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-26 23:31:41 +0000 |
commit | 3ce04b6e31fdcfe9d0cae5b4c116b57ed0dea81a (patch) | |
tree | e6f2f54c13f9cba0e7c5f841551bb104ecaee497 /content/public/browser/web_contents_delegate.h | |
parent | 36f66e9775081d5d950e7ba130bae0ac7ca63e71 (diff) | |
download | chromium_src-3ce04b6e31fdcfe9d0cae5b4c116b57ed0dea81a.zip chromium_src-3ce04b6e31fdcfe9d0cae5b4c116b57ed0dea81a.tar.gz chromium_src-3ce04b6e31fdcfe9d0cae5b4c116b57ed0dea81a.tar.bz2 |
Give the main frame a RenderWidget.
Currently, RenderView is a subclass of RenderWidget, and the RenderWidget
portion is effectively treated as the the widget for the main frame as
well. For a number of reasons, this is a problematic model:
- A remote frame doesn't need a widget; however, a RenderView with a remote
main frame still has a vestigal RenderWidget.
- Code that needs to affect both RenderWidget / RenderView is awkwardly
split between them, in both content and blink.
- RenderView itself is often seen as an easy entry point to perform
page-level work in the renderer. With OOPI, this is no longer a valid
assumption.
In order to incrementally de-widgetize RenderView, the main frame will
have also have a RenderWidget, to make it consistent with the local frame
roots for subframes, which already have a RenderWidget. However, instead of
giving main frames their own RenderWidget, the main frame re-uses the
RenderView as its RenderWidget.
The rationale for taking this approach is to minimize the breakage: today,
Chrome simply doesn't expect to have two "widgets" for a frame.
Instantiating a distinct RenderWidget for the main frame can confuse code
that iterates or counts the active widgets: an example of this is the
security check for injecting WebUI bindings.
In the future, when RenderViewHost has-a RenderWidgetHost (and similarly,
when RenderViewImpl has-a RenderWidget) instead of today's is-a relation,
then it be conceptually much more straightforward to transition completely
to the new model.
BUG=419087
Review URL: https://codereview.chromium.org/1303773002
Cr-Commit-Position: refs/heads/master@{#356176}
Diffstat (limited to 'content/public/browser/web_contents_delegate.h')
-rw-r--r-- | content/public/browser/web_contents_delegate.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h index eb5f480..40a4904 100644 --- a/content/public/browser/web_contents_delegate.h +++ b/content/public/browser/web_contents_delegate.h @@ -289,8 +289,9 @@ class CONTENT_EXPORT WebContentsDelegate { // be destroyed. virtual bool ShouldCreateWebContents( WebContents* web_contents, - int route_id, - int main_frame_route_id, + int32_t route_id, + int32_t main_frame_route_id, + int32_t main_frame_widget_route_id, WindowContainerType window_container_type, const std::string& frame_name, const GURL& target_url, |