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

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

Issue 1358153002: Issue AboutToNavigateRenderFrame notification after beforeunload handling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test fixes 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_manager.h" 5 #include "content/browser/frame_host/render_frame_host_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 DCHECK(!base::CommandLine::ForCurrentProcess()->HasSwitch( 545 DCHECK(!base::CommandLine::ForCurrentProcess()->HasSwitch(
546 switches::kEnableBrowserSideNavigation)); 546 switches::kEnableBrowserSideNavigation));
547 // Ignore if we're not in a cross-process navigation. 547 // Ignore if we're not in a cross-process navigation.
548 if (!pending_render_frame_host_) 548 if (!pending_render_frame_host_)
549 return; 549 return;
550 550
551 if (proceed) { 551 if (proceed) {
552 // Ok to unload the current page, so proceed with the cross-process 552 // Ok to unload the current page, so proceed with the cross-process
553 // navigation. Note that if navigations are not currently suspended, it 553 // navigation. Note that if navigations are not currently suspended, it
554 // might be because the renderer was deemed unresponsive and this call was 554 // might be because the renderer was deemed unresponsive and this call was
555 // already made by ShouldCloseTabOnUnresponsiveRenderer. In that case, it 555 // already made by ShouldCloseTabOnUnresponsiveRenderer. In that case, it
Charlie Reis 2015/09/22 23:12:10 What about this case (on line 533)? If the unresp
556 // is ok to do nothing here. 556 // is ok to do nothing here.
557 if (pending_render_frame_host_ && 557 if (pending_render_frame_host_ &&
558 pending_render_frame_host_->are_navigations_suspended()) { 558 pending_render_frame_host_->are_navigations_suspended()) {
559 NavigatorDelegate* navigator_delegate =
560 frame_tree_node_->navigator()->GetDelegate();
561 if (navigator_delegate &&
562 pending_render_frame_host_->ShouldDispatchBeforeUnload()) {
dgozman 2015/09/22 20:54:30 This unfortunate check is here to not issue notifi
Charlie Reis 2015/09/22 23:12:10 This is almost certainly not what you want to do.
dgozman 2015/09/22 23:27:55 See https://code.google.com/p/chromium/codesearch#
Charlie Reis 2015/09/22 23:56:42 The current implementation of ShouldDispatchBefore
563 navigator_delegate->AboutToNavigateRenderFrame(
Charlie Reis 2015/09/22 23:12:10 What if we moved AboutToNavigateRenderFrame to Ren
dgozman 2015/09/22 23:27:56 I was hesitant about moving notifications between
Charlie Reis 2015/09/22 23:56:42 Yep, it's fine. And even better if we can remove
564 render_frame_host_.get(), pending_render_frame_host_.get());
565 }
559 pending_render_frame_host_->SetNavigationsSuspended(false, 566 pending_render_frame_host_->SetNavigationsSuspended(false,
560 proceed_time); 567 proceed_time);
561 } 568 }
562 } else { 569 } else {
563 // Current page says to cancel. 570 // Current page says to cancel.
564 CancelPending(); 571 CancelPending();
565 } 572 }
566 } else { 573 } else {
567 // Non-cross-process transition means closing the entire tab. 574 // Non-cross-process transition means closing the entire tab.
568 bool proceed_to_fire_unload; 575 bool proceed_to_fire_unload;
(...skipping 2025 matching lines...) Expand 10 before | Expand all | Expand 10 after
2594 int RenderFrameHostManager::GetOpenerRoutingID(SiteInstance* instance) { 2601 int RenderFrameHostManager::GetOpenerRoutingID(SiteInstance* instance) {
2595 if (!frame_tree_node_->opener()) 2602 if (!frame_tree_node_->opener())
2596 return MSG_ROUTING_NONE; 2603 return MSG_ROUTING_NONE;
2597 2604
2598 return frame_tree_node_->opener() 2605 return frame_tree_node_->opener()
2599 ->render_manager() 2606 ->render_manager()
2600 ->GetRoutingIdForSiteInstance(instance); 2607 ->GetRoutingIdForSiteInstance(instance);
2601 } 2608 }
2602 2609
2603 } // namespace content 2610 } // namespace content
OLDNEW
« content/browser/frame_host/navigator_impl.cc ('K') | « content/browser/frame_host/navigator_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698