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

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

Issue 1339803002: Clear page display after navigation if no rendered output arrives (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added test 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/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 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 // navigating already and sent it before hearing the FrameMsg_Stop message. 828 // navigating already and sent it before hearing the FrameMsg_Stop message.
829 // Treat this as an implicit beforeunload ack to allow the pending navigation 829 // Treat this as an implicit beforeunload ack to allow the pending navigation
830 // to continue. 830 // to continue.
831 if (is_waiting_for_beforeunload_ack_ && 831 if (is_waiting_for_beforeunload_ack_ &&
832 unload_ack_is_for_navigation_ && 832 unload_ack_is_for_navigation_ &&
833 !GetParent()) { 833 !GetParent()) {
834 base::TimeTicks approx_renderer_start_time = send_before_unload_start_time_; 834 base::TimeTicks approx_renderer_start_time = send_before_unload_start_time_;
835 OnBeforeUnloadACK(true, approx_renderer_start_time, base::TimeTicks::Now()); 835 OnBeforeUnloadACK(true, approx_renderer_start_time, base::TimeTicks::Now());
836 } 836 }
837 837
838 // For a top-level frame, there are potential security concerns associated
839 // with displaying graphics from a previously loaded page after the URL in
840 // the omnibar has been changed. It is unappealing to clear the page
841 // immediately, but if the renderer is taking a long time to issue any
842 // compositor output (possibly because of script deliberately creating this
843 // situation) then we clear it after a while anyway.
844 // See https://crbug.com/497588.
845 if (frame_tree_node_->IsMainFrame() && GetView()) {
846 RenderWidgetHostImpl::From(GetView()->GetRenderWidgetHost())
847 ->StartNewContentRenderingTimeout();
848 }
849
838 // If we're waiting for an unload ack from this renderer and we receive a 850 // If we're waiting for an unload ack from this renderer and we receive a
839 // Navigate message, then the renderer was navigating before it received the 851 // Navigate message, then the renderer was navigating before it received the
840 // unload request. It will either respond to the unload request soon or our 852 // unload request. It will either respond to the unload request soon or our
841 // timer will expire. Either way, we should ignore this message, because we 853 // timer will expire. Either way, we should ignore this message, because we
842 // have already committed to closing this renderer. 854 // have already committed to closing this renderer.
843 if (IsWaitingForUnloadACK()) 855 if (IsWaitingForUnloadACK())
844 return; 856 return;
845 857
846 if (validated_params.report_type == 858 if (validated_params.report_type ==
847 FrameMsg_UILoadMetricsReportType::REPORT_LINK) { 859 FrameMsg_UILoadMetricsReportType::REPORT_LINK) {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
906 // Synchronous renderer-initiated navigations will send a 918 // Synchronous renderer-initiated navigations will send a
907 // DidCommitProvisionalLoad IPC without a prior DidStartProvisionalLoad 919 // DidCommitProvisionalLoad IPC without a prior DidStartProvisionalLoad
908 // message. 920 // message.
909 if (!navigation_handle_) { 921 if (!navigation_handle_) {
910 navigation_handle_ = NavigationHandleImpl::Create( 922 navigation_handle_ = NavigationHandleImpl::Create(
911 validated_params.url, frame_tree_node_->IsMainFrame(), 923 validated_params.url, frame_tree_node_->IsMainFrame(),
912 frame_tree_node_->navigator()->GetDelegate()); 924 frame_tree_node_->navigator()->GetDelegate());
913 } 925 }
914 926
915 accessibility_reset_count_ = 0; 927 accessibility_reset_count_ = 0;
916 frame_tree_node()->navigator()->DidNavigate(this, validated_params); 928 frame_tree_node()->navigator()->DidNavigate(this, validated_params);
Charlie Reis 2015/09/14 20:54:55 This is the line that changes the address bar. Th
kenrb 2015/09/14 21:29:36 Done.
917 929
918 // PlzNavigate 930 // PlzNavigate
919 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 931 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
920 switches::kEnableBrowserSideNavigation)) { 932 switches::kEnableBrowserSideNavigation)) {
921 pending_commit_ = false; 933 pending_commit_ = false;
922 } 934 }
923 } 935 }
924 936
925 void RenderFrameHostImpl::OnDidDropNavigation() { 937 void RenderFrameHostImpl::OnDidDropNavigation() {
926 // At the end of Navigate(), the FrameTreeNode's DidStartLoading is called to 938 // At the end of Navigate(), the FrameTreeNode's DidStartLoading is called to
(...skipping 1298 matching lines...) Expand 10 before | Expand all | Expand 10 after
2225 BrowserPluginInstanceIDToAXTreeID(value))); 2237 BrowserPluginInstanceIDToAXTreeID(value)));
2226 break; 2238 break;
2227 case AX_CONTENT_INT_ATTRIBUTE_LAST: 2239 case AX_CONTENT_INT_ATTRIBUTE_LAST:
2228 NOTREACHED(); 2240 NOTREACHED();
2229 break; 2241 break;
2230 } 2242 }
2231 } 2243 }
2232 } 2244 }
2233 2245
2234 } // namespace content 2246 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698