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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 hint.put(CronetEngineBuilderList.QUIC_HINT_PORT, port); | 296 hint.put(CronetEngineBuilderList.QUIC_HINT_PORT, port); |
297 hint.put(CronetEngineBuilderList.QUIC_HINT_ALT_PORT, alternatePo
rt); | 297 hint.put(CronetEngineBuilderList.QUIC_HINT_ALT_PORT, alternatePo
rt); |
298 quicHints.put(hint); | 298 quicHints.put(hint); |
299 } catch (JSONException e) { | 299 } catch (JSONException e) { |
300 // Intentionally do nothing. | 300 // Intentionally do nothing. |
301 } | 301 } |
302 return this; | 302 return this; |
303 } | 303 } |
304 | 304 |
305 /** | 305 /** |
306 * Sets experimental QUIC connection options, overwriting any pre-existi
ng | 306 * Sets experimental options to be used in Cronet. |
307 * options. List of options is subject to change. | |
308 * | 307 * |
309 * @param quicConnectionOptions comma-separated QUIC options (for exampl
e | 308 * @param options JSON formatted experimental options. |
310 * "PACE,IW10") to use if QUIC is enabled. | |
311 * @return the builder to facilitate chaining. | 309 * @return the builder to facilitate chaining. |
312 */ | 310 */ |
313 public Builder setExperimentalQuicConnectionOptions(String quicConnectio
nOptions) { | 311 public Builder setExperimentalOptions(String options) { |
314 return putString(CronetEngineBuilderList.QUIC_OPTIONS, quicConnectio
nOptions); | 312 return putString(CronetEngineBuilderList.EXPERIMENTAL_OPTIONS, optio
ns); |
315 } | 313 } |
316 | 314 |
317 /** | 315 /** |
318 * Sets a native MockCertVerifier for testing. | 316 * Sets a native MockCertVerifier for testing. |
319 */ | 317 */ |
320 Builder setMockCertVerifierForTesting(long mockCertVerifier) { | 318 Builder setMockCertVerifierForTesting(long mockCertVerifier) { |
321 return putString( | 319 return putString( |
322 CronetEngineBuilderList.MOCK_CERT_VERIFIER, String.valueOf(m
ockCertVerifier)); | 320 CronetEngineBuilderList.MOCK_CERT_VERIFIER, String.valueOf(m
ockCertVerifier)); |
323 } | 321 } |
324 | 322 |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 cronetEngine = possibleEngine; | 686 cronetEngine = possibleEngine; |
689 } | 687 } |
690 } catch (ClassNotFoundException e) { | 688 } catch (ClassNotFoundException e) { |
691 // Leave as null. | 689 // Leave as null. |
692 } catch (Exception e) { | 690 } catch (Exception e) { |
693 throw new IllegalStateException("Cannot instantiate: " + CRONET_URL_
REQUEST_CONTEXT, e); | 691 throw new IllegalStateException("Cannot instantiate: " + CRONET_URL_
REQUEST_CONTEXT, e); |
694 } | 692 } |
695 return cronetEngine; | 693 return cronetEngine; |
696 } | 694 } |
697 } | 695 } |
OLD | NEW |