It's possible to accidentally set a CronetEngine as the default handler:
URL.setURLStreamHandlerFactory(protocol -> cronetEngine.createURLStreamHandler(protocol));
When a JavaCronetEngine is used, this results in a weird mismatch where the async api of a java cronet engine is calling httpurlconnection which is calling the native cronet engine.
Options:
1. Short-circuit and call the default stream handler cronetengine directly. This is a little weird, but probably the best performance option. It's easy to check via instanceof when openConection is called and detect this case.
2. Don't do anything special, just use it via the HURL interface (status quo)
In any case, I think this is a new mode that should be added to cronet's automated tests. This could help find bugs in both the java impl and the native hurl implementation.
Comment 1 by morlovich@chromium.org
, Feb 14 2018Status: Untriaged (was: Unconfirmed)