Commit 252a9d02 authored by Marijn Kruisselbrink's avatar Marijn Kruisselbrink Committed by Commit Bot

[FileAPI] Don't start FileReaders on a context that is destroyed.

The FileReaders themselves will abort once they realize the context is
destroyed anyway, so it is pretty pointless (and potentially
problematic) to start new FileReaders after the context is destroyed.

Bug: 836724
Change-Id: I7bcbdf7d7905448df794df423a3fb0fe1697dd95
Reviewed-on: https://chromium-review.googlesource.com/1028555
Commit-Queue: Daniel Murphy <dmurph@chromium.org>
Reviewed-by: default avatarDaniel Murphy <dmurph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553726}
parent 71f5a416
......@@ -166,6 +166,10 @@ class FileReader::ThrottlingController final
}
void ExecuteReaders() {
// Dont execute more readers if the context is already destroyed (or in the
// process of being destroyed).
if (GetSupplementable()->IsContextDestroyed())
return;
while (running_readers_.size() < max_running_readers_) {
if (pending_readers_.IsEmpty())
return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment