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 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
713 SiteInstance* current_site_instance = render_frame_host_->GetSiteInstance(); | 713 SiteInstance* current_site_instance = render_frame_host_->GetSiteInstance(); |
714 | 714 |
715 scoped_refptr<SiteInstance> dest_site_instance = GetSiteInstanceForNavigation( | 715 scoped_refptr<SiteInstance> dest_site_instance = GetSiteInstanceForNavigation( |
716 request.common_params().url, request.source_site_instance(), | 716 request.common_params().url, request.source_site_instance(), |
717 request.dest_site_instance(), request.common_params().transition, | 717 request.dest_site_instance(), request.common_params().transition, |
718 request.restore_type() != NavigationEntryImpl::RESTORE_NONE, | 718 request.restore_type() != NavigationEntryImpl::RESTORE_NONE, |
719 request.is_view_source()); | 719 request.is_view_source()); |
720 // The appropriate RenderFrameHost to commit the navigation. | 720 // The appropriate RenderFrameHost to commit the navigation. |
721 RenderFrameHostImpl* navigation_rfh = nullptr; | 721 RenderFrameHostImpl* navigation_rfh = nullptr; |
722 | 722 |
723 // TODO(carlosk): do not swap processes for renderer initiated navigations | 723 // TODO(carlosk): Once there is support for cross-process scripting remove the |
clamy
2015/03/06 13:43:09
I think you should add a little more explanation o
carlosk
2015/03/06 15:44:15
Done. I didn't realized/remembered that situation
| |
724 // (see crbug.com/440266). | 724 // check for renderer-initiated navigations. See crbug.com/440266. |
725 if (current_site_instance == dest_site_instance.get() || | 725 if (current_site_instance == dest_site_instance.get() || |
726 !request.browser_initiated() || | |
726 (!frame_tree_node_->IsMainFrame() && | 727 (!frame_tree_node_->IsMainFrame() && |
727 !base::CommandLine::ForCurrentProcess()->HasSwitch( | 728 !base::CommandLine::ForCurrentProcess()->HasSwitch( |
728 switches::kSitePerProcess))) { | 729 switches::kSitePerProcess))) { |
729 // Reuse the current RFH if its SiteInstance matches the the navigation's | 730 // Reuse the current RFH if its SiteInstance matches the the navigation's |
730 // or if this is a subframe navigation. We only swap RFHs for subframes when | 731 // or if this is a subframe navigation. We only swap RFHs for subframes when |
731 // --site-per-process is enabled. | 732 // --site-per-process is enabled. |
732 CleanUpNavigation(); | 733 CleanUpNavigation(); |
733 navigation_rfh = render_frame_host_.get(); | 734 navigation_rfh = render_frame_host_.get(); |
734 | 735 |
735 // As SiteInstances are the same, check if the WebUI should be reused. | 736 // As SiteInstances are the same, check if the WebUI should be reused. |
(...skipping 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1962 void RenderFrameHostManager::DeleteRenderFrameProxyHost( | 1963 void RenderFrameHostManager::DeleteRenderFrameProxyHost( |
1963 SiteInstance* instance) { | 1964 SiteInstance* instance) { |
1964 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); | 1965 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); |
1965 if (iter != proxy_hosts_.end()) { | 1966 if (iter != proxy_hosts_.end()) { |
1966 delete iter->second; | 1967 delete iter->second; |
1967 proxy_hosts_.erase(iter); | 1968 proxy_hosts_.erase(iter); |
1968 } | 1969 } |
1969 } | 1970 } |
1970 | 1971 |
1971 } // namespace content | 1972 } // namespace content |
OLD | NEW |