OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 | 4 |
5 package org.chromium.net; | 5 package org.chromium.net; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.support.annotation.IntDef; | 8 import android.support.annotation.IntDef; |
9 import android.util.Log; | 9 import android.util.Log; |
10 | 10 |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
294 hint.put(CronetEngineBuilderList.QUIC_HINT_PORT, port); | 294 hint.put(CronetEngineBuilderList.QUIC_HINT_PORT, port); |
295 hint.put(CronetEngineBuilderList.QUIC_HINT_ALT_PORT, alternatePo rt); | 295 hint.put(CronetEngineBuilderList.QUIC_HINT_ALT_PORT, alternatePo rt); |
296 quicHints.put(hint); | 296 quicHints.put(hint); |
297 } catch (JSONException e) { | 297 } catch (JSONException e) { |
298 // Intentionally do nothing. | 298 // Intentionally do nothing. |
299 } | 299 } |
300 return this; | 300 return this; |
301 } | 301 } |
302 | 302 |
303 /** | 303 /** |
304 * Sets experimental QUIC connection options, overwriting any pre-existi ng | 304 * Sets experimental options to be used in Cronet. |
305 * options. List of options is subject to change. | |
306 * | 305 * |
307 * @param quicConnectionOptions comma-separated QUIC options (for exampl e | 306 * @param experimentalOptions experimental options as a JSON formatted |
pauljensen
2015/11/04 15:03:26
experimental options as a JSON formatted string->J
xunjieli
2015/11/06 14:48:51
Done.
| |
308 * "PACE,IW10") to use if QUIC is enabled. | 307 * string |
309 * @return the builder to facilitate chaining. | |
310 */ | 308 */ |
311 public Builder setExperimentalQuicConnectionOptions(String quicConnectio nOptions) { | 309 public Builder setExperimentalOptions(String experimentalOptions) { |
pauljensen
2015/11/04 15:03:26
nit: experimentalOptions->options
xunjieli
2015/11/06 14:48:51
Done.
| |
312 return putString(CronetEngineBuilderList.QUIC_OPTIONS, quicConnectio nOptions); | 310 return putString(CronetEngineBuilderList.EXPERIMENTAL_OPTIONS, exper imentalOptions); |
313 } | 311 } |
314 | 312 |
315 /** | 313 /** |
316 * Sets a native MockCertVerifier for testing. | 314 * Sets a native MockCertVerifier for testing. |
317 */ | 315 */ |
318 Builder setMockCertVerifierForTesting(long mockCertVerifier) { | 316 Builder setMockCertVerifierForTesting(long mockCertVerifier) { |
319 return putString( | 317 return putString( |
320 CronetEngineBuilderList.MOCK_CERT_VERIFIER, String.valueOf(m ockCertVerifier)); | 318 CronetEngineBuilderList.MOCK_CERT_VERIFIER, String.valueOf(m ockCertVerifier)); |
321 } | 319 } |
322 | 320 |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
661 cronetEngine = possibleEngine; | 659 cronetEngine = possibleEngine; |
662 } | 660 } |
663 } catch (ClassNotFoundException e) { | 661 } catch (ClassNotFoundException e) { |
664 // Leave as null. | 662 // Leave as null. |
665 } catch (Exception e) { | 663 } catch (Exception e) { |
666 throw new IllegalStateException("Cannot instantiate: " + CRONET_URL_ REQUEST_CONTEXT, e); | 664 throw new IllegalStateException("Cannot instantiate: " + CRONET_URL_ REQUEST_CONTEXT, e); |
667 } | 665 } |
668 return cronetEngine; | 666 return cronetEngine; |
669 } | 667 } |
670 } | 668 } |
OLD | NEW |