Introducing net::CompletionOnceCallback

40 views
Skip to first unread message

Matt Menke

unread,
Jan 30, 2018, 6:46:48 PM1/30/18
to net-dev
I just landed a OnceCallback variation of CompletionCallback (At net/base/completion_once_callback), and recommend using it over CompletionCallback when you can reasonably do so.

There's no OnceCallback version of TestCompletionCallback, as TestCompletionCallback works fine to test methods that use the new test callback, and I'm hoping once we completely switch over, we can just switch TestCompletionCallback to vending OnceCallbacks.

Since RepeatingCallbacks can be passed to methods that take once callbacks, it should be trivial to convert classes over to using the new class, as long as they don't pass their callbacks to methods that take RepeatingCallbacks, and as long as there aren't too many implementations of that class.

No one's currently planning on doing mass conversions of net classes to use the new class, and there's no rush to switch to the new class, just wanted to bring the new typedef to everyone's attention.

Bence Béky

unread,
Jan 31, 2018, 11:26:36 AM1/31/18
to Matt Menke, net-dev
Thanks, Matt, for kicking off this effort!  I started to write a few small CLs to transition towards CompletionOnceCallback.  If anyone else is interested in making changes in this direction, I'm happy to be the reviewer on your CLs.

--
You received this message because you are subscribed to the Google Groups "net-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to net-dev+unsubscribe@chromium.org.
To post to this group, send email to net...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/net-dev/CAEK7mvoE9BiuSWHLjAAQsN4cx_LScKy5LyRCKELmbOOK%3Dfux6Q%40mail.gmail.com.

Eric Roman

unread,
Jan 31, 2018, 2:33:02 PM1/31/18
to Bence Béky, Matt Menke, net-dev
Thanks Matt and Bence!

I also filed crbug.com/807724 to track the migration,
as this refactor may interest some of our contributors.

(As some simple changes to get involved with //net code)

Reply all
Reply to author
Forward
0 new messages