Chromium Code Reviews| 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 <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 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 697 SiteInstance* current_site_instance = render_frame_host_->GetSiteInstance(); | 697 SiteInstance* current_site_instance = render_frame_host_->GetSiteInstance(); |
| 698 | 698 |
| 699 scoped_refptr<SiteInstance> dest_site_instance = GetSiteInstanceForNavigation( | 699 scoped_refptr<SiteInstance> dest_site_instance = GetSiteInstanceForNavigation( |
| 700 request.common_params().url, request.source_site_instance(), | 700 request.common_params().url, request.source_site_instance(), |
| 701 request.dest_site_instance(), request.common_params().transition, | 701 request.dest_site_instance(), request.common_params().transition, |
| 702 request.restore_type() != NavigationEntryImpl::RESTORE_NONE, | 702 request.restore_type() != NavigationEntryImpl::RESTORE_NONE, |
| 703 request.is_view_source()); | 703 request.is_view_source()); |
| 704 // The appropriate RenderFrameHost to commit the navigation. | 704 // The appropriate RenderFrameHost to commit the navigation. |
| 705 RenderFrameHostImpl* navigation_rfh = nullptr; | 705 RenderFrameHostImpl* navigation_rfh = nullptr; |
| 706 | 706 |
| 707 // TODO(carlosk): do not swap processes for renderer initiated navigations | 707 // TODO(carlosk): Remove the renderer-initiated if-check below once OOPIF |
|
clamy
2015/02/23 10:52:34
I would rephrase the comment as:
Once there is sup
carlosk
2015/03/04 19:42:40
Done.
| |
| 708 // (see crbug.com/440266). | 708 // provides support for cross-process renderer-initiated navigations. See |
| 709 // crbug.com/440266. | |
| 709 if (current_site_instance == dest_site_instance.get() || | 710 if (current_site_instance == dest_site_instance.get() || |
| 711 !request.browser_initiated() || | |
| 710 (!frame_tree_node_->IsMainFrame() && | 712 (!frame_tree_node_->IsMainFrame() && |
| 711 !base::CommandLine::ForCurrentProcess()->HasSwitch( | 713 !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 712 switches::kSitePerProcess))) { | 714 switches::kSitePerProcess))) { |
| 713 // Reuse the current RFH if its SiteInstance matches the the navigation's | 715 // Reuse the current RFH if its SiteInstance matches the the navigation's |
| 714 // or if this is a subframe navigation. We only swap RFHs for subframes when | 716 // or if this is a subframe navigation. We only swap RFHs for subframes when |
| 715 // --site-per-process is enabled. | 717 // --site-per-process is enabled. |
| 716 CleanUpNavigation(); | 718 CleanUpNavigation(); |
| 717 navigation_rfh = render_frame_host_.get(); | 719 navigation_rfh = render_frame_host_.get(); |
| 718 | 720 |
| 719 // As SiteInstances are the same, check if the WebUI should be reused. | 721 // As SiteInstances are the same, check if the WebUI should be reused. |
| (...skipping 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1953 void RenderFrameHostManager::DeleteRenderFrameProxyHost( | 1955 void RenderFrameHostManager::DeleteRenderFrameProxyHost( |
| 1954 SiteInstance* instance) { | 1956 SiteInstance* instance) { |
| 1955 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); | 1957 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); |
| 1956 if (iter != proxy_hosts_.end()) { | 1958 if (iter != proxy_hosts_.end()) { |
| 1957 delete iter->second; | 1959 delete iter->second; |
| 1958 proxy_hosts_.erase(iter); | 1960 proxy_hosts_.erase(iter); |
| 1959 } | 1961 } |
| 1960 } | 1962 } |
| 1961 | 1963 |
| 1962 } // namespace content | 1964 } // namespace content |
| OLD | NEW |