| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 878 navigation_rfh = speculative_render_frame_host_.get(); | 878 navigation_rfh = speculative_render_frame_host_.get(); |
| 879 | 879 |
| 880 // Check if our current RFH is live. | 880 // Check if our current RFH is live. |
| 881 if (!render_frame_host_->IsRenderFrameLive()) { | 881 if (!render_frame_host_->IsRenderFrameLive()) { |
| 882 // The current RFH is not live. There's no reason to sit around with a | 882 // The current RFH is not live. There's no reason to sit around with a |
| 883 // sad tab or a newly created RFH while we wait for the navigation to | 883 // sad tab or a newly created RFH while we wait for the navigation to |
| 884 // complete. Just switch to the speculative RFH now and go back to normal. | 884 // complete. Just switch to the speculative RFH now and go back to normal. |
| 885 // (Note that we don't care about on{before}unload handlers if the current | 885 // (Note that we don't care about on{before}unload handlers if the current |
| 886 // RFH isn't live.) | 886 // RFH isn't live.) |
| 887 CommitPending(); | 887 CommitPending(); |
| 888 |
| 889 // Notify the WebUI of the creation of the RenderView if needed (the |
| 890 // newly created WebUI has just been committed by CommitPending, so |
| 891 // GetNavigatingWebUI() below will return false). |
| 892 if (notify_webui_of_rv_creation && render_frame_host_->web_ui()) { |
| 893 render_frame_host_->web_ui()->RenderViewCreated( |
| 894 render_frame_host_->render_view_host()); |
| 895 notify_webui_of_rv_creation = false; |
| 896 } |
| 888 } | 897 } |
| 889 } | 898 } |
| 890 DCHECK(navigation_rfh && | 899 DCHECK(navigation_rfh && |
| 891 (navigation_rfh == render_frame_host_.get() || | 900 (navigation_rfh == render_frame_host_.get() || |
| 892 navigation_rfh == speculative_render_frame_host_.get())); | 901 navigation_rfh == speculative_render_frame_host_.get())); |
| 893 | 902 |
| 894 // If the RenderFrame that needs to navigate is not live (its process was just | 903 // If the RenderFrame that needs to navigate is not live (its process was just |
| 895 // created or has crashed), initialize it. | 904 // created or has crashed), initialize it. |
| 896 if (!navigation_rfh->IsRenderFrameLive()) { | 905 if (!navigation_rfh->IsRenderFrameLive()) { |
| 897 // Recreate the opener chain. | 906 // Recreate the opener chain. |
| (...skipping 1611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2509 int RenderFrameHostManager::GetOpenerRoutingID(SiteInstance* instance) { | 2518 int RenderFrameHostManager::GetOpenerRoutingID(SiteInstance* instance) { |
| 2510 if (!frame_tree_node_->opener()) | 2519 if (!frame_tree_node_->opener()) |
| 2511 return MSG_ROUTING_NONE; | 2520 return MSG_ROUTING_NONE; |
| 2512 | 2521 |
| 2513 return frame_tree_node_->opener() | 2522 return frame_tree_node_->opener() |
| 2514 ->render_manager() | 2523 ->render_manager() |
| 2515 ->GetRoutingIdForSiteInstance(instance); | 2524 ->GetRoutingIdForSiteInstance(instance); |
| 2516 } | 2525 } |
| 2517 | 2526 |
| 2518 } // namespace content | 2527 } // namespace content |
| OLD | NEW |