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

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

Issue 1048463004: PlzNavigate: track pending commits (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed DCHECK + rebase Created 5 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/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 cross_process_frame_connector_(NULL), 144 cross_process_frame_connector_(NULL),
145 render_frame_proxy_host_(NULL), 145 render_frame_proxy_host_(NULL),
146 frame_tree_(frame_tree), 146 frame_tree_(frame_tree),
147 frame_tree_node_(frame_tree_node), 147 frame_tree_node_(frame_tree_node),
148 routing_id_(routing_id), 148 routing_id_(routing_id),
149 render_frame_created_(false), 149 render_frame_created_(false),
150 navigations_suspended_(false), 150 navigations_suspended_(false),
151 is_waiting_for_beforeunload_ack_(false), 151 is_waiting_for_beforeunload_ack_(false),
152 unload_ack_is_for_navigation_(false), 152 unload_ack_is_for_navigation_(false),
153 is_loading_(false), 153 is_loading_(false),
154 pending_commit_(false),
154 accessibility_reset_token_(0), 155 accessibility_reset_token_(0),
155 accessibility_reset_count_(0), 156 accessibility_reset_count_(0),
156 no_create_browser_accessibility_manager_for_testing_(false), 157 no_create_browser_accessibility_manager_for_testing_(false),
157 weak_ptr_factory_(this) { 158 weak_ptr_factory_(this) {
158 bool is_swapped_out = !!(flags & CREATE_RF_SWAPPED_OUT); 159 bool is_swapped_out = !!(flags & CREATE_RF_SWAPPED_OUT);
159 bool hidden = !!(flags & CREATE_RF_HIDDEN); 160 bool hidden = !!(flags & CREATE_RF_HIDDEN);
160 frame_tree_->RegisterRenderFrameHost(this); 161 frame_tree_->RegisterRenderFrameHost(this);
161 GetProcess()->AddRoute(routing_id_, this); 162 GetProcess()->AddRoute(routing_id_, this);
162 g_routing_id_frame_map.Get().insert(std::make_pair( 163 g_routing_id_frame_map.Get().insert(std::make_pair(
163 RenderFrameHostID(GetProcess()->GetID(), routing_id_), 164 RenderFrameHostID(GetProcess()->GetID(), routing_id_),
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 // filenames it can't access in a future session restore. 836 // filenames it can't access in a future session restore.
836 if (!render_view_host_->CanAccessFilesOfPageState( 837 if (!render_view_host_->CanAccessFilesOfPageState(
837 validated_params.page_state)) { 838 validated_params.page_state)) {
838 bad_message::ReceivedBadMessage( 839 bad_message::ReceivedBadMessage(
839 GetProcess(), bad_message::RFH_CAN_ACCESS_FILES_OF_PAGE_STATE); 840 GetProcess(), bad_message::RFH_CAN_ACCESS_FILES_OF_PAGE_STATE);
840 return; 841 return;
841 } 842 }
842 843
843 accessibility_reset_count_ = 0; 844 accessibility_reset_count_ = 0;
844 frame_tree_node()->navigator()->DidNavigate(this, validated_params); 845 frame_tree_node()->navigator()->DidNavigate(this, validated_params);
846
847 // PlzNavigate
848 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
849 switches::kEnableBrowserSideNavigation)) {
850 pending_commit_ = false;
851 }
845 } 852 }
846 853
847 void RenderFrameHostImpl::OnDidDropNavigation() { 854 void RenderFrameHostImpl::OnDidDropNavigation() {
848 // At the end of Navigate(), the delegate's DidStartLoading is called to force 855 // At the end of Navigate(), the delegate's DidStartLoading is called to force
849 // the spinner to start, even if the renderer didn't yet begin the load. If it 856 // the spinner to start, even if the renderer didn't yet begin the load. If it
850 // turns out that the renderer dropped the navigation, we need to turn off the 857 // turns out that the renderer dropped the navigation, we need to turn off the
851 // spinner. 858 // spinner.
852 delegate_->DidStopLoading(); 859 delegate_->DidStopLoading();
853 } 860 }
854 861
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after
1732 const ResourceResponseHead head = response ? 1739 const ResourceResponseHead head = response ?
1733 response->head : ResourceResponseHead(); 1740 response->head : ResourceResponseHead();
1734 Send(new FrameMsg_CommitNavigation(routing_id_, head, body_url, common_params, 1741 Send(new FrameMsg_CommitNavigation(routing_id_, head, body_url, common_params,
1735 request_params)); 1742 request_params));
1736 // TODO(clamy): Check if we should start the throbber for non javascript urls 1743 // TODO(clamy): Check if we should start the throbber for non javascript urls
1737 // here. 1744 // here.
1738 1745
1739 // TODO(clamy): Release the stream handle once the renderer has finished 1746 // TODO(clamy): Release the stream handle once the renderer has finished
1740 // reading it. 1747 // reading it.
1741 stream_handle_ = body.Pass(); 1748 stream_handle_ = body.Pass();
1749 pending_commit_ = true;
1742 } 1750 }
1743 1751
1744 void RenderFrameHostImpl::SetUpMojoIfNeeded() { 1752 void RenderFrameHostImpl::SetUpMojoIfNeeded() {
1745 if (service_registry_.get()) 1753 if (service_registry_.get())
1746 return; 1754 return;
1747 1755
1748 service_registry_.reset(new ServiceRegistryImpl()); 1756 service_registry_.reset(new ServiceRegistryImpl());
1749 if (!GetProcess()->GetServiceRegistry()) 1757 if (!GetProcess()->GetServiceRegistry())
1750 return; 1758 return;
1751 1759
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
1988 return; 1996 return;
1989 1997
1990 permission_manager->RegisterPermissionUsage( 1998 permission_manager->RegisterPermissionUsage(
1991 PermissionType::GEOLOCATION, 1999 PermissionType::GEOLOCATION,
1992 GetLastCommittedURL().GetOrigin(), 2000 GetLastCommittedURL().GetOrigin(),
1993 frame_tree_node()->frame_tree()->GetMainFrame() 2001 frame_tree_node()->frame_tree()->GetMainFrame()
1994 ->GetLastCommittedURL().GetOrigin()); 2002 ->GetLastCommittedURL().GetOrigin());
1995 } 2003 }
1996 2004
1997 } // namespace content 2005 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698