• Troy Hildebrandt's avatar
    Fix SharedProtoDatabase WeakPtr dereferences/multiple init issues. · 5d5c9a3a
    Troy Hildebrandt authored
    Introduces the concept of pending client initializations so that we
    don't fail in odd ways if multiple initializations are in flight.
    
    Also fixes some of the initialization PostTasks to ensure we're always
    dereferencing our WeakPtrs on the same task runnerand ensuring that we
    actually post our callbacks on the calling task runner.
    
    Removes the WeakPtrFactory from ProtoLevelDBWrapper as well, which
    involves a substantial refactoring to get DB init status back. A new
    InitStatusCallback has been created so the 2 param Init and
    InitWithDatabase calls give me an InitStatus. IsCorrupt was removed,
    since setting the corruption state was the only thing that required
    using a WeakPtr in the first place. This gives us the freedom to make
    calls to the wrapper from any sequence regardless of what it was
    created on, and not have the WeakPtrFactory cause problems when it's
    destructed.
    
    Bug: 912117,870813
    Change-Id: Ic7931a543b4d3d09714184dfb335311130bc7667
    Reviewed-on: https://chromium-review.googlesource.com/c/1364074
    Commit-Queue: Troy Hildebrandt <thildebr@chromium.org>
    Reviewed-by: default avatarTommy Nyquist <nyquist@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#616072}
    5d5c9a3a
fake_db.h 11.7 KB