| 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.util.Log; | 8 import android.util.Log; |
| 9 | 9 |
| 10 import org.json.JSONArray; | 10 import org.json.JSONArray; |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 * | 296 * |
| 297 * @param quicConnectionOptions comma-separated QUIC options (for exampl
e | 297 * @param quicConnectionOptions comma-separated QUIC options (for exampl
e |
| 298 * "PACE,IW10") to use if QUIC is enabled. | 298 * "PACE,IW10") to use if QUIC is enabled. |
| 299 * @return the builder to facilitate chaining. | 299 * @return the builder to facilitate chaining. |
| 300 */ | 300 */ |
| 301 public Builder setExperimentalQuicConnectionOptions(String quicConnectio
nOptions) { | 301 public Builder setExperimentalQuicConnectionOptions(String quicConnectio
nOptions) { |
| 302 return putString(CronetEngineBuilderList.QUIC_OPTIONS, quicConnectio
nOptions); | 302 return putString(CronetEngineBuilderList.QUIC_OPTIONS, quicConnectio
nOptions); |
| 303 } | 303 } |
| 304 | 304 |
| 305 /** | 305 /** |
| 306 * Sets a native MockCertVerifier for testing. |
| 307 */ |
| 308 Builder setMockCertVerifierForTesting(long mockCertVerifier) { |
| 309 return putString( |
| 310 CronetEngineBuilderList.MOCK_CERT_VERIFIER, String.valueOf(m
ockCertVerifier)); |
| 311 } |
| 312 |
| 313 /** |
| 306 * Get JSON string representation of the builder. | 314 * Get JSON string representation of the builder. |
| 307 */ | 315 */ |
| 308 @Override | 316 @Override |
| 309 public String toString() { | 317 public String toString() { |
| 310 return mConfig.toString(); | 318 return mConfig.toString(); |
| 311 } | 319 } |
| 312 | 320 |
| 313 /** | 321 /** |
| 314 * Returns {@link Context} for builder. | 322 * Returns {@link Context} for builder. |
| 315 * | 323 * |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 cronetEngine = possibleEngine; | 635 cronetEngine = possibleEngine; |
| 628 } | 636 } |
| 629 } catch (ClassNotFoundException e) { | 637 } catch (ClassNotFoundException e) { |
| 630 // Leave as null. | 638 // Leave as null. |
| 631 } catch (Exception e) { | 639 } catch (Exception e) { |
| 632 throw new IllegalStateException("Cannot instantiate: " + CRONET_URL_
REQUEST_CONTEXT, e); | 640 throw new IllegalStateException("Cannot instantiate: " + CRONET_URL_
REQUEST_CONTEXT, e); |
| 633 } | 641 } |
| 634 return cronetEngine; | 642 return cronetEngine; |
| 635 } | 643 } |
| 636 } | 644 } |
| OLD | NEW |