Commit d85fd54c authored by Maks Orlovich's avatar Maks Orlovich Committed by Commit Bot

SimpleCache: handle null callback to ops we may need to defer, like Doom

Hoping to fix 881941

Bug: 881941
Change-Id: I7ba5b34b3e3f0c6eec8747a0079a95a1f44aa732
Reviewed-on: https://chromium-review.googlesource.com/1214302Reviewed-by: default avatarBence Béky <bnc@chromium.org>
Commit-Queue: Maks Orlovich <morlovich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589934}
parent 3b87fc54
......@@ -166,10 +166,12 @@ base::RepeatingCallback<void(int)> MakeBarrierCompletionCallback(
void RunOperationAndCallback(
base::OnceCallback<int(net::CompletionOnceCallback)> operation,
net::CompletionOnceCallback operation_callback) {
auto copyable_callback =
base::AdaptCallbackForRepeating(std::move(operation_callback));
base::RepeatingCallback<void(int)> copyable_callback;
if (operation_callback)
copyable_callback =
base::AdaptCallbackForRepeating(std::move(operation_callback));
const int operation_result = std::move(operation).Run(copyable_callback);
if (operation_result != net::ERR_IO_PENDING)
if (operation_result != net::ERR_IO_PENDING && copyable_callback)
copyable_callback.Run(operation_result);
}
......
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