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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 1199313006: Disable support for swapped out RenderFrame(Host) on desktop. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 bool was_created_by_renderer) { 662 bool was_created_by_renderer) {
663 routing_id_ = params.view_id; 663 routing_id_ = params.view_id;
664 surface_id_ = params.surface_id; 664 surface_id_ = params.surface_id;
665 if (params.opener_route_id != MSG_ROUTING_NONE && was_created_by_renderer) 665 if (params.opener_route_id != MSG_ROUTING_NONE && was_created_by_renderer)
666 opener_id_ = params.opener_route_id; 666 opener_id_ = params.opener_route_id;
667 display_mode_= params.initial_size.display_mode; 667 display_mode_= params.initial_size.display_mode;
668 668
669 // Ensure we start with a valid next_page_id_ from the browser. 669 // Ensure we start with a valid next_page_id_ from the browser.
670 DCHECK_GE(next_page_id_, 0); 670 DCHECK_GE(next_page_id_, 0);
671 671
672 LOG(ERROR) << "RV[" << this << "]::Init:"
673 << " routing_id:" << routing_id_
674 << " main_frame:" << params.main_frame_routing_id
675 << " proxy:" << params.proxy_routing_id;
676
672 if (params.main_frame_routing_id != MSG_ROUTING_NONE) { 677 if (params.main_frame_routing_id != MSG_ROUTING_NONE) {
673 main_render_frame_ = RenderFrameImpl::Create( 678 main_render_frame_ = RenderFrameImpl::Create(
674 this, params.main_frame_routing_id); 679 this, params.main_frame_routing_id);
680 LOG(ERROR) << "RV[" << this << "]::Init:"
681 << " created main frame:" << main_render_frame_;
675 // The main frame WebLocalFrame object is closed by 682 // The main frame WebLocalFrame object is closed by
676 // RenderFrameImpl::frameDetached(). 683 // RenderFrameImpl::frameDetached().
677 WebLocalFrame* web_frame = WebLocalFrame::create( 684 WebLocalFrame* web_frame = WebLocalFrame::create(
678 blink::WebTreeScopeType::Document, main_render_frame_); 685 blink::WebTreeScopeType::Document, main_render_frame_);
679 main_render_frame_->SetWebFrame(web_frame); 686 main_render_frame_->SetWebFrame(web_frame);
680 } 687 }
681 688
682 compositor_deps_ = compositor_deps; 689 compositor_deps_ = compositor_deps;
683 webwidget_ = WebView::create(this); 690 webwidget_ = WebView::create(this);
684 webwidget_mouse_lock_target_.reset(new WebWidgetLockTarget(webwidget_)); 691 webwidget_mouse_lock_target_.reset(new WebWidgetLockTarget(webwidget_));
685 692
686 g_view_map.Get().insert(std::make_pair(webview(), this)); 693 g_view_map.Get().insert(std::make_pair(webview(), this));
687 g_routing_id_view_map.Get().insert(std::make_pair(routing_id_, this)); 694 g_routing_id_view_map.Get().insert(std::make_pair(routing_id_, this));
688 695
689 const base::CommandLine& command_line = 696 const base::CommandLine& command_line =
690 *base::CommandLine::ForCurrentProcess(); 697 *base::CommandLine::ForCurrentProcess();
691 698
692 if (command_line.HasSwitch(switches::kStatsCollectionController)) 699 if (command_line.HasSwitch(switches::kStatsCollectionController))
693 stats_collection_observer_.reset(new StatsCollectionObserver(this)); 700 stats_collection_observer_.reset(new StatsCollectionObserver(this));
694 701
702
703
704
695 RenderFrameProxy* proxy = NULL; 705 RenderFrameProxy* proxy = NULL;
696 if (params.proxy_routing_id != MSG_ROUTING_NONE) { 706 if (params.proxy_routing_id != MSG_ROUTING_NONE) {
697 CHECK(params.swapped_out); 707 CHECK(params.swapped_out);
708 LOG(ERROR) << "RV[" << this << "]::Init:"
709 << " creating proxy, main_frame:" << main_render_frame_;
698 if (main_render_frame_) { 710 if (main_render_frame_) {
699 proxy = RenderFrameProxy::CreateProxyToReplaceFrame( 711 proxy = RenderFrameProxy::CreateProxyToReplaceFrame(
700 main_render_frame_, params.proxy_routing_id, 712 main_render_frame_, params.proxy_routing_id,
701 blink::WebTreeScopeType::Document); 713 blink::WebTreeScopeType::Document);
702 main_render_frame_->set_render_frame_proxy(proxy); 714 main_render_frame_->set_render_frame_proxy(proxy);
703 } else { 715 } else {
704 proxy = RenderFrameProxy::CreateFrameProxy( 716 proxy = RenderFrameProxy::CreateFrameProxy(
705 params.proxy_routing_id, 717 params.proxy_routing_id,
706 MSG_ROUTING_NONE, 718 MSG_ROUTING_NONE,
707 routing_id_, 719 routing_id_,
708 params.replicated_frame_state); 720 params.replicated_frame_state);
709 } 721 }
710 } 722 }
711 723
712 // In --site-per-process, just use the WebRemoteFrame as the main frame. 724 if (proxy) {
713 if (command_line.HasSwitch(switches::kSitePerProcess) && proxy) {
714 webview()->setMainFrame(proxy->web_frame()); 725 webview()->setMainFrame(proxy->web_frame());
715 // Initialize the WebRemoteFrame with information replicated from the 726 // Initialize the WebRemoteFrame with information replicated from the
716 // browser process. 727 // browser process.
717 proxy->SetReplicatedState(params.replicated_frame_state); 728 proxy->SetReplicatedState(params.replicated_frame_state);
718 } else { 729 } else {
719 webview()->setMainFrame(main_render_frame_->GetWebFrame()); 730 webview()->setMainFrame(main_render_frame_->GetWebFrame());
720 } 731 }
721 if (main_render_frame_) 732 if (main_render_frame_)
722 main_render_frame_->Initialize(); 733 main_render_frame_->Initialize();
723 734
(...skipping 3092 matching lines...) Expand 10 before | Expand all | Expand 10 after
3816 std::vector<gfx::Size> sizes; 3827 std::vector<gfx::Size> sizes;
3817 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 3828 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
3818 if (!url.isEmpty()) 3829 if (!url.isEmpty())
3819 urls.push_back( 3830 urls.push_back(
3820 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 3831 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
3821 } 3832 }
3822 SendUpdateFaviconURL(urls); 3833 SendUpdateFaviconURL(urls);
3823 } 3834 }
3824 3835
3825 } // namespace content 3836 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698