| OLD | NEW | 
|     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  Loading... | 
|  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()) | 
|  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() && | 
 |  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  Loading... | 
|  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 | 
| OLD | NEW |