Skip to content
  • michaeln's avatar
    Change how the quota system computes the poolsize for temporary storage. · 10e5fc35
    michaeln authored
    Adds a QuotaSettings datastructure and changes how the total poolsize
    for temporary storage is determined. This CL adds a public content API
    that the embedder must use to inform the quota system of the desired
    QuotaSettings.
    
    The old computation: [available_space + current_temp_usage] / 3
    The new computation: [total_volume_size - os_overhead] / 3
    
    The new computation is simplified to be a function of the size of the
    volume, and no longer takes as input how much chrome is currently using.
    This also reduces the time take to initialize the quota system.
    
    To defend against filling the drive, as available space gets "too low",
    as it approaches |must_remain_available|, the calculated per-host quota is
    clamped to the hosts current usage. This prevents the writing of new data
    because quota clients query GetUsageAndQuota() prior to performing a write.
    Also the eviction logic deletes existing data to keep
    |should_remain_available| disk space free.
    
    Settings.must_remain_available = 1% of total_volume_size
    Settings.should_remain_available = 10%
    
    BUG=520318
    
    Review-Url: https://codereview.chromium.org/1782053004
    Cr-Commit-Position: refs/heads/master@{#448510}
    10e5fc35