The Network Thread priority API is available on both Android and iOS and provides improved performance in some applications.
Native CronetEngine API should provide same functionality.
Hmm there appear to be various thread priority APIs that take different values:
iOS takes a double value from 0.0 to 1.0.
Android takes an int from -20 to 19.
base/threading/thread.h takes one of four values.
I generally think the Cronet API should be as powerful as possible; and users wanting a simpler API should use a wrapper. So I'm tempted to say we should accept a double whose value means:
1. On Android it should be an integer between -20 and 19
2. On iOS it should be a double between 0.0 and 1.0
3. On other OS's it should be one of the four values in platform_thread.h
Presently the thread priority is set by the embedder through the Android-specific and iOS-specific APIs and set in the non-shared Cronet impl code. Perhaps we should transfer to a mode where the thread priority is passed through the cronet::URLRequestContextConfig API and set accordingly by shared Cronet code (though using OS-specific impls).
I agree with adding a double network_thread_priority value to Cronet EngineParams and specifying that valid range is platform-specific.
We can define the range on Android and iOS and ignore on other platforms.
We should also define some out-of-range value that means 'use default'.
Comment 1 by mef@chromium.org
, Jul 31