• Troy Hildebrandt's avatar
    Add IsCorrupt() to ProtoDatabase wrappers/clients. · e8e8e4be
    Troy Hildebrandt authored
    Adds the ability to check for corruption via an IsCorrupt() function
    that's pure virtual on the ProtoDatabase. IsCorrupt() is also introduced
    in the ProtoLevelDBWrapper, and the corruption flag gets set on the Init
    callback after checking status.
    
    Unit tests changed slightly because the init callback needed to be put
    into ProtoLevelDBWrapper instead of outside so it could modify
    is_corrupt_, and the new use of the WeakPtr caused a race condition that
    meant the test always failed to trigger the callback if we don't wait
    for init to complete.
    
    Bug: 870813
    Change-Id: Ib00435dae8cdac490053fbfc6befb95094b1edec
    Reviewed-on: https://chromium-review.googlesource.com/c/1355521
    Commit-Queue: Troy Hildebrandt <thildebr@chromium.org>
    Reviewed-by: default avatarTommy Nyquist <nyquist@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#612434}
    e8e8e4be
shared_proto_database.cc 4.13 KB