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

Side by Side Diff: content/browser/renderer_host/render_widget_host_impl.h

Issue 2384813002: Don't wait to close tabs waiting for JavaScript dialogs. (Closed)
Patch Set: fix Created 4 years, 2 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 // the new one will only fire if it has a shorter delay than the time 294 // the new one will only fire if it has a shorter delay than the time
295 // left on the existing timeouts. 295 // left on the existing timeouts.
296 void StartHangMonitorTimeout( 296 void StartHangMonitorTimeout(
297 base::TimeDelta delay, 297 base::TimeDelta delay,
298 RenderWidgetHostDelegate::RendererUnresponsiveType hang_monitor_reason); 298 RenderWidgetHostDelegate::RendererUnresponsiveType hang_monitor_reason);
299 299
300 // Stops all existing hang monitor timeouts and assumes the renderer is 300 // Stops all existing hang monitor timeouts and assumes the renderer is
301 // responsive. 301 // responsive.
302 void StopHangMonitorTimeout(); 302 void StopHangMonitorTimeout();
303 303
304 // Marks the renderer as being known-unresponsive, so that the hang monitor
305 // doesn't wait for responses.
306 void SetHangMonitorKnownUnresponsive(bool unresponsive);
307
304 // Starts the rendering timeout, which will clear displayed graphics if 308 // Starts the rendering timeout, which will clear displayed graphics if
305 // a new compositor frame is not received before it expires. 309 // a new compositor frame is not received before it expires.
306 void StartNewContentRenderingTimeout(); 310 void StartNewContentRenderingTimeout();
307 311
308 // Notification that a new compositor frame has been generated following 312 // Notification that a new compositor frame has been generated following
309 // a page load. This stops |new_content_rendering_timeout_|, or prevents 313 // a page load. This stops |new_content_rendering_timeout_|, or prevents
310 // the timer from running if the load commit message hasn't been received 314 // the timer from running if the load commit message hasn't been received
311 // yet. 315 // yet.
312 void OnFirstPaintAfterLoad(); 316 void OnFirstPaintAfterLoad();
313 317
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 bool is_focused_; 830 bool is_focused_;
827 831
828 // Whether the view should send begin frame messages to its render widget. 832 // Whether the view should send begin frame messages to its render widget.
829 // This is state that may arrive before the view has been set and that must be 833 // This is state that may arrive before the view has been set and that must be
830 // consistent with the state in the renderer, so this host handles it. 834 // consistent with the state in the renderer, so this host handles it.
831 bool needs_begin_frames_ = false; 835 bool needs_begin_frames_ = false;
832 836
833 // This value indicates how long to wait before we consider a renderer hung. 837 // This value indicates how long to wait before we consider a renderer hung.
834 base::TimeDelta hung_renderer_delay_; 838 base::TimeDelta hung_renderer_delay_;
835 839
840 // This is the number of calls to SetHangMonitorKnownUnresponsive.
841 int known_unresponsive_renderer_count_ = 0;
Charlie Reis 2016/10/05 22:00:59 When would this be more than one?
842
836 // Stores the reason the hang_monitor_timeout_ has been started. Used to 843 // Stores the reason the hang_monitor_timeout_ has been started. Used to
837 // report histograms if the renderer is hung. 844 // report histograms if the renderer is hung.
838 RenderWidgetHostDelegate::RendererUnresponsiveType hang_monitor_reason_; 845 RenderWidgetHostDelegate::RendererUnresponsiveType hang_monitor_reason_;
839 846
840 // This value indicates how long to wait for a new compositor frame from a 847 // This value indicates how long to wait for a new compositor frame from a
841 // renderer process before clearing any previously displayed content. 848 // renderer process before clearing any previously displayed content.
842 base::TimeDelta new_content_rendering_delay_; 849 base::TimeDelta new_content_rendering_delay_;
843 850
844 #if defined(OS_MACOSX) 851 #if defined(OS_MACOSX)
845 std::unique_ptr<device::PowerSaveBlocker> power_save_blocker_; 852 std::unique_ptr<device::PowerSaveBlocker> power_save_blocker_;
846 #endif 853 #endif
847 854
848 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; 855 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_;
849 856
850 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); 857 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl);
851 }; 858 };
852 859
853 } // namespace content 860 } // namespace content
854 861
855 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ 862 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698