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

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

Issue 790843002: If the renderer drops a navigation, make sure the spinner doesn't spin endlessly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test Created 6 years 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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 IPC_MESSAGE_HANDLER(FrameHostMsg_Detach, OnDetach) 296 IPC_MESSAGE_HANDLER(FrameHostMsg_Detach, OnDetach)
297 IPC_MESSAGE_HANDLER(FrameHostMsg_FrameFocused, OnFrameFocused) 297 IPC_MESSAGE_HANDLER(FrameHostMsg_FrameFocused, OnFrameFocused)
298 IPC_MESSAGE_HANDLER(FrameHostMsg_DidStartProvisionalLoadForFrame, 298 IPC_MESSAGE_HANDLER(FrameHostMsg_DidStartProvisionalLoadForFrame,
299 OnDidStartProvisionalLoadForFrame) 299 OnDidStartProvisionalLoadForFrame)
300 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFailProvisionalLoadWithError, 300 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFailProvisionalLoadWithError,
301 OnDidFailProvisionalLoadWithError) 301 OnDidFailProvisionalLoadWithError)
302 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFailLoadWithError, 302 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFailLoadWithError,
303 OnDidFailLoadWithError) 303 OnDidFailLoadWithError)
304 IPC_MESSAGE_HANDLER_GENERIC(FrameHostMsg_DidCommitProvisionalLoad, 304 IPC_MESSAGE_HANDLER_GENERIC(FrameHostMsg_DidCommitProvisionalLoad,
305 OnDidCommitProvisionalLoad(msg)) 305 OnDidCommitProvisionalLoad(msg))
306 IPC_MESSAGE_HANDLER(FrameHostMsg_DidDropNavigation, OnDidDropNavigation)
306 IPC_MESSAGE_HANDLER(FrameHostMsg_OpenURL, OnOpenURL) 307 IPC_MESSAGE_HANDLER(FrameHostMsg_OpenURL, OnOpenURL)
307 IPC_MESSAGE_HANDLER(FrameHostMsg_DocumentOnLoadCompleted, 308 IPC_MESSAGE_HANDLER(FrameHostMsg_DocumentOnLoadCompleted,
308 OnDocumentOnLoadCompleted) 309 OnDocumentOnLoadCompleted)
309 IPC_MESSAGE_HANDLER(FrameHostMsg_BeforeUnload_ACK, OnBeforeUnloadACK) 310 IPC_MESSAGE_HANDLER(FrameHostMsg_BeforeUnload_ACK, OnBeforeUnloadACK)
310 IPC_MESSAGE_HANDLER(FrameHostMsg_SwapOut_ACK, OnSwapOutACK) 311 IPC_MESSAGE_HANDLER(FrameHostMsg_SwapOut_ACK, OnSwapOutACK)
311 IPC_MESSAGE_HANDLER(FrameHostMsg_ContextMenu, OnContextMenu) 312 IPC_MESSAGE_HANDLER(FrameHostMsg_ContextMenu, OnContextMenu)
312 IPC_MESSAGE_HANDLER(FrameHostMsg_JavaScriptExecuteResponse, 313 IPC_MESSAGE_HANDLER(FrameHostMsg_JavaScriptExecuteResponse,
313 OnJavaScriptExecuteResponse) 314 OnJavaScriptExecuteResponse)
314 IPC_MESSAGE_HANDLER_DELAY_REPLY(FrameHostMsg_RunJavaScriptMessage, 315 IPC_MESSAGE_HANDLER_DELAY_REPLY(FrameHostMsg_RunJavaScriptMessage,
315 OnRunJavaScriptMessage) 316 OnRunJavaScriptMessage)
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 if (!render_view_host_->CanAccessFilesOfPageState( 697 if (!render_view_host_->CanAccessFilesOfPageState(
697 validated_params.page_state)) { 698 validated_params.page_state)) {
698 GetProcess()->ReceivedBadMessage(); 699 GetProcess()->ReceivedBadMessage();
699 return; 700 return;
700 } 701 }
701 702
702 accessibility_reset_count_ = 0; 703 accessibility_reset_count_ = 0;
703 frame_tree_node()->navigator()->DidNavigate(this, validated_params); 704 frame_tree_node()->navigator()->DidNavigate(this, validated_params);
704 } 705 }
705 706
707 void RenderFrameHostImpl::OnDidDropNavigation() {
708 // At the end of Navigate(), the delegate's DidStartLoading is called to force
709 // the spinner to start, even if the renderer didn't yet begin the load. If it
710 // turns out that the renderer dropped the navigation, we need to turn off the
711 // spinner.
712 delegate_->DidStopLoading(this);
713 }
714
706 RenderWidgetHostImpl* RenderFrameHostImpl::GetRenderWidgetHost() { 715 RenderWidgetHostImpl* RenderFrameHostImpl::GetRenderWidgetHost() {
707 return static_cast<RenderWidgetHostImpl*>(render_view_host_); 716 return static_cast<RenderWidgetHostImpl*>(render_view_host_);
708 } 717 }
709 718
710 int RenderFrameHostImpl::GetEnabledBindings() { 719 int RenderFrameHostImpl::GetEnabledBindings() {
711 return render_view_host_->GetEnabledBindings(); 720 return render_view_host_->GetEnabledBindings();
712 } 721 }
713 722
714 void RenderFrameHostImpl::OnCrossSiteResponse( 723 void RenderFrameHostImpl::OnCrossSiteResponse(
715 const GlobalRequestID& global_request_id, 724 const GlobalRequestID& global_request_id,
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after
1576 void RenderFrameHostImpl::DidUseGeolocationPermission() { 1585 void RenderFrameHostImpl::DidUseGeolocationPermission() {
1577 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); 1586 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame();
1578 GetContentClient()->browser()->RegisterPermissionUsage( 1587 GetContentClient()->browser()->RegisterPermissionUsage(
1579 PERMISSION_GEOLOCATION, 1588 PERMISSION_GEOLOCATION,
1580 delegate_->GetAsWebContents(), 1589 delegate_->GetAsWebContents(),
1581 GetLastCommittedURL().GetOrigin(), 1590 GetLastCommittedURL().GetOrigin(),
1582 top_frame->GetLastCommittedURL().GetOrigin()); 1591 top_frame->GetLastCommittedURL().GetOrigin());
1583 } 1592 }
1584 1593
1585 } // namespace content 1594 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.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