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

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

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 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 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_
6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 void DispatchBeforeUnload(bool for_navigation, bool is_reload); 424 void DispatchBeforeUnload(bool for_navigation, bool is_reload);
425 425
426 // Simulate beforeunload ack on behalf of renderer if it's unrenresponsive. 426 // Simulate beforeunload ack on behalf of renderer if it's unrenresponsive.
427 void SimulateBeforeUnloadAck(); 427 void SimulateBeforeUnloadAck();
428 428
429 // Returns true if a call to DispatchBeforeUnload will actually send the 429 // Returns true if a call to DispatchBeforeUnload will actually send the
430 // BeforeUnload IPC. This is the case if the current renderer is live and this 430 // BeforeUnload IPC. This is the case if the current renderer is live and this
431 // frame is the main frame. 431 // frame is the main frame.
432 bool ShouldDispatchBeforeUnload(); 432 bool ShouldDispatchBeforeUnload();
433 433
434 // Returns true if the frame or any of its descendents have an onunload
435 // handler.
436 bool ShouldDispatchUnload();
437
438 // Update the frame's opener in the renderer process in response to the 434 // Update the frame's opener in the renderer process in response to the
439 // opener being modified (e.g., with window.open or being set to null) in 435 // opener being modified (e.g., with window.open or being set to null) in
440 // another renderer process. 436 // another renderer process.
441 void UpdateOpener(); 437 void UpdateOpener();
442 438
443 // Set this frame as focused in the renderer process. This supports 439 // Set this frame as focused in the renderer process. This supports
444 // cross-process window.focus() calls. 440 // cross-process window.focus() calls.
445 void SetFocusedFrame(); 441 void SetFocusedFrame();
446 442
447 // Continues sequential focus navigation in this frame. |source_proxy| 443 // Continues sequential focus navigation in this frame. |source_proxy|
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 const AccessibilityHostMsg_FindInPageResultParams& params); 756 const AccessibilityHostMsg_FindInPageResultParams& params);
761 void OnAccessibilityChildFrameHitTestResult(const gfx::Point& point, 757 void OnAccessibilityChildFrameHitTestResult(const gfx::Point& point,
762 int hit_obj_id); 758 int hit_obj_id);
763 void OnAccessibilitySnapshotResponse( 759 void OnAccessibilitySnapshotResponse(
764 int callback_id, 760 int callback_id,
765 const AXContentTreeUpdate& snapshot); 761 const AXContentTreeUpdate& snapshot);
766 void OnSmartClipDataExtracted(uint32_t id, 762 void OnSmartClipDataExtracted(uint32_t id,
767 base::string16 text, 763 base::string16 text,
768 base::string16 html); 764 base::string16 html);
769 void OnToggleFullscreen(bool enter_fullscreen); 765 void OnToggleFullscreen(bool enter_fullscreen);
770 void OnBeforeUnloadHandlersPresent(bool present);
771 void OnUnloadHandlersPresent(bool present);
772 void OnDidStartLoading(bool to_different_document); 766 void OnDidStartLoading(bool to_different_document);
773 void OnDidStopLoading(); 767 void OnDidStopLoading();
774 void OnDidChangeLoadProgress(double load_progress); 768 void OnDidChangeLoadProgress(double load_progress);
775 void OnSerializeAsMHTMLResponse( 769 void OnSerializeAsMHTMLResponse(
776 int job_id, 770 int job_id,
777 MhtmlSaveStatus save_status, 771 MhtmlSaveStatus save_status,
778 const std::set<std::string>& digests_of_uris_of_serialized_resources, 772 const std::set<std::string>& digests_of_uris_of_serialized_resources,
779 base::TimeDelta renderer_main_thread_time); 773 base::TimeDelta renderer_main_thread_time);
780 void OnSelectionChanged(const base::string16& text, 774 void OnSelectionChanged(const base::string16& text,
781 uint32_t offset, 775 uint32_t offset,
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 // this RFH is the pending RenderFrameHost of a RenderFrameHostManager. There 987 // this RFH is the pending RenderFrameHost of a RenderFrameHostManager. There
994 // will only ever be one suspended navigation, because RenderFrameHostManager 988 // will only ever be one suspended navigation, because RenderFrameHostManager
995 // will destroy the pending RenderFrameHost and create a new one if a second 989 // will destroy the pending RenderFrameHost and create a new one if a second
996 // navigation occurs. 990 // navigation occurs.
997 // PlzNavigate: unused as navigations are never suspended. 991 // PlzNavigate: unused as navigations are never suspended.
998 std::unique_ptr<NavigationParams> suspended_nav_params_; 992 std::unique_ptr<NavigationParams> suspended_nav_params_;
999 993
1000 // When the last BeforeUnload message was sent. 994 // When the last BeforeUnload message was sent.
1001 base::TimeTicks send_before_unload_start_time_; 995 base::TimeTicks send_before_unload_start_time_;
1002 996
1003 // Used to track whether the frame has onbeforeunload and onunload handlers
1004 bool has_beforeunload_handlers_;
1005 bool has_unload_handlers_;
1006
1007 // Set to true when there is a pending FrameMsg_BeforeUnload message. This 997 // Set to true when there is a pending FrameMsg_BeforeUnload message. This
1008 // ensures we don't spam the renderer with multiple beforeunload requests. 998 // ensures we don't spam the renderer with multiple beforeunload requests.
1009 // When either this value or IsWaitingForUnloadACK is true, the value of 999 // When either this value or IsWaitingForUnloadACK is true, the value of
1010 // unload_ack_is_for_cross_site_transition_ indicates whether this is for a 1000 // unload_ack_is_for_cross_site_transition_ indicates whether this is for a
1011 // cross-site transition or a tab close attempt. 1001 // cross-site transition or a tab close attempt.
1012 // TODO(clamy): Remove this boolean and add one more state to the state 1002 // TODO(clamy): Remove this boolean and add one more state to the state
1013 // machine. 1003 // machine.
1014 bool is_waiting_for_beforeunload_ack_; 1004 bool is_waiting_for_beforeunload_ack_;
1015 1005
1016 // Valid only when is_waiting_for_beforeunload_ack_ or 1006 // Valid only when is_waiting_for_beforeunload_ack_ or
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
1176 1166
1177 // NOTE: This must be the last member. 1167 // NOTE: This must be the last member.
1178 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; 1168 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_;
1179 1169
1180 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); 1170 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl);
1181 }; 1171 };
1182 1172
1183 } // namespace content 1173 } // namespace content
1184 1174
1185 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ 1175 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigator_impl_unittest.cc ('k') | content/browser/frame_host/render_frame_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698