[code caching] Fix issues with move semantics in GeneratedCodeCache
- Divides EnqueueAsPendingOperation into two methods, with a new TryBeginOperation method to check for any pending operations. This allows us to defer creating the PendingOperation until we know we need it. Otherwise, move semantics could potentially cause loss of data when we discard the PendingOperation. This worked before because the callbacks are copyable, and IOBuffer is ref-counted. - Adds some std::moves for callbacks, and some trivial renaming for consistency. - This is preparation for using mojo_base::BigBuffer for writing too. Bug: chromium:992991 Change-Id: Ia8b16ba9403da2b95c2c9a57da93a9112fd62b17 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1801757Reviewed-by:Mythri Alle <mythria@chromium.org> Reviewed-by:
Charlie Reis <creis@chromium.org> Commit-Queue: Bill Budge <bbudge@chromium.org> Cr-Commit-Position: refs/heads/master@{#696977}
Showing
Please register or sign in to comment