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

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

Issue 215073002: WebContents could be blocked after pending cross-site navigation is canceled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert RFH::SwapOut() change Created 6 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
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/containers/hash_tables.h" 7 #include "base/containers/hash_tables.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/metrics/user_metrics_action.h" 9 #include "base/metrics/user_metrics_action.h"
10 #include "content/browser/child_process_security_policy_impl.h" 10 #include "content/browser/child_process_security_policy_impl.h"
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 if (GetParent()) { 558 if (GetParent()) {
559 NOTREACHED() << "Should only receive BeforeUnload_ACK from the main frame."; 559 NOTREACHED() << "Should only receive BeforeUnload_ACK from the main frame.";
560 return; 560 return;
561 } 561 }
562 562
563 render_view_host_->decrement_in_flight_event_count(); 563 render_view_host_->decrement_in_flight_event_count();
564 render_view_host_->StopHangMonitorTimeout(); 564 render_view_host_->StopHangMonitorTimeout();
565 // If this renderer navigated while the beforeunload request was in flight, we 565 // If this renderer navigated while the beforeunload request was in flight, we
566 // may have cleared this state in OnNavigate, in which case we can ignore 566 // may have cleared this state in OnNavigate, in which case we can ignore
567 // this message. 567 // this message.
568 if (!render_view_host_->is_waiting_for_beforeunload_ack_ || 568 // However renderer might also be swapped out but we still want to proceed
569 render_view_host_->rvh_state_ != RenderViewHostImpl::STATE_DEFAULT) { 569 // with navigation, otherwise it would block future navigations. This can
570 // happen when pending cross-site navigation is canceled by a second one just
571 // before OnNavigate while current RVH is waiting for commit but second
572 // navigation is started from the beginning.
573 if (!render_view_host_->is_waiting_for_beforeunload_ack_) {
570 return; 574 return;
571 } 575 }
572 576
573 render_view_host_->is_waiting_for_beforeunload_ack_ = false; 577 render_view_host_->is_waiting_for_beforeunload_ack_ = false;
574 578
575 base::TimeTicks before_unload_end_time; 579 base::TimeTicks before_unload_end_time;
576 if (!send_before_unload_start_time_.is_null() && 580 if (!send_before_unload_start_time_.is_null() &&
577 !renderer_before_unload_start_time.is_null() && 581 !renderer_before_unload_start_time.is_null() &&
578 !renderer_before_unload_end_time.is_null()) { 582 !renderer_before_unload_end_time.is_null()) {
579 // When passing TimeTicks across process boundaries, we need to compensate 583 // When passing TimeTicks across process boundaries, we need to compensate
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 const gfx::Point& end) { 729 const gfx::Point& end) {
726 Send(new InputMsg_SelectRange(routing_id_, start, end)); 730 Send(new InputMsg_SelectRange(routing_id_, start, end));
727 } 731 }
728 732
729 void RenderFrameHostImpl::ExtendSelectionAndDelete(size_t before, 733 void RenderFrameHostImpl::ExtendSelectionAndDelete(size_t before,
730 size_t after) { 734 size_t after) {
731 Send(new FrameMsg_ExtendSelectionAndDelete(routing_id_, before, after)); 735 Send(new FrameMsg_ExtendSelectionAndDelete(routing_id_, before, after));
732 } 736 }
733 737
734 } // namespace content 738 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698