• Albert J. Wong's avatar
    Break apart RenderWidgetHost::GetVisualProperties() · 84437412
    Albert J. Wong authored
    RenderWidgetHost::GetVisualProperties() was doing 3 separate things
      (1) Actually calculating the VisualProperties
      (2) Checking against the last stored VisualProperties to determine
          if the stored copy needs updating.
      (3) Determining if an ack should be expected if an update is eventually
          sent with the result of this function.
    
    This CL breaks it out into 3 new functions:
    
    GetVisualProperties() - Generates the VisualProperties. This should be
    const but too much of the call chain underneath it did not annotate
    their getters with const that annotating would be too annoying.
    
    DidVisualPropertiesSizeChange() - Helper function that extracts a common
    query used by DoesVisualPropertiesNeedAck() and
    StoredVisualPropertiesNeedsUpdate().
    
    DoesVisualPropertiesNeedAck() - Returns true if sending the given
    VisualProperties update to the renderer will generate an ack.
    
    StoredVisualPropertiesNeedsUpdate() - Returns true if the stored copy
    of the VisualProperties is different enouhg from the incoming one that
    it needs an update.
    
    Bug: 998273
    Change-Id: Ie8fee3ddedc1ea8b492765cb5b35e7bda99234de
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1773878
    Commit-Queue: Albert J. Wong <ajwong@chromium.org>
    Reviewed-by: default avatarccameron <ccameron@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#691879}
    84437412
render_widget_host_unittest.cc 81.4 KB