Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(296)

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 647613002: Fix RenderWidgetHostViewGuest leak. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: bring back mac delegate() Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 1564 matching lines...) Expand 10 before | Expand all | Expand 10 after
1575 new_contents->RenderViewCreated(new_contents->GetRenderViewHost()); 1575 new_contents->RenderViewCreated(new_contents->GetRenderViewHost());
1576 1576
1577 // Save the window for later if we're not suppressing the opener (since it 1577 // Save the window for later if we're not suppressing the opener (since it
1578 // will be shown immediately). 1578 // will be shown immediately).
1579 if (!params.opener_suppressed) { 1579 if (!params.opener_suppressed) {
1580 if (!is_guest) { 1580 if (!is_guest) {
1581 WebContentsView* new_view = new_contents->view_.get(); 1581 WebContentsView* new_view = new_contents->view_.get();
1582 1582
1583 // TODO(brettw): It seems bogus that we have to call this function on the 1583 // TODO(brettw): It seems bogus that we have to call this function on the
1584 // newly created object and give it one of its own member variables. 1584 // newly created object and give it one of its own member variables.
1585 new_view->CreateViewForWidget(new_contents->GetRenderViewHost()); 1585 new_view->CreateViewForWidget(new_contents->GetRenderViewHost(), false);
1586 } 1586 }
1587 // Save the created window associated with the route so we can show it 1587 // Save the created window associated with the route so we can show it
1588 // later. 1588 // later.
1589 DCHECK_NE(MSG_ROUTING_NONE, route_id); 1589 DCHECK_NE(MSG_ROUTING_NONE, route_id);
1590 pending_contents_[route_id] = new_contents; 1590 pending_contents_[route_id] = new_contents;
1591 AddDestructionObserver(new_contents); 1591 AddDestructionObserver(new_contents);
1592 } 1592 }
1593 1593
1594 if (delegate_) { 1594 if (delegate_) {
1595 delegate_->WebContentsCreated( 1595 delegate_->WebContentsCreated(
(...skipping 2535 matching lines...) Expand 10 before | Expand all | Expand 10 after
4131 RenderWidgetHostViewBase* rwh_view; 4131 RenderWidgetHostViewBase* rwh_view;
4132 // TODO(kenrb): RenderWidgetHostViewChildFrame special casing is temporary 4132 // TODO(kenrb): RenderWidgetHostViewChildFrame special casing is temporary
4133 // until RenderWidgetHost is attached to RenderFrameHost. We need to special 4133 // until RenderWidgetHost is attached to RenderFrameHost. We need to special
4134 // case this because RWH is still a base class of RenderViewHost, and child 4134 // case this because RWH is still a base class of RenderViewHost, and child
4135 // frame RWHVs are unique in that they do not have their own WebContents. 4135 // frame RWHVs are unique in that they do not have their own WebContents.
4136 if (!for_main_frame_navigation) { 4136 if (!for_main_frame_navigation) {
4137 RenderWidgetHostViewChildFrame* rwh_view_child = 4137 RenderWidgetHostViewChildFrame* rwh_view_child =
4138 new RenderWidgetHostViewChildFrame(render_view_host); 4138 new RenderWidgetHostViewChildFrame(render_view_host);
4139 rwh_view = rwh_view_child; 4139 rwh_view = rwh_view_child;
4140 } else { 4140 } else {
4141 rwh_view = view_->CreateViewForWidget(render_view_host); 4141 rwh_view = view_->CreateViewForWidget(render_view_host, false);
4142 } 4142 }
4143 4143
4144 // Now that the RenderView has been created, we need to tell it its size. 4144 // Now that the RenderView has been created, we need to tell it its size.
4145 if (rwh_view) 4145 if (rwh_view)
4146 rwh_view->SetSize(GetSizeForNewRenderView()); 4146 rwh_view->SetSize(GetSizeForNewRenderView());
4147 4147
4148 // Make sure we use the correct starting page_id in the new RenderView. 4148 // Make sure we use the correct starting page_id in the new RenderView.
4149 UpdateMaxPageIDIfNecessary(render_view_host); 4149 UpdateMaxPageIDIfNecessary(render_view_host);
4150 int32 max_page_id = 4150 int32 max_page_id =
4151 GetMaxPageIDForSiteInstance(render_view_host->GetSiteInstance()); 4151 GetMaxPageIDForSiteInstance(render_view_host->GetSiteInstance());
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
4371 node->render_manager()->ResumeResponseDeferredAtStart(); 4371 node->render_manager()->ResumeResponseDeferredAtStart();
4372 } 4372 }
4373 4373
4374 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { 4374 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) {
4375 force_disable_overscroll_content_ = force_disable; 4375 force_disable_overscroll_content_ = force_disable;
4376 if (view_) 4376 if (view_)
4377 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); 4377 view_->SetOverscrollControllerEnabled(CanOverscrollContent());
4378 } 4378 }
4379 4379
4380 } // namespace content 4380 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698