While async readpixels operations execute in GLRenderer, we create a PendingAsyncReadPixels struct and insert it into a side vector that is owned by the class. Then, later, when the callback is run, we scan the vector again and pull out the entry that matches the |buffer| argument in the callback function.
This seems totally unnecessary. We should remove the "side vector" and the PendingAsyncReadPixels struct, and just pass all needed variables in the base::Bind(...) to become arguments to the callback function.
Speculation: It's possible that, in the past, GLRenderer had to keep track of this stuff to provide a clean early shutdown. However, no other code seems to make use of the "side vector" anymore.
Comment 1 by m...@chromium.org
, Nov 8 2017