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

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

Issue 1505343002: Don't create unexpected OOPIFs in --isolate-extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 2301 matching lines...) Expand 10 before | Expand all | Expand 10 after
2312 2312
2313 RenderFrameHostImpl* RenderFrameHostManager::UpdateStateForNavigate( 2313 RenderFrameHostImpl* RenderFrameHostManager::UpdateStateForNavigate(
2314 const GURL& dest_url, 2314 const GURL& dest_url,
2315 SiteInstance* source_instance, 2315 SiteInstance* source_instance,
2316 SiteInstance* dest_instance, 2316 SiteInstance* dest_instance,
2317 ui::PageTransition transition, 2317 ui::PageTransition transition,
2318 bool dest_is_restore, 2318 bool dest_is_restore,
2319 bool dest_is_view_source_mode, 2319 bool dest_is_view_source_mode,
2320 const GlobalRequestID& transferred_request_id, 2320 const GlobalRequestID& transferred_request_id,
2321 int bindings) { 2321 int bindings) {
2322 // Don't swap for subframes unless we are in --site-per-process. We can get 2322 if (!frame_tree_node_->IsMainFrame()) {
2323 // here in tests for subframes (e.g., NavigateFrameToURL). 2323 // Don't swap for subframes unless we are in an OOPIF-enabled mode. We can
2324 if (!frame_tree_node_->IsMainFrame() && 2324 // get here in tests for subframes (e.g., NavigateFrameToURL).
2325 !SiteIsolationPolicy::AreCrossProcessFramesPossible()) { 2325 if (!SiteIsolationPolicy::AreCrossProcessFramesPossible())
ncarter (slow) 2015/12/08 20:14:13 I think it might be cleaner to structure this as f
Charlie Reis 2015/12/08 20:34:11 Sure. As you noted offline, we may not get to the
2326 return render_frame_host_.get(); 2326 return render_frame_host_.get();
2327
2328 // If we are in an OOPIF mode that only applies to some sites, only swap if
2329 // the policy determines that a transfer would have been needed. We can get
2330 // here for session restore.
2331 if (!SiteIsolationPolicy::UseDedicatedProcessesForAllSites() &&
ncarter (slow) 2015/12/08 20:14:13 I don't think you need to check UseDedicatedProces
Charlie Reis 2015/12/08 20:34:11 Acknowledged.
2332 !IsRendererTransferNeededForNavigation(render_frame_host_.get(),
2333 dest_url)) {
2334 DCHECK(!dest_instance ||
2335 dest_instance == render_frame_host_->GetSiteInstance());
2336 return render_frame_host_.get();
2337 }
2327 } 2338 }
2328 2339
2329 SiteInstance* current_instance = render_frame_host_->GetSiteInstance(); 2340 SiteInstance* current_instance = render_frame_host_->GetSiteInstance();
2330 scoped_refptr<SiteInstance> new_instance = GetSiteInstanceForNavigation( 2341 scoped_refptr<SiteInstance> new_instance = GetSiteInstanceForNavigation(
2331 dest_url, source_instance, dest_instance, nullptr, transition, 2342 dest_url, source_instance, dest_instance, nullptr, transition,
2332 dest_is_restore, dest_is_view_source_mode); 2343 dest_is_restore, dest_is_view_source_mode);
2333 2344
2334 // If we are currently navigating cross-process to a pending RFH for a 2345 // If we are currently navigating cross-process to a pending RFH for a
2335 // different SiteInstance, we want to get back to normal and then navigate as 2346 // different SiteInstance, we want to get back to normal and then navigate as
2336 // usual. We will reuse the pending RFH below if it matches the destination 2347 // usual. We will reuse the pending RFH below if it matches the destination
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
2660 int RenderFrameHostManager::GetOpenerRoutingID(SiteInstance* instance) { 2671 int RenderFrameHostManager::GetOpenerRoutingID(SiteInstance* instance) {
2661 if (!frame_tree_node_->opener()) 2672 if (!frame_tree_node_->opener())
2662 return MSG_ROUTING_NONE; 2673 return MSG_ROUTING_NONE;
2663 2674
2664 return frame_tree_node_->opener() 2675 return frame_tree_node_->opener()
2665 ->render_manager() 2676 ->render_manager()
2666 ->GetRoutingIdForSiteInstance(instance); 2677 ->GetRoutingIdForSiteInstance(instance);
2667 } 2678 }
2668 2679
2669 } // namespace content 2680 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698