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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 * @param certVerifierData a serialized representation of certificate | 132 * @param certVerifierData a serialized representation of certificate |
133 * verification results. | 133 * verification results. |
134 * @return the builder to facilitate chaining. | 134 * @return the builder to facilitate chaining. |
135 */ | 135 */ |
136 public Builder setCertVerifierData(String certVerifierData) { | 136 public Builder setCertVerifierData(String certVerifierData) { |
137 mBuilderDelegate.setCertVerifierData(certVerifierData); | 137 mBuilderDelegate.setCertVerifierData(certVerifierData); |
138 return this; | 138 return this; |
139 } | 139 } |
140 | 140 |
141 /** | 141 /** |
142 * Overrides | |
143 * <a href="https://developer.chrome.com/multidevice/data-compression"> | |
144 * Data Reduction Proxy</a> configuration parameters with a primary | |
145 * proxy name, fallback proxy name, and a secure proxy check URL. Proxie
s | |
146 * are specified as [scheme://]host[:port]. Used for testing. | |
147 * @param primaryProxy the primary data reduction proxy to use. | |
148 * @param fallbackProxy a fallback data reduction proxy to use. | |
149 * @param secureProxyCheckUrl a URL to fetch to determine if using a sec
ure | |
150 * proxy is allowed. | |
151 * @return the builder to facilitate chaining. | |
152 */ | |
153 public Builder setDataReductionProxyOptions( | |
154 String primaryProxy, String fallbackProxy, String secureProxyChe
ckUrl) { | |
155 mBuilderDelegate.setDataReductionProxyOptions( | |
156 primaryProxy, fallbackProxy, secureProxyCheckUrl); | |
157 return this; | |
158 } | |
159 | |
160 /** | |
161 * Enables | |
162 * <a href="https://developer.chrome.com/multidevice/data-compression">D
ata | |
163 * Reduction Proxy</a>. Defaults to disabled. | |
164 * @param key key to use when authenticating with the proxy. | |
165 * @return the builder to facilitate chaining. | |
166 */ | |
167 public Builder enableDataReductionProxy(String key) { | |
168 mBuilderDelegate.enableDataReductionProxy(key); | |
169 return this; | |
170 } | |
171 | |
172 /** | |
173 * Sets experimental options to be used in Cronet. | 142 * Sets experimental options to be used in Cronet. |
174 * | 143 * |
175 * @param options JSON formatted experimental options. | 144 * @param options JSON formatted experimental options. |
176 * @return the builder to facilitate chaining. | 145 * @return the builder to facilitate chaining. |
177 */ | 146 */ |
178 public Builder setExperimentalOptions(String options) { | 147 public Builder setExperimentalOptions(String options) { |
179 mBuilderDelegate.setExperimentalOptions(options); | 148 mBuilderDelegate.setExperimentalOptions(options); |
180 return this; | 149 return this; |
181 } | 150 } |
182 | 151 |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 * {@link #CONNECTION_METRIC_UNKNOWN} if the value is | 411 * {@link #CONNECTION_METRIC_UNKNOWN} if the value is |
443 * unavailable. This must be called after | 412 * unavailable. This must be called after |
444 * {@link Builder#enableNetworkQualityEstimator}, and will | 413 * {@link Builder#enableNetworkQualityEstimator}, and will |
445 * throw an exception otherwise. | 414 * throw an exception otherwise. |
446 * @return Estimate of the downstream throughput in kilobits per second. | 415 * @return Estimate of the downstream throughput in kilobits per second. |
447 */ | 416 */ |
448 public int getDownstreamThroughputKbps() { | 417 public int getDownstreamThroughputKbps() { |
449 return CONNECTION_METRIC_UNKNOWN; | 418 return CONNECTION_METRIC_UNKNOWN; |
450 } | 419 } |
451 } | 420 } |
OLD | NEW |