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

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

Issue 2242613003: Hoist SetNeedsBeginFrame messages up to the RWHostImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove base class call Created 4 years, 4 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 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 // Expose increment/decrement of the in-flight event count, so 517 // Expose increment/decrement of the in-flight event count, so
518 // RenderViewHostImpl can account for in-flight beforeunload/unload events. 518 // RenderViewHostImpl can account for in-flight beforeunload/unload events.
519 int increment_in_flight_event_count() { return ++in_flight_event_count_; } 519 int increment_in_flight_event_count() { return ++in_flight_event_count_; }
520 int decrement_in_flight_event_count() { 520 int decrement_in_flight_event_count() {
521 DCHECK_GT(in_flight_event_count_, 0); 521 DCHECK_GT(in_flight_event_count_, 0);
522 return --in_flight_event_count_; 522 return --in_flight_event_count_;
523 } 523 }
524 524
525 bool renderer_initialized() const { return renderer_initialized_; } 525 bool renderer_initialized() const { return renderer_initialized_; }
526 526
527 bool needs_begin_frames() const { return needs_begin_frames_; }
528
527 protected: 529 protected:
528 // --------------------------------------------------------------------------- 530 // ---------------------------------------------------------------------------
529 // The following method is overridden by RenderViewHost to send upwards to 531 // The following method is overridden by RenderViewHost to send upwards to
530 // its delegate. 532 // its delegate.
531 533
532 // Callback for notification that we failed to receive any rendered graphics 534 // Callback for notification that we failed to receive any rendered graphics
533 // from a newly loaded page. Used for testing. 535 // from a newly loaded page. Used for testing.
534 virtual void NotifyNewContentRenderingTimeoutForTesting() {} 536 virtual void NotifyNewContentRenderingTimeoutForTesting() {}
535 537
536 // --------------------------------------------------------------------------- 538 // ---------------------------------------------------------------------------
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 void OnUnlockMouse(); 588 void OnUnlockMouse();
587 void OnShowDisambiguationPopup(const gfx::Rect& rect_pixels, 589 void OnShowDisambiguationPopup(const gfx::Rect& rect_pixels,
588 const gfx::Size& size, 590 const gfx::Size& size,
589 const cc::SharedBitmapId& id); 591 const cc::SharedBitmapId& id);
590 void OnSelectionChanged(const base::string16& text, 592 void OnSelectionChanged(const base::string16& text,
591 uint32_t offset, 593 uint32_t offset,
592 const gfx::Range& range); 594 const gfx::Range& range);
593 void OnSelectionBoundsChanged( 595 void OnSelectionBoundsChanged(
594 const ViewHostMsg_SelectionBounds_Params& params); 596 const ViewHostMsg_SelectionBounds_Params& params);
595 void OnForwardCompositorProto(const std::vector<uint8_t>& proto); 597 void OnForwardCompositorProto(const std::vector<uint8_t>& proto);
598 void OnSetNeedsBeginFrames(bool needs_begin_frames);
596 void OnHittestData(const FrameHostMsg_HittestData_Params& params); 599 void OnHittestData(const FrameHostMsg_HittestData_Params& params);
597 600
598 // Called (either immediately or asynchronously) after we're done with our 601 // Called (either immediately or asynchronously) after we're done with our
599 // BackingStore and can send an ACK to the renderer so it can paint onto it 602 // BackingStore and can send an ACK to the renderer so it can paint onto it
600 // again. 603 // again.
601 void DidUpdateBackingStore(const ViewHostMsg_UpdateRect_Params& params, 604 void DidUpdateBackingStore(const ViewHostMsg_UpdateRect_Params& params,
602 const base::TimeTicks& paint_start); 605 const base::TimeTicks& paint_start);
603 606
604 // Give key press listeners a chance to handle this key press. This allow 607 // Give key press listeners a chance to handle this key press. This allow
605 // widgets that don't have focus to still handle key presses. 608 // widgets that don't have focus to still handle key presses.
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 // Indicates whether a RenderFramehost has ownership, in which case this 813 // Indicates whether a RenderFramehost has ownership, in which case this
811 // object does not self destroy. 814 // object does not self destroy.
812 bool owned_by_render_frame_host_; 815 bool owned_by_render_frame_host_;
813 816
814 // Indicates whether this RenderWidgetHost thinks is focused. This is trying 817 // Indicates whether this RenderWidgetHost thinks is focused. This is trying
815 // to match what the renderer process knows. It is different from 818 // to match what the renderer process knows. It is different from
816 // RenderWidgetHostView::HasFocus in that in that the focus request may fail, 819 // RenderWidgetHostView::HasFocus in that in that the focus request may fail,
817 // causing HasFocus to return false when is_focused_ is true. 820 // causing HasFocus to return false when is_focused_ is true.
818 bool is_focused_; 821 bool is_focused_;
819 822
823 // Whether the view should send begin frame messages to its render widget.
824 // This is state that may arrive before the view has been set and that must be
825 // consistent with the state in the renderer, so this host handles it.
826 bool needs_begin_frames_ = false;
827
820 // This value indicates how long to wait before we consider a renderer hung. 828 // This value indicates how long to wait before we consider a renderer hung.
821 base::TimeDelta hung_renderer_delay_; 829 base::TimeDelta hung_renderer_delay_;
822 830
823 // Stores the reason the hang_monitor_timeout_ has been started. Used to 831 // Stores the reason the hang_monitor_timeout_ has been started. Used to
824 // report histograms if the renderer is hung. 832 // report histograms if the renderer is hung.
825 RenderWidgetHostDelegate::RendererUnresponsiveType hang_monitor_reason_; 833 RenderWidgetHostDelegate::RendererUnresponsiveType hang_monitor_reason_;
826 834
827 // This value indicates how long to wait for a new compositor frame from a 835 // This value indicates how long to wait for a new compositor frame from a
828 // renderer process before clearing any previously displayed content. 836 // renderer process before clearing any previously displayed content.
829 base::TimeDelta new_content_rendering_delay_; 837 base::TimeDelta new_content_rendering_delay_;
830 838
831 #if defined(OS_MACOSX) 839 #if defined(OS_MACOSX)
832 std::unique_ptr<device::PowerSaveBlocker> power_save_blocker_; 840 std::unique_ptr<device::PowerSaveBlocker> power_save_blocker_;
833 #endif 841 #endif
834 842
835 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; 843 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_;
836 844
837 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); 845 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl);
838 }; 846 };
839 847
840 } // namespace content 848 } // namespace content
841 849
842 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ 850 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698