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

Side by Side Diff: content/renderer/render_widget.h

Issue 2731283003: (Reland) Discard compositor frames from unloaded web content (Closed)
Patch Set: Initialize field to zero 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
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_RENDERER_RENDER_WIDGET_H_ 5 #ifndef CONTENT_RENDERER_RENDER_WIDGET_H_
6 #define CONTENT_RENDERER_RENDER_WIDGET_H_ 6 #define CONTENT_RENDERER_RENDER_WIDGET_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 407
408 // When emulated, this returns original device scale factor. 408 // When emulated, this returns original device scale factor.
409 float GetOriginalDeviceScaleFactor() const; 409 float GetOriginalDeviceScaleFactor() const;
410 410
411 // Helper to convert |point| using ConvertWindowToViewport(). 411 // Helper to convert |point| using ConvertWindowToViewport().
412 gfx::Point ConvertWindowPointToViewport(const gfx::Point& point); 412 gfx::Point ConvertWindowPointToViewport(const gfx::Point& point);
413 413
414 virtual void TransferActiveWheelFlingAnimation( 414 virtual void TransferActiveWheelFlingAnimation(
415 const blink::WebActiveWheelFlingParameters& params) {} 415 const blink::WebActiveWheelFlingParameters& params) {}
416 416
417 uint32_t GetContentSourceId();
418 void IncrementContentSourceId();
419
417 protected: 420 protected:
418 // Friend RefCounted so that the dtor can be non-public. Using this class 421 // Friend RefCounted so that the dtor can be non-public. Using this class
419 // without ref-counting is an error. 422 // without ref-counting is an error.
420 friend class base::RefCounted<RenderWidget>; 423 friend class base::RefCounted<RenderWidget>;
421 424
422 // For unit tests. 425 // For unit tests.
423 friend class RenderWidgetTest; 426 friend class RenderWidgetTest;
424 427
425 enum ResizeAck { 428 enum ResizeAck {
426 SEND_RESIZE_ACK, 429 SEND_RESIZE_ACK,
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 EditCommands edit_commands_; 843 EditCommands edit_commands_;
841 844
842 // This field stores drag/drop related info for the event that is currently 845 // This field stores drag/drop related info for the event that is currently
843 // being handled. If the current event results in starting a drag/drop 846 // being handled. If the current event results in starting a drag/drop
844 // session, this info is sent to the browser along with other drag/drop info. 847 // session, this info is sent to the browser along with other drag/drop info.
845 DragEventSourceInfo possible_drag_event_info_; 848 DragEventSourceInfo possible_drag_event_info_;
846 849
847 bool time_to_first_active_paint_recorded_; 850 bool time_to_first_active_paint_recorded_;
848 base::TimeTicks was_shown_time_; 851 base::TimeTicks was_shown_time_;
849 852
853 // This is initialized to zero and is incremented on each non-same-page
854 // navigation commit by RenderFrameImpl. At that time it is sent to the
855 // compositor so that it can tag compositor frames, and RenderFrameImpl is
856 // responsible for sending it to the browser process to be used to match
857 // each compositor frame to the most recent page navigation before it was
858 // generated.
859 // This only applies to main frames, and is not touched for subframe
860 // RenderWidgets, where there is no concern around displaying unloaded
861 // content.
862 // TODO(kenrb, fsamuel): This should be removed when SurfaceIDs can be used
863 // to replace it. See https://crbug.com/695579.
864 uint32_t current_content_source_id_;
865
850 base::WeakPtrFactory<RenderWidget> weak_ptr_factory_; 866 base::WeakPtrFactory<RenderWidget> weak_ptr_factory_;
851 867
852 DISALLOW_COPY_AND_ASSIGN(RenderWidget); 868 DISALLOW_COPY_AND_ASSIGN(RenderWidget);
853 }; 869 };
854 870
855 } // namespace content 871 } // namespace content
856 872
857 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ 873 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698