It might be nice to have some Cronet native API CreateWith() functions take OnDestroy() function pointers, even when the impl being created doesn't explicitly have an OnDestory() API.
This might be useful when creating fakes for testing. For example to free resources associated with a fake Cronet_Engine.
This might also be useful if you try to use Cronet_Buffer_CreateWith() to make your own buffer impl...you [probably unexpectedly] won't receive Cronet_BufferCallbback_OnDestroy() call. See https://chromium-review.googlesource.com/c/chromium/src/+/1007582
Comment 1 by mef@chromium.org
, Aug 30