[leveldb] Remove ChromiumEnv::BGThread
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:Tommy Nyquist <nyquist@chromium.org> Reviewed-by:
Kinuko Yasuda <kinuko@chromium.org> Reviewed-by:
Victor Costan <pwnall@chromium.org> Commit-Queue: Ken Rockot <rockot@google.com> Cr-Commit-Position: refs/heads/master@{#796599}
Showing
Please register or sign in to comment