| OLD | NEW |
| 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 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 if (GetParent()) { | 521 if (GetParent()) { |
| 522 NOTREACHED() << "Should only receive BeforeUnload_ACK from the main frame."; | 522 NOTREACHED() << "Should only receive BeforeUnload_ACK from the main frame."; |
| 523 return; | 523 return; |
| 524 } | 524 } |
| 525 | 525 |
| 526 render_view_host_->decrement_in_flight_event_count(); | 526 render_view_host_->decrement_in_flight_event_count(); |
| 527 render_view_host_->StopHangMonitorTimeout(); | 527 render_view_host_->StopHangMonitorTimeout(); |
| 528 // If this renderer navigated while the beforeunload request was in flight, we | 528 // If this renderer navigated while the beforeunload request was in flight, we |
| 529 // may have cleared this state in OnNavigate, in which case we can ignore | 529 // may have cleared this state in OnNavigate, in which case we can ignore |
| 530 // this message. | 530 // this message. |
| 531 // However renderer might also be swapped out but we still want to proceed |
| 532 // with navigation, otherwise it would block whole web_contents. This can |
| 533 // happen when pending cross-site navigation is canceled by second one just |
| 534 // before OnNavigate, current (loaded) RVH is waiting for commit but second |
| 535 // navigation is started from the beginning. |
| 531 if (!render_view_host_->is_waiting_for_beforeunload_ack_ || | 536 if (!render_view_host_->is_waiting_for_beforeunload_ack_ || |
| 532 render_view_host_->rvh_state_ != RenderViewHostImpl::STATE_DEFAULT) { | 537 (render_view_host_->rvh_state_ != RenderViewHostImpl::STATE_DEFAULT && |
| 538 render_view_host_->rvh_state_ != |
| 539 RenderViewHostImpl::STATE_WAITING_FOR_COMMIT)) { |
| 533 return; | 540 return; |
| 534 } | 541 } |
| 535 | 542 |
| 536 render_view_host_->is_waiting_for_beforeunload_ack_ = false; | 543 render_view_host_->is_waiting_for_beforeunload_ack_ = false; |
| 537 | 544 |
| 538 base::TimeTicks before_unload_end_time; | 545 base::TimeTicks before_unload_end_time; |
| 539 if (!send_before_unload_start_time_.is_null() && | 546 if (!send_before_unload_start_time_.is_null() && |
| 540 !renderer_before_unload_start_time.is_null() && | 547 !renderer_before_unload_start_time.is_null() && |
| 541 !renderer_before_unload_end_time.is_null()) { | 548 !renderer_before_unload_end_time.is_null()) { |
| 542 // When passing TimeTicks across process boundaries, we need to compensate | 549 // When passing TimeTicks across process boundaries, we need to compensate |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 params.navigation_type = FrameMsg_Navigate_Type::NORMAL; | 685 params.navigation_type = FrameMsg_Navigate_Type::NORMAL; |
| 679 Navigate(params); | 686 Navigate(params); |
| 680 } | 687 } |
| 681 | 688 |
| 682 void RenderFrameHostImpl::SelectRange(const gfx::Point& start, | 689 void RenderFrameHostImpl::SelectRange(const gfx::Point& start, |
| 683 const gfx::Point& end) { | 690 const gfx::Point& end) { |
| 684 Send(new InputMsg_SelectRange(routing_id_, start, end)); | 691 Send(new InputMsg_SelectRange(routing_id_, start, end)); |
| 685 } | 692 } |
| 686 | 693 |
| 687 } // namespace content | 694 } // namespace content |
| OLD | NEW |