0

Clarify that callbacks are not invoked in sync return

It was not clear to me until I looked at some example code whether a
caller could assume their callback was invoked if the function returned
a non-negative result.

Change-Id: I3a8a1d00663d63370d4a8e39ce85fec00ed72866
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4580927
Commit-Queue: Dustin Mitchell <djmitche@chromium.org>
Reviewed-by: Ryan Hamilton <rch@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1153190}
This commit is contained in:
Dustin J. Mitchell
2023-06-05 13:40:05 +00:00
committed by Chromium LUCI CQ
parent 216c10d746
commit 6d852b891b

@ -22,9 +22,11 @@ above. There are three cases:
* If the value is positive or zero, that indicates a synchronous
successful return, with a zero return value indicating either zero
bytes/EOF or indicating `net::OK`, depending on context.
bytes/EOF or indicating `net::OK`, depending on context. If there
is a callback argument, it is not invoked.
* If the value is negative and != `net::ERR_IO_PENDING`, it is an error
code specifying a synchronous failure.
code specifying a synchronous failure. If there is a callback argument,
it is not invoked.
* If the return value is the special value `net::ERR_IO_PENDING`, it
indicates that the routine will complete asynchronously. A reference to
any provided IOBuffer will be retained by the called entity until