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 options JSON formatted experimental options |
mef
2015/11/06 18:52:39
nits: in this file we end param@ comments with per
xunjieli
2015/11/13 22:13:06
Done.
| |
308 * "PACE,IW10") to use if QUIC is enabled. | |
309 * @return the builder to facilitate chaining. | |
310 */ | 307 */ |
311 public Builder setExperimentalQuicConnectionOptions(String quicConnectio nOptions) { | 308 public Builder setExperimentalOptions(String options) { |
312 return putString(CronetEngineBuilderList.QUIC_OPTIONS, quicConnectio nOptions); | 309 return putString(CronetEngineBuilderList.EXPERIMENTAL_OPTIONS, optio ns); |
mef
2015/11/06 18:52:39
Given that engine building is slow and rare I thin
xunjieli
2015/11/13 22:13:06
Do we add a "throws JSONException" to the method s
| |
313 } | 310 } |
314 | 311 |
315 /** | 312 /** |
316 * Sets a native MockCertVerifier for testing. | 313 * Sets a native MockCertVerifier for testing. |
317 */ | 314 */ |
318 Builder setMockCertVerifierForTesting(long mockCertVerifier) { | 315 Builder setMockCertVerifierForTesting(long mockCertVerifier) { |
319 return putString( | 316 return putString( |
320 CronetEngineBuilderList.MOCK_CERT_VERIFIER, String.valueOf(m ockCertVerifier)); | 317 CronetEngineBuilderList.MOCK_CERT_VERIFIER, String.valueOf(m ockCertVerifier)); |
321 } | 318 } |
322 | 319 |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
662 cronetEngine = possibleEngine; | 659 cronetEngine = possibleEngine; |
663 } | 660 } |
664 } catch (ClassNotFoundException e) { | 661 } catch (ClassNotFoundException e) { |
665 // Leave as null. | 662 // Leave as null. |
666 } catch (Exception e) { | 663 } catch (Exception e) { |
667 throw new IllegalStateException("Cannot instantiate: " + CRONET_URL_ REQUEST_CONTEXT, e); | 664 throw new IllegalStateException("Cannot instantiate: " + CRONET_URL_ REQUEST_CONTEXT, e); |
668 } | 665 } |
669 return cronetEngine; | 666 return cronetEngine; |
670 } | 667 } |
671 } | 668 } |
OLD | NEW |