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

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

Issue 2707243005: Discard compositor frames from unloaded web content (Closed)
Patch Set: Improved comments Created 3 years, 9 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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 // left on the existing timeouts. 324 // left on the existing timeouts.
325 void StartHangMonitorTimeout(base::TimeDelta delay, 325 void StartHangMonitorTimeout(base::TimeDelta delay,
326 blink::WebInputEvent::Type event_type, 326 blink::WebInputEvent::Type event_type,
327 RendererUnresponsiveType hang_monitor_reason); 327 RendererUnresponsiveType hang_monitor_reason);
328 328
329 // Stops all existing hang monitor timeouts and assumes the renderer is 329 // Stops all existing hang monitor timeouts and assumes the renderer is
330 // responsive. 330 // responsive.
331 void StopHangMonitorTimeout(); 331 void StopHangMonitorTimeout();
332 332
333 // Starts the rendering timeout, which will clear displayed graphics if 333 // Starts the rendering timeout, which will clear displayed graphics if
334 // a new compositor frame is not received before it expires. 334 // a new compositor frame is not received before it expires. This also causes
335 void StartNewContentRenderingTimeout(); 335 // any new compositor frames received with content_source_id less than
336 // |next_source_id| to be discarded.
337 void StartNewContentRenderingTimeout(uint32_t next_source_id);
336 338
337 // Notification that a new compositor frame has been generated following 339 // Notification that a new compositor frame has been generated following
338 // a page load. This stops |new_content_rendering_timeout_|, or prevents 340 // a page load. This stops |new_content_rendering_timeout_|, or prevents
339 // the timer from running if the load commit message hasn't been received 341 // the timer from running if the load commit message hasn't been received
340 // yet. 342 // yet.
341 void OnFirstPaintAfterLoad(); 343 void OnFirstPaintAfterLoad();
342 344
343 // Forwards the keyboard event with optional commands to the renderer. If 345 // Forwards the keyboard event with optional commands to the renderer. If
344 // |key_event| is not forwarded for any reason, then |commands| are ignored. 346 // |key_event| is not forwarded for any reason, then |commands| are ignored.
345 void ForwardKeyboardEventWithCommands( 347 void ForwardKeyboardEventWithCommands(
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
888 // Type of the last blocking event that started the hang monitor. 890 // Type of the last blocking event that started the hang monitor.
889 blink::WebInputEvent::Type hang_monitor_event_type_; 891 blink::WebInputEvent::Type hang_monitor_event_type_;
890 892
891 // Type of the last blocking event sent to the renderer. 893 // Type of the last blocking event sent to the renderer.
892 blink::WebInputEvent::Type last_event_type_; 894 blink::WebInputEvent::Type last_event_type_;
893 895
894 // This value indicates how long to wait for a new compositor frame from a 896 // This value indicates how long to wait for a new compositor frame from a
895 // renderer process before clearing any previously displayed content. 897 // renderer process before clearing any previously displayed content.
896 base::TimeDelta new_content_rendering_delay_; 898 base::TimeDelta new_content_rendering_delay_;
897 899
900 // This identifier tags compositor frames according to the page load with
901 // which they are associated, to prevent an unloaded web page from being
902 // drawn after a navigation to a new page has already committed. This is
903 // be a no-op for non-top-level RenderWidgets, as that should always be
904 // zero.
905 // TODO(kenrb, fsamuel): We should use SurfaceIDs for this purpose when they
enne (OOO) 2017/02/28 19:02:23 Yeah, having renderers know the surface id they're
906 // are available in the renderer process. See https://crbug.com/695579.
907 uint32_t current_content_source_id_;
908
898 #if defined(OS_MACOSX) 909 #if defined(OS_MACOSX)
899 std::unique_ptr<device::PowerSaveBlocker> power_save_blocker_; 910 std::unique_ptr<device::PowerSaveBlocker> power_save_blocker_;
900 #endif 911 #endif
901 912
902 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; 913 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_;
903 914
904 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); 915 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl);
905 }; 916 };
906 917
907 } // namespace content 918 } // namespace content
908 919
909 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ 920 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698