| 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/frame_tree.h" | 5 #include "content/browser/frame_host/frame_tree.h" |
| 6 | 6 |
| 7 #include <queue> | 7 #include <queue> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 // Terminate iteration once the node has been found. | 40 // Terminate iteration once the node has been found. |
| 41 return false; | 41 return false; |
| 42 } | 42 } |
| 43 return true; | 43 return true; |
| 44 } | 44 } |
| 45 | 45 |
| 46 // Iterate over the FrameTree to reset any node affected by the loss of the | 46 // Iterate over the FrameTree to reset any node affected by the loss of the |
| 47 // given RenderViewHost's process. | 47 // given RenderViewHost's process. |
| 48 bool ResetNodesForNewProcess(RenderViewHost* render_view_host, | 48 bool ResetNodesForNewProcess(RenderViewHost* render_view_host, |
| 49 FrameTreeNode* node) { | 49 FrameTreeNode* node) { |
| 50 if (render_view_host == node->current_frame_host()->render_view_host()) | 50 if (render_view_host == node->current_frame_host()->render_view_host()) { |
| 51 // Ensure that if the frame host is reused for a new RenderFrame, it will |
| 52 // set up the Mojo connection with that frame. |
| 53 node->current_frame_host()->InvalidateMojoConnection(); |
| 51 node->ResetForNewProcess(); | 54 node->ResetForNewProcess(); |
| 55 } |
| 52 return true; | 56 return true; |
| 53 } | 57 } |
| 54 | 58 |
| 55 bool CreateProxyForSiteInstance(const scoped_refptr<SiteInstance>& instance, | 59 bool CreateProxyForSiteInstance(const scoped_refptr<SiteInstance>& instance, |
| 56 FrameTreeNode* node) { | 60 FrameTreeNode* node) { |
| 57 // If a new frame is created in the current SiteInstance, other frames in | 61 // If a new frame is created in the current SiteInstance, other frames in |
| 58 // that SiteInstance don't need a proxy for the new frame. | 62 // that SiteInstance don't need a proxy for the new frame. |
| 59 SiteInstance* current_instance = | 63 SiteInstance* current_instance = |
| 60 node->render_manager()->current_frame_host()->GetSiteInstance(); | 64 node->render_manager()->current_frame_host()->GetSiteInstance(); |
| 61 if (current_instance != instance.get()) | 65 if (current_instance != instance.get()) |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 rvh->Shutdown(); | 349 rvh->Shutdown(); |
| 346 render_view_host_pending_shutdown_map_.erase(multi_iter); | 350 render_view_host_pending_shutdown_map_.erase(multi_iter); |
| 347 } | 351 } |
| 348 break; | 352 break; |
| 349 } | 353 } |
| 350 CHECK(render_view_host_found); | 354 CHECK(render_view_host_found); |
| 351 } | 355 } |
| 352 } | 356 } |
| 353 | 357 |
| 354 } // namespace content | 358 } // namespace content |
| OLD | NEW |