• asvitkine@chromium.org's avatar
    Make MetricsService save compressed logs to local state. · 9706e1b7
    asvitkine@chromium.org authored
    Previously, it would persist logs in uncompressed form. 
    This CL changes the code to compress logs before they're 
    saved. A new pair of prefs is introduced for storing 
    these logs, while reading from the old pref is still 
    maintained to not lose old logs. 
    
    Additionally, this makes the metrics log discard limit 
    (currently 50k) be checked against the compressed size 
    rather than the uncompressed size. 
    
    Simplifies the format used to store logs, now simply 
    storing the compressed log bytes and corresponding hash 
    for each log. The size and checksum fields are removed. 
    (Size was redundant while the checksum is not no longer 
    necessary now that we store the log hash.) 
    
    Deletes some tests that inspected the actual pref 
    values are removed, in favor of tests that check that 
    serializing and de-serializing works as expected. 
    
    Finally, also introduces GzipUncompress() that is 
    needed for tests that inspect log manager logs. 
    
    BUG=382076
    TBR=agl@chromium.org
    
    Review URL: https://codereview.chromium.org/318203004
    
    git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276429 0039d316-1c4b-4281-b951-d872f2087c98
    9706e1b7
DEPS 82 Bytes