Add an experimental option to change CroNets network thread priority. |
||||||||
Issue descriptionUserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.96 Safari/537.36 Steps to reproduce the problem: Feature request for an API to change CroNets internal network thread priority. Currently it is set to BACKGROUND by default. What is the expected behavior? What went wrong? ? Did this work before? N/A Chrome version: 58.0.3029.96 Channel: n/a OS Version: Flash Version: Shockwave Flash 25.0 r0
,
May 11 2017
,
May 12 2017
I took a stab at adding this: https://codereview.chromium.org/2876253002/
,
May 17 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/60fae58468c10337e6538d8334034d590bbc86da commit 60fae58468c10337e6538d8334034d590bbc86da Author: pauljensen <pauljensen@chromium.org> Date: Wed May 17 14:37:32 2017 [Cronet] Add ExperimentalCronetEngine.Builder.setThreadPriority() API This API allows setting the thread priority of Cronet's internal main thread. BUG= 721519 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_cronet_tester Review-Url: https://codereview.chromium.org/2876253002 Cr-Commit-Position: refs/heads/master@{#472449} [modify] https://crrev.com/60fae58468c10337e6538d8334034d590bbc86da/components/cronet/android/api.txt [modify] https://crrev.com/60fae58468c10337e6538d8334034d590bbc86da/components/cronet/android/api/src/org/chromium/net/ExperimentalCronetEngine.java [modify] https://crrev.com/60fae58468c10337e6538d8334034d590bbc86da/components/cronet/android/api/src/org/chromium/net/ICronetEngineBuilder.java [modify] https://crrev.com/60fae58468c10337e6538d8334034d590bbc86da/components/cronet/android/api_version.txt [modify] https://crrev.com/60fae58468c10337e6538d8334034d590bbc86da/components/cronet/android/java/src/org/chromium/net/impl/CronetEngineBuilderImpl.java [modify] https://crrev.com/60fae58468c10337e6538d8334034d590bbc86da/components/cronet/android/java/src/org/chromium/net/impl/CronetUrlRequestContext.java [modify] https://crrev.com/60fae58468c10337e6538d8334034d590bbc86da/components/cronet/android/java/src/org/chromium/net/impl/JavaCronetEngine.java [modify] https://crrev.com/60fae58468c10337e6538d8334034d590bbc86da/components/cronet/android/java/src/org/chromium/net/impl/JavaCronetEngineBuilderImpl.java [modify] https://crrev.com/60fae58468c10337e6538d8334034d590bbc86da/components/cronet/android/test/javatests/src/org/chromium/net/CronetUrlRequestContextTest.java
,
May 17 2017
Should be available in next week's dev channel release.
,
May 18 2017
Re-open as iOS could use an API like this also.
,
Jul 17 2017
,
Jul 17
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jul 17
The API for setting thread priority is available in Cronet for Android:
/**
* Sets the thread priority of Cronet's internal thread.
*
* @param priority the thread priority of Cronet's internal thread.
* A Linux priority level, from -20 for highest scheduling
* priority to 19 for lowest scheduling priority. For more
* information on values, see
* {@link android.os.Process#setThreadPriority(int, int)} and
* {@link android.os.Process#THREAD_PRIORITY_DEFAULT
* THREAD_PRIORITY_*} values.
* @return the builder to facilitate chaining.
*/
public Builder setThreadPriority(int priority) {
mBuilderDelegate.setThreadPriority(priority);
return this;
}
as well as iOS:
// Sets priority of the network thread. The |priority| should be a
// floating point number between 0.0 to 1.0, where 1.0 is highest priority.
// This method can be called multiple times before or after |start| method.
+ (void)setNetworkThreadPriority:(double)priority;
|
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by matttt@google.com
, May 11 2017