| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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.os.Build; | 8 import android.os.Build; |
| 9 import android.os.ConditionVariable; | 9 import android.os.ConditionVariable; |
| 10 import android.os.Handler; | 10 import android.os.Handler; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 111 |
| 112 static long createNativeUrlRequestContextConfig( | 112 static long createNativeUrlRequestContextConfig( |
| 113 final Context context, CronetEngine.Builder builder) { | 113 final Context context, CronetEngine.Builder builder) { |
| 114 final long urlRequestContextConfig = nativeCreateRequestContextConfig( | 114 final long urlRequestContextConfig = nativeCreateRequestContextConfig( |
| 115 builder.getUserAgent(), builder.storagePath(), builder.quicEnabl
ed(), | 115 builder.getUserAgent(), builder.storagePath(), builder.quicEnabl
ed(), |
| 116 builder.getDefaultQuicUserAgentId(context), builder.http2Enabled
(), | 116 builder.getDefaultQuicUserAgentId(context), builder.http2Enabled
(), |
| 117 builder.sdchEnabled(), builder.dataReductionProxyKey(), | 117 builder.sdchEnabled(), builder.dataReductionProxyKey(), |
| 118 builder.dataReductionProxyPrimaryProxy(), builder.dataReductionP
roxyFallbackProxy(), | 118 builder.dataReductionProxyPrimaryProxy(), builder.dataReductionP
roxyFallbackProxy(), |
| 119 builder.dataReductionProxySecureProxyCheckUrl(), builder.cacheDi
sabled(), | 119 builder.dataReductionProxySecureProxyCheckUrl(), builder.cacheDi
sabled(), |
| 120 builder.httpCacheMode(), builder.httpCacheMaxSize(), builder.exp
erimentalOptions(), | 120 builder.httpCacheMode(), builder.httpCacheMaxSize(), builder.exp
erimentalOptions(), |
| 121 builder.mockCertVerifier(), builder.networkQualityEstimatorEnabl
ed(), | 121 builder.mockCertVerifier(), builder.networkQualityEstimatorEnabl
ed()); |
| 122 builder.publicKeyPinningBypassForLocalTrustAnchorsEnabled()); | |
| 123 for (Builder.QuicHint quicHint : builder.quicHints()) { | 122 for (Builder.QuicHint quicHint : builder.quicHints()) { |
| 124 nativeAddQuicHint(urlRequestContextConfig, quicHint.mHost, quicHint.
mPort, | 123 nativeAddQuicHint(urlRequestContextConfig, quicHint.mHost, quicHint.
mPort, |
| 125 quicHint.mAlternatePort); | 124 quicHint.mAlternatePort); |
| 126 } | 125 } |
| 127 for (Builder.Pkp pkp : builder.publicKeyPins()) { | 126 for (Builder.Pkp pkp : builder.publicKeyPins()) { |
| 128 nativeAddPkp(urlRequestContextConfig, pkp.mHost, pkp.mHashes, pkp.mI
ncludeSubdomains, | 127 nativeAddPkp(urlRequestContextConfig, pkp.mHost, pkp.mHashes, pkp.mI
ncludeSubdomains, |
| 129 pkp.mExpirationDate.getTime()); | 128 pkp.mExpirationDate.getTime()); |
| 130 } | 129 } |
| 131 return urlRequestContextConfig; | 130 return urlRequestContextConfig; |
| 132 } | 131 } |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 } | 535 } |
| 537 } | 536 } |
| 538 | 537 |
| 539 // Native methods are implemented in cronet_url_request_context_adapter.cc. | 538 // Native methods are implemented in cronet_url_request_context_adapter.cc. |
| 540 private static native long nativeCreateRequestContextConfig(String userAgent
, | 539 private static native long nativeCreateRequestContextConfig(String userAgent
, |
| 541 String storagePath, boolean quicEnabled, String quicUserAgentId, boo
lean http2Enabled, | 540 String storagePath, boolean quicEnabled, String quicUserAgentId, boo
lean http2Enabled, |
| 542 boolean sdchEnabled, String dataReductionProxyKey, | 541 boolean sdchEnabled, String dataReductionProxyKey, |
| 543 String dataReductionProxyPrimaryProxy, String dataReductionProxyFall
backProxy, | 542 String dataReductionProxyPrimaryProxy, String dataReductionProxyFall
backProxy, |
| 544 String dataReductionProxySecureProxyCheckUrl, boolean disableCache,
int httpCacheMode, | 543 String dataReductionProxySecureProxyCheckUrl, boolean disableCache,
int httpCacheMode, |
| 545 long httpCacheMaxSize, String experimentalOptions, long mockCertVeri
fier, | 544 long httpCacheMaxSize, String experimentalOptions, long mockCertVeri
fier, |
| 546 boolean enableNetworkQualityEstimator, | 545 boolean enableNetworkQualityEstimator); |
| 547 boolean bypassPublicKeyPinningForLocalTrustAnchors); | |
| 548 | 546 |
| 549 private static native void nativeAddQuicHint( | 547 private static native void nativeAddQuicHint( |
| 550 long urlRequestContextConfig, String host, int port, int alternatePo
rt); | 548 long urlRequestContextConfig, String host, int port, int alternatePo
rt); |
| 551 | 549 |
| 552 private static native void nativeAddPkp(long urlRequestContextConfig, String
host, | 550 private static native void nativeAddPkp(long urlRequestContextConfig, String
host, |
| 553 byte[][] hashes, boolean includeSubdomains, long expirationTime); | 551 byte[][] hashes, boolean includeSubdomains, long expirationTime); |
| 554 | 552 |
| 555 private static native long nativeCreateRequestContextAdapter(long urlRequest
ContextConfig); | 553 private static native long nativeCreateRequestContextAdapter(long urlRequest
ContextConfig); |
| 556 | 554 |
| 557 private static native int nativeSetMinLogLevel(int loggingLevel); | 555 private static native int nativeSetMinLogLevel(int loggingLevel); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 577 | 575 |
| 578 @NativeClassQualifiedName("CronetURLRequestContextAdapter") | 576 @NativeClassQualifiedName("CronetURLRequestContextAdapter") |
| 579 private native void nativeEnableNetworkQualityEstimator(long nativePtr); | 577 private native void nativeEnableNetworkQualityEstimator(long nativePtr); |
| 580 | 578 |
| 581 @NativeClassQualifiedName("CronetURLRequestContextAdapter") | 579 @NativeClassQualifiedName("CronetURLRequestContextAdapter") |
| 582 private native void nativeProvideRTTObservations(long nativePtr, boolean sho
uld); | 580 private native void nativeProvideRTTObservations(long nativePtr, boolean sho
uld); |
| 583 | 581 |
| 584 @NativeClassQualifiedName("CronetURLRequestContextAdapter") | 582 @NativeClassQualifiedName("CronetURLRequestContextAdapter") |
| 585 private native void nativeProvideThroughputObservations(long nativePtr, bool
ean should); | 583 private native void nativeProvideThroughputObservations(long nativePtr, bool
ean should); |
| 586 } | 584 } |
| OLD | NEW |