Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(440)

Side by Side Diff: components/cronet/android/api/src/org/chromium/net/ExperimentalCronetEngine.java

Issue 2876253002: [Cronet] Add ExperimentalCronetEngine.Builder.setThreadPriority() API (Closed)
Patch Set: shutdown CronetEngines in test Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 package org.chromium.net; 4 package org.chromium.net;
5 5
6 import android.content.Context; 6 import android.content.Context;
7 import android.support.annotation.VisibleForTesting; 7 import android.support.annotation.VisibleForTesting;
8 8
9 import java.io.IOException; 9 import java.io.IOException;
10 import java.net.Proxy; 10 import java.net.Proxy;
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 * 143 *
144 * @param options JSON formatted experimental options. 144 * @param options JSON formatted experimental options.
145 * @return the builder to facilitate chaining. 145 * @return the builder to facilitate chaining.
146 */ 146 */
147 public Builder setExperimentalOptions(String options) { 147 public Builder setExperimentalOptions(String options) {
148 mBuilderDelegate.setExperimentalOptions(options); 148 mBuilderDelegate.setExperimentalOptions(options);
149 return this; 149 return this;
150 } 150 }
151 151
152 /** 152 /**
153 * Sets the thread priority of Cronet's internal thread.
154 *
155 * @param priority the thread priority of Cronet's internal thread.
156 * A Linux priority level, from -20 for highest scheduling
157 * priority to 19 for lowest scheduling priority. For more
158 * information on values, see
159 * {@link android.os.Process#setThreadPriority(int, int)} and
160 * {@link android.os.Process#THREAD_PRIORITY_DEFAULT
161 * THREAD_PRIORITY_*} values.
162 * @return the builder to facilitate chaining.
163 */
164 public Builder setThreadPriority(int priority) {
165 mBuilderDelegate.setThreadPriority(priority);
166 return this;
167 }
168
169 /**
153 * Returns delegate, only for testing. 170 * Returns delegate, only for testing.
154 * @hide 171 * @hide
155 */ 172 */
156 @VisibleForTesting 173 @VisibleForTesting
157 public ICronetEngineBuilder getBuilderDelegate() { 174 public ICronetEngineBuilder getBuilderDelegate() {
158 return mBuilderDelegate; 175 return mBuilderDelegate;
159 } 176 }
160 177
161 // To support method chaining, override superclass methods to return an 178 // To support method chaining, override superclass methods to return an
162 // instance of this class instead of the parent. 179 // instance of this class instead of the parent.
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 * {@link #CONNECTION_METRIC_UNKNOWN} if the value is 428 * {@link #CONNECTION_METRIC_UNKNOWN} if the value is
412 * unavailable. This must be called after 429 * unavailable. This must be called after
413 * {@link Builder#enableNetworkQualityEstimator}, and will 430 * {@link Builder#enableNetworkQualityEstimator}, and will
414 * throw an exception otherwise. 431 * throw an exception otherwise.
415 * @return Estimate of the downstream throughput in kilobits per second. 432 * @return Estimate of the downstream throughput in kilobits per second.
416 */ 433 */
417 public int getDownstreamThroughputKbps() { 434 public int getDownstreamThroughputKbps() {
418 return CONNECTION_METRIC_UNKNOWN; 435 return CONNECTION_METRIC_UNKNOWN;
419 } 436 }
420 } 437 }
OLDNEW
« no previous file with comments | « components/cronet/android/api.txt ('k') | components/cronet/android/api/src/org/chromium/net/ICronetEngineBuilder.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698