Commit 0770b196 authored by David Benjamin's avatar David Benjamin Committed by Commit Bot

Update code-patterns.md for CompletionOnceCallback.

Bug: none
Change-Id: I71a0dbbe87ca76015107f61dbff9647ba33041bc
Reviewed-on: https://chromium-review.googlesource.com/c/1359310Reviewed-by: default avatarMatt Menke <mmenke@chromium.org>
Commit-Queue: David Benjamin <davidben@chromium.org>
Cr-Commit-Position: refs/heads/master@{#613293}
parent 573d7cad
......@@ -176,7 +176,7 @@ The characteristics of the DoLoop pattern are:
`HttpStreamParser`, abridged for clarity):
int HttpStreamParser::ReadResponseHeaders(
const CompletionCallback& callback) {
CompletionOnceCallback callback) {
DCHECK(io_state_ == STATE_NONE || io_state_ == STATE_DONE);
DCHECK(callback_.is_null());
DCHECK(!callback.is_null());
......@@ -187,7 +187,7 @@ The characteristics of the DoLoop pattern are:
result = DoLoop(result);
if (result == ERR_IO_PENDING)
callback_ = callback;
callback_ = std::move(callback);
return result > 0 ? OK : 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