| OLD | NEW |
| 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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 * Sets experimental options to be used in Cronet. | 174 * Sets experimental options to be used in Cronet. |
| 175 * | 175 * |
| 176 * @param options JSON formatted experimental options. | 176 * @param options JSON formatted experimental options. |
| 177 * @return the builder to facilitate chaining. | 177 * @return the builder to facilitate chaining. |
| 178 */ | 178 */ |
| 179 public Builder setExperimentalOptions(String options) { | 179 public Builder setExperimentalOptions(String options) { |
| 180 mBuilderDelegate.setExperimentalOptions(options); | 180 mBuilderDelegate.setExperimentalOptions(options); |
| 181 return this; | 181 return this; |
| 182 } | 182 } |
| 183 | 183 |
| 184 /** |
| 185 * Returns delegate, only for testing. |
| 186 * @hide |
| 187 */ |
| 184 @VisibleForTesting | 188 @VisibleForTesting |
| 185 ICronetEngineBuilder getBuilderDelegate() { | 189 public ICronetEngineBuilder getBuilderDelegate() { |
| 186 return mBuilderDelegate; | 190 return mBuilderDelegate; |
| 187 } | 191 } |
| 188 | 192 |
| 189 // To support method chaining, override superclass methods to return an | 193 // To support method chaining, override superclass methods to return an |
| 190 // instance of this class instead of the parent. | 194 // instance of this class instead of the parent. |
| 191 | 195 |
| 192 @Override | 196 @Override |
| 193 public Builder setUserAgent(String userAgent) { | 197 public Builder setUserAgent(String userAgent) { |
| 194 super.setUserAgent(userAgent); | 198 super.setUserAgent(userAgent); |
| 195 return this; | 199 return this; |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 * {@link #CONNECTION_METRIC_UNKNOWN} if the value is | 442 * {@link #CONNECTION_METRIC_UNKNOWN} if the value is |
| 439 * unavailable. This must be called after | 443 * unavailable. This must be called after |
| 440 * {@link Builder#enableNetworkQualityEstimator}, and will | 444 * {@link Builder#enableNetworkQualityEstimator}, and will |
| 441 * throw an exception otherwise. | 445 * throw an exception otherwise. |
| 442 * @return Estimate of the downstream throughput in kilobits per second. | 446 * @return Estimate of the downstream throughput in kilobits per second. |
| 443 */ | 447 */ |
| 444 public int getDownstreamThroughputKbps() { | 448 public int getDownstreamThroughputKbps() { |
| 445 return CONNECTION_METRIC_UNKNOWN; | 449 return CONNECTION_METRIC_UNKNOWN; |
| 446 } | 450 } |
| 447 } | 451 } |
| OLD | NEW |