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

Unified Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 2803633004: Revert of Keep track in the browser of which frames have onunload and onbeforeunload handlers. (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/frame_host/render_frame_host_impl.cc
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index 61cd6ca6a8bb3ef3fe4f1ea6e608e7130e4bad9c..acb7916dafaa6adc64f982046ca89ddb0ebc838d 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -378,8 +378,6 @@
is_waiting_for_swapout_ack_(false),
render_frame_created_(false),
navigations_suspended_(false),
- has_beforeunload_handlers_(false),
- has_unload_handlers_(false),
is_waiting_for_beforeunload_ack_(false),
unload_ack_is_for_navigation_(false),
is_loading_(false),
@@ -753,10 +751,6 @@
IPC_MESSAGE_HANDLER(FrameHostMsg_DocumentOnLoadCompleted,
OnDocumentOnLoadCompleted)
IPC_MESSAGE_HANDLER(FrameHostMsg_BeforeUnload_ACK, OnBeforeUnloadACK)
- IPC_MESSAGE_HANDLER(FrameHostMsg_BeforeUnloadHandlersPresent,
- OnBeforeUnloadHandlersPresent)
- IPC_MESSAGE_HANDLER(FrameHostMsg_UnloadHandlersPresent,
- OnUnloadHandlersPresent)
IPC_MESSAGE_HANDLER(FrameHostMsg_SwapOut_ACK, OnSwapOutACK)
IPC_MESSAGE_HANDLER(FrameHostMsg_ContextMenu, OnContextMenu)
IPC_MESSAGE_HANDLER(FrameHostMsg_JavaScriptExecuteResponse,
@@ -2379,14 +2373,6 @@
frame_tree_node_->OnSetHasReceivedUserGesture();
}
-void RenderFrameHostImpl::OnBeforeUnloadHandlersPresent(bool present) {
- has_beforeunload_handlers_ = present;
-}
-
-void RenderFrameHostImpl::OnUnloadHandlersPresent(bool present) {
- has_unload_handlers_ = present;
-}
-
#if BUILDFLAG(USE_EXTERNAL_POPUP_MENU)
void RenderFrameHostImpl::OnShowPopup(
const FrameHostMsg_ShowPopup_Params& params) {
@@ -2715,25 +2701,7 @@
}
bool RenderFrameHostImpl::ShouldDispatchBeforeUnload() {
- if (!IsRenderFrameLive())
- return false;
-
- for (FrameTreeNode* node : frame_tree_->SubtreeNodes(frame_tree_node_)) {
- if (node->current_frame_host()->has_beforeunload_handlers_)
- return true;
- }
- return false;
-}
-
-bool RenderFrameHostImpl::ShouldDispatchUnload() {
- if (!IsRenderFrameLive())
- return false;
-
- for (FrameTreeNode* node : frame_tree_->SubtreeNodes(frame_tree_node_)) {
- if (node->current_frame_host()->has_unload_handlers_)
- return true;
- }
- return false;
+ return IsRenderFrameLive();
}
void RenderFrameHostImpl::UpdateOpener() {
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.h ('k') | 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