• Ken Rockot's avatar
    [leveldb] Remove ChromiumEnv::BGThread · e0917f58
    Ken Rockot authored
    This is used to satisfy Env::Schedule calls. The implementation lazily
    spins a new PlatformThread and maintains a queue of tasks for it to
    run. LevelDB uses this to schedule work which may do file I/O. For the
    sandboxed Storage Service, this means doing sync Mojo IPCs.
    
    Mojo IPC in general requires some basic task scheduling state to be set
    up on the calling thread though, so the Storage Service will DCHECK
    when it tries to do compaction within a sandbox.
    
    Fortunately this thread doesn't seem to be necessary anymore, and it can
    be replaced with a much simpler dispatch to the ThreadPool. Env contract
    does not require scheduled tasks to be serialized, so they can be thrown
    at the ThreadPool without a sequenced task runner.
    
    A test is added to the sandboxed Storage Service in order to provide
    some (albeit roundabout) coverage of this code path.
    
    Incidentally the test also revealed a bug in FilesystemProxy which
    caused it to completely ignore its given IPC task runner, which can
    cause deadlocks in certain situations. This is also fixed and
    effectively covered by the new test.
    
    Bug: 1052045
    Change-Id: Ic299a4050240c1b52d3669964ff6b65f74de8179
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2341415Reviewed-by: default avatarTommy Nyquist <nyquist@chromium.org>
    Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
    Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
    Commit-Queue: Ken Rockot <rockot@google.com>
    Cr-Commit-Position: refs/heads/master@{#796599}
    e0917f58
env_chromium.cc 51.5 KB