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

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

Issue 1209393002: Move more code behind IsSwappedOutStateForbidden() checks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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_manager.h" 5 #include "content/browser/frame_host/render_frame_host_manager.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/logging.h" 10 #include "base/logging.h"
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after
879 switches::kSitePerProcess)) 879 switches::kSitePerProcess))
880 return; 880 return;
881 881
882 for (const auto& pair : proxy_hosts_) { 882 for (const auto& pair : proxy_hosts_) {
883 pair.second->Send( 883 pair.second->Send(
884 new FrameMsg_DidUpdateName(pair.second->GetRoutingID(), name)); 884 new FrameMsg_DidUpdateName(pair.second->GetRoutingID(), name));
885 } 885 }
886 } 886 }
887 887
888 void RenderFrameHostManager::OnDidUpdateOrigin(const url::Origin& origin) { 888 void RenderFrameHostManager::OnDidUpdateOrigin(const url::Origin& origin) {
889 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( 889 if (!IsSwappedOutStateForbidden())
ncarter (slow) 2015/06/26 20:27:17 I didn't realize this one fall under the SwappedOu
nasko 2015/06/29 08:06:20 I'd consult Alex on that one, as he is working thr
alexmos 2015/06/29 14:18:05 Only if we also update this one: https://code.goog
890 switches::kSitePerProcess))
891 return; 890 return;
892 891
893 for (const auto& pair : proxy_hosts_) { 892 for (const auto& pair : proxy_hosts_) {
894 pair.second->Send( 893 pair.second->Send(
895 new FrameMsg_DidUpdateOrigin(pair.second->GetRoutingID(), origin)); 894 new FrameMsg_DidUpdateOrigin(pair.second->GetRoutingID(), origin));
896 } 895 }
897 } 896 }
898 897
899 void RenderFrameHostManager::Observe( 898 void RenderFrameHostManager::Observe(
900 int type, 899 int type,
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
1537 if (swapped_out) 1536 if (swapped_out)
1538 proxy->set_render_frame_proxy_created(true); 1537 proxy->set_render_frame_proxy_created(true);
1539 if (frame_tree_node_->IsMainFrame()) { 1538 if (frame_tree_node_->IsMainFrame()) {
1540 // Don't show the main frame's view until we get a DidNavigate from it. 1539 // Don't show the main frame's view until we get a DidNavigate from it.
1541 // Only the RenderViewHost for the top-level RenderFrameHost has a 1540 // Only the RenderViewHost for the top-level RenderFrameHost has a
1542 // RenderWidgetHostView; RenderWidgetHosts for out-of-process iframes 1541 // RenderWidgetHostView; RenderWidgetHosts for out-of-process iframes
1543 // will be created later and hidden. 1542 // will be created later and hidden.
1544 if (render_view_host->GetView()) 1543 if (render_view_host->GetView())
1545 render_view_host->GetView()->Hide(); 1544 render_view_host->GetView()->Hide();
1546 } 1545 }
1547 // With --site-per-process, RenderViewHost for |instance| might exist 1546 // RenderViewHost for |instance| might exist prior to calling
1548 // prior to calling CreateRenderFrame, due to a subframe in 1547 // CreateRenderFrame. In such a case, InitRenderView will not create the
1549 // |instance|. In such a case, InitRenderView will not create the
1550 // RenderFrame in the renderer process and it needs to be done 1548 // RenderFrame in the renderer process and it needs to be done
1551 // explicitly. 1549 // explicitly.
1552 if (is_site_per_process) { 1550 if (swapped_out_forbidden) {
1553 // Init the RFH, so a RenderFrame is created in the renderer. 1551 // Init the RFH, so a RenderFrame is created in the renderer.
1554 DCHECK(new_render_frame_host); 1552 DCHECK(new_render_frame_host);
1555 success = InitRenderFrame(new_render_frame_host.get()); 1553 success = InitRenderFrame(new_render_frame_host.get());
1556 } 1554 }
1557 } 1555 }
1558 1556
1559 if (success) { 1557 if (success) {
1560 if (view_routing_id_ptr) 1558 if (view_routing_id_ptr)
1561 *view_routing_id_ptr = render_view_host->GetRoutingID(); 1559 *view_routing_id_ptr = render_view_host->GetRoutingID();
1562 } 1560 }
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after
2241 frame_tree->root()->render_manager()-> 2239 frame_tree->root()->render_manager()->
2242 CreateRenderFrame(instance, nullptr, opener_route_id, 2240 CreateRenderFrame(instance, nullptr, opener_route_id,
2243 CREATE_RF_FOR_MAIN_FRAME_NAVIGATION | 2241 CREATE_RF_FOR_MAIN_FRAME_NAVIGATION |
2244 CREATE_RF_SWAPPED_OUT | CREATE_RF_HIDDEN, 2242 CREATE_RF_SWAPPED_OUT | CREATE_RF_HIDDEN,
2245 &render_view_routing_id); 2243 &render_view_routing_id);
2246 } 2244 }
2247 return render_view_routing_id; 2245 return render_view_routing_id;
2248 } 2246 }
2249 2247
2250 } // namespace content 2248 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/render_frame_impl.cc » ('j') | content/renderer/render_frame_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698