Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1285)

Side by Side Diff: content/browser/frame_host/navigator_impl.cc

Issue 2686943002: New WebContents created via ctrl-click should be in a new process. (Closed)
Patch Set: s/renderer/process/ in the field name + initializing the field and variables. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/navigator_impl.h" 5 #include "content/browser/frame_host/navigator_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 } 725 }
726 726
727 void NavigatorImpl::RequestOpenURL( 727 void NavigatorImpl::RequestOpenURL(
728 RenderFrameHostImpl* render_frame_host, 728 RenderFrameHostImpl* render_frame_host,
729 const GURL& url, 729 const GURL& url,
730 bool uses_post, 730 bool uses_post,
731 const scoped_refptr<ResourceRequestBodyImpl>& body, 731 const scoped_refptr<ResourceRequestBodyImpl>& body,
732 const std::string& extra_headers, 732 const std::string& extra_headers,
733 const Referrer& referrer, 733 const Referrer& referrer,
734 WindowOpenDisposition disposition, 734 WindowOpenDisposition disposition,
735 bool force_new_process_for_new_contents,
735 bool should_replace_current_entry, 736 bool should_replace_current_entry,
736 bool user_gesture) { 737 bool user_gesture) {
737 // Note: This can be called for subframes (even when OOPIFs are not possible) 738 // Note: This can be called for subframes (even when OOPIFs are not possible)
738 // if the disposition calls for a different window. 739 // if the disposition calls for a different window.
739 740
740 // Only the current RenderFrameHost should be sending an OpenURL request. 741 // Only the current RenderFrameHost should be sending an OpenURL request.
741 // Pending RenderFrameHost should know where it is navigating and pending 742 // Pending RenderFrameHost should know where it is navigating and pending
742 // deletion RenderFrameHost shouldn't be trying to navigate. 743 // deletion RenderFrameHost shouldn't be trying to navigate.
743 if (render_frame_host != 744 if (render_frame_host !=
744 render_frame_host->frame_tree_node()->current_frame_host()) { 745 render_frame_host->frame_tree_node()->current_frame_host()) {
(...skipping 22 matching lines...) Expand all
767 // (possibly of a new or different WebContents) otherwise. 768 // (possibly of a new or different WebContents) otherwise.
768 if (disposition == WindowOpenDisposition::CURRENT_TAB && 769 if (disposition == WindowOpenDisposition::CURRENT_TAB &&
769 render_frame_host->GetParent()) { 770 render_frame_host->GetParent()) {
770 frame_tree_node_id = 771 frame_tree_node_id =
771 render_frame_host->frame_tree_node()->frame_tree_node_id(); 772 render_frame_host->frame_tree_node()->frame_tree_node_id();
772 } 773 }
773 774
774 OpenURLParams params(dest_url, referrer, frame_tree_node_id, disposition, 775 OpenURLParams params(dest_url, referrer, frame_tree_node_id, disposition,
775 ui::PAGE_TRANSITION_LINK, 776 ui::PAGE_TRANSITION_LINK,
776 true /* is_renderer_initiated */); 777 true /* is_renderer_initiated */);
778 params.force_new_process_for_new_contents =
779 force_new_process_for_new_contents;
777 params.uses_post = uses_post; 780 params.uses_post = uses_post;
778 params.post_data = body; 781 params.post_data = body;
779 params.extra_headers = extra_headers; 782 params.extra_headers = extra_headers;
780 if (redirect_chain.size() > 0) 783 if (redirect_chain.size() > 0)
781 params.redirect_chain = redirect_chain; 784 params.redirect_chain = redirect_chain;
782 params.should_replace_current_entry = should_replace_current_entry; 785 params.should_replace_current_entry = should_replace_current_entry;
783 params.user_gesture = user_gesture; 786 params.user_gesture = user_gesture;
784 787
785 // RequestOpenURL is used only for local frames, so we can get here only if 788 // RequestOpenURL is used only for local frames, so we can get here only if
786 // the navigation is initiated by a frame in the same SiteInstance as this 789 // the navigation is initiated by a frame in the same SiteInstance as this
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
1293 if (navigation_handle) 1296 if (navigation_handle)
1294 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID()); 1297 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID());
1295 1298
1296 controller_->SetPendingEntry(std::move(entry)); 1299 controller_->SetPendingEntry(std::move(entry));
1297 if (delegate_) 1300 if (delegate_)
1298 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); 1301 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL);
1299 } 1302 }
1300 } 1303 }
1301 1304
1302 } // namespace content 1305 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigator_impl.h ('k') | content/browser/frame_host/render_frame_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698