• Matt Reynolds's avatar
    Reland "Move WifiPollingPolicy to a global instance" · 4e043583
    Matt Reynolds authored
    This is a reland of bd9b9ea0
    Original change's description:
    > Move WifiPollingPolicy to a global instance
    > 
    > The WifiPollingPolicy controls how frequently the network location
    > provider will initiate Wi-Fi scans. Previously, the policy was attached
    > to the WifiDataProvider, which is destroyed when there are no active
    > geolocation API calls. Destruction of the provider causes us to lose track
    > of our polling policy.
    > 
    > The policy allows the first scan to be performed immediately and schedules
    > subsequent scans at regular intervals. When the provider is destroyed and
    > recreated rapidly it considers each scan to be "first", which allows many
    > Wi-Fi scans to be performed in a short window.
    > 
    > This change moves the policy state to a global instance so it can be saved
    > when the provider is destroyed and recreated. The new policy allows the
    > first-ever scan to be performed immediately, and subsequent scans may also
    > be performed immediately if enough time has lapsed since the previous scan.
    > In all other situations, the configured polling interval is enforced.
    > 
    > The global policy instance is leaked at shutdown.
    > 
    > BUG=764954
    > 
    > Change-Id: If16c73dfd7d6535346e86d0fab5df24f0c7b297d
    > Reviewed-on: https://chromium-review.googlesource.com/850444
    > Commit-Queue: Matt Reynolds <mattreynolds@chromium.org>
    > Reviewed-by: Reilly Grant <reillyg@chromium.org>
    > Cr-Commit-Position: refs/heads/master@{#527219}
    
    Bug: 764954
    Change-Id: I394a671cdbcdb58d6e80c201777465d1d304987b
    Reviewed-on: https://chromium-review.googlesource.com/860778Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
    Commit-Queue: Matt Reynolds <mattreynolds@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#528466}
    4e043583
wifi_data_provider_chromeos.h 1.92 KB