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

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

Issue 1340163002: PlzNavigate: fix timing issue in app window creation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@navigation-throttle
Patch Set: Addressed nits Created 5 years, 3 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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "content/browser/frame_host/frame_tree.h" 10 #include "content/browser/frame_host/frame_tree.h"
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 DCHECK(!render_frame_host->GetParent()); 731 DCHECK(!render_frame_host->GetParent());
732 render_frame_host->render_view_host()->Send( 732 render_frame_host->render_view_host()->Send(
733 new ViewMsg_EnableViewSourceMode( 733 new ViewMsg_EnableViewSourceMode(
734 render_frame_host->render_view_host()->GetRoutingID())); 734 render_frame_host->render_view_host()->GetRoutingID()));
735 } 735 }
736 736
737 CheckWebUIRendererDoesNotDisplayNormalURL( 737 CheckWebUIRendererDoesNotDisplayNormalURL(
738 render_frame_host, navigation_request->common_params().url); 738 render_frame_host, navigation_request->common_params().url);
739 739
740 navigation_request->TransferNavigationHandleOwnership(render_frame_host); 740 navigation_request->TransferNavigationHandleOwnership(render_frame_host);
741 delegate_->ReadyToCommitNavigation(render_frame_host->navigation_handle());
741 render_frame_host->CommitNavigation(response, body.Pass(), 742 render_frame_host->CommitNavigation(response, body.Pass(),
742 navigation_request->common_params(), 743 navigation_request->common_params(),
743 navigation_request->request_params()); 744 navigation_request->request_params());
744 745
745 } 746 }
746 747
747 // PlzNavigate 748 // PlzNavigate
748 void NavigatorImpl::FailedNavigation(FrameTreeNode* frame_tree_node, 749 void NavigatorImpl::FailedNavigation(FrameTreeNode* frame_tree_node,
749 bool has_stale_copy_in_cache, 750 bool has_stale_copy_in_cache,
750 int error_code) { 751 int error_code) {
(...skipping 10 matching lines...) Expand all
761 } 762 }
762 763
763 // Select an appropriate renderer to show the error page. 764 // Select an appropriate renderer to show the error page.
764 RenderFrameHostImpl* render_frame_host = 765 RenderFrameHostImpl* render_frame_host =
765 frame_tree_node->render_manager()->GetFrameHostForNavigation( 766 frame_tree_node->render_manager()->GetFrameHostForNavigation(
766 *navigation_request); 767 *navigation_request);
767 CheckWebUIRendererDoesNotDisplayNormalURL( 768 CheckWebUIRendererDoesNotDisplayNormalURL(
768 render_frame_host, navigation_request->common_params().url); 769 render_frame_host, navigation_request->common_params().url);
769 770
770 navigation_request->TransferNavigationHandleOwnership(render_frame_host); 771 navigation_request->TransferNavigationHandleOwnership(render_frame_host);
772 delegate_->ReadyToCommitNavigation(render_frame_host->navigation_handle());
771 render_frame_host->FailedNavigation(navigation_request->common_params(), 773 render_frame_host->FailedNavigation(navigation_request->common_params(),
772 navigation_request->request_params(), 774 navigation_request->request_params(),
773 has_stale_copy_in_cache, error_code); 775 has_stale_copy_in_cache, error_code);
774 } 776 }
775 777
776 // PlzNavigate 778 // PlzNavigate
777 void NavigatorImpl::CancelNavigation(FrameTreeNode* frame_tree_node) { 779 void NavigatorImpl::CancelNavigation(FrameTreeNode* frame_tree_node) {
778 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( 780 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch(
779 switches::kEnableBrowserSideNavigation)); 781 switches::kEnableBrowserSideNavigation));
780 frame_tree_node->ResetNavigationRequest(false); 782 frame_tree_node->ResetNavigationRequest(false);
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 entry->set_should_replace_entry(pending_entry->should_replace_entry()); 945 entry->set_should_replace_entry(pending_entry->should_replace_entry());
944 entry->SetRedirectChain(pending_entry->GetRedirectChain()); 946 entry->SetRedirectChain(pending_entry->GetRedirectChain());
945 } 947 }
946 controller_->SetPendingEntry(entry.Pass()); 948 controller_->SetPendingEntry(entry.Pass());
947 if (delegate_) 949 if (delegate_)
948 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); 950 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL);
949 } 951 }
950 } 952 }
951 953
952 } // namespace content 954 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigator_delegate.h ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698