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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 616133002: Make RenderFrame(Host) own a RenderWidget(Host). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/frame_host/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 // filenames it can't access in a future session restore. 706 // filenames it can't access in a future session restore.
707 if (!render_view_host_->CanAccessFilesOfPageState( 707 if (!render_view_host_->CanAccessFilesOfPageState(
708 validated_params.page_state)) { 708 validated_params.page_state)) {
709 GetProcess()->ReceivedBadMessage(); 709 GetProcess()->ReceivedBadMessage();
710 return; 710 return;
711 } 711 }
712 712
713 frame_tree_node()->navigator()->DidNavigate(this, validated_params); 713 frame_tree_node()->navigator()->DidNavigate(this, validated_params);
714 } 714 }
715 715
716 void RenderFrameHostImpl::CreateRenderWidgetHost(
717 RenderWidgetHostDelegate* delegate,
718 bool hidden) {
719 DCHECK(!render_widget_host_impl_);
720 // TODO(kenrb): After RenderWidgetHost is divorced from RenderViewHost it
721 // will no longer need its own routing_id, and instead can route messages
Charlie Reis 2014/10/01 17:01:08 Is there a benefit to this? There are still some
kenrb 2014/10/01 19:27:51 That's a good point about still needing them for p
722 // through its owner's IPC channel.
723 int render_widget_host_impl_routing_id = GetProcess()->GetNextRoutingID();
724 render_widget_host_impl_.reset(
725 new RenderWidgetHostImpl(delegate,
nasko 2014/10/01 16:37:14 nit: needs two more spaces of indentation.
kenrb 2014/10/01 19:27:51 Done.
726 GetProcess(),
727 render_widget_host_impl_routing_id,
728 hidden));
729
730 new RenderWidgetHostViewChildFrame(render_widget_host_impl_.get());
nasko 2014/10/01 16:37:14 Who will own this new child frame object?
kenrb 2014/10/01 19:27:51 The RenderWidgetHostImpl that is passed in the arg
Charlie Reis 2014/10/02 00:06:57 Please add a comment for that, since it's not obvi
kenrb 2014/10/02 20:20:47 Done. The comment I added is a bit more accurate t
731
732 Send(new FrameMsg_NewWidgetForFrame(routing_id_,
733 render_widget_host_impl_routing_id,
734 hidden));
735 }
736
716 RenderWidgetHostImpl* RenderFrameHostImpl::GetRenderWidgetHost() { 737 RenderWidgetHostImpl* RenderFrameHostImpl::GetRenderWidgetHost() {
738 if (render_widget_host_impl_)
739 return render_widget_host_impl_.get();
740
741 // TODO(kenrb): When RenderViewHost no longer inherits RenderWidgetHost,
nasko 2014/10/01 16:37:14 When that happens, wouldn't we want to go up the c
Charlie Reis 2014/10/01 17:01:08 We'll need to walk up the tree, since render_widge
kenrb 2014/10/01 19:27:51 I think we should only try to access a widget on R
Charlie Reis 2014/10/02 00:06:57 That makes this a bit of a strange method. How wo
kenrb 2014/10/02 20:20:47 My view of this is that anybody who has business t
nasko 2014/10/02 20:41:43 Wouldn't that mean that each of those places that
kenrb 2014/10/03 17:23:32 RenderWidgetHost represents the content to the pla
742 // we can remove this fallback. Currently it is only used for the main
743 // frame.
717 return static_cast<RenderWidgetHostImpl*>(render_view_host_); 744 return static_cast<RenderWidgetHostImpl*>(render_view_host_);
718 } 745 }
719 746
720 int RenderFrameHostImpl::GetEnabledBindings() { 747 int RenderFrameHostImpl::GetEnabledBindings() {
721 return render_view_host_->GetEnabledBindings(); 748 return render_view_host_->GetEnabledBindings();
722 } 749 }
723 750
724 void RenderFrameHostImpl::OnCrossSiteResponse( 751 void RenderFrameHostImpl::OnCrossSiteResponse(
725 const GlobalRequestID& global_request_id, 752 const GlobalRequestID& global_request_id,
726 scoped_ptr<CrossSiteTransferringRequest> cross_site_transferring_request, 753 scoped_ptr<CrossSiteTransferringRequest> cross_site_transferring_request,
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
1453 // Clear any state if a pending navigation is canceled or preempted. 1480 // Clear any state if a pending navigation is canceled or preempted.
1454 if (suspended_nav_params_) 1481 if (suspended_nav_params_)
1455 suspended_nav_params_.reset(); 1482 suspended_nav_params_.reset();
1456 1483
1457 TRACE_EVENT_ASYNC_END0("navigation", 1484 TRACE_EVENT_ASYNC_END0("navigation",
1458 "RenderFrameHostImpl navigation suspended", this); 1485 "RenderFrameHostImpl navigation suspended", this);
1459 navigations_suspended_ = false; 1486 navigations_suspended_ = false;
1460 } 1487 }
1461 1488
1462 } // namespace content 1489 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698