Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: components/cronet/android/java/src/org/chromium/net/CronetUrlRequestContext.java

Issue 2052363002: Enable public key pinning of local trust anchors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed CronetPerfTestActivity test Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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());
122 for (Builder.QuicHint quicHint : builder.quicHints()) { 123 for (Builder.QuicHint quicHint : builder.quicHints()) {
123 nativeAddQuicHint(urlRequestContextConfig, quicHint.mHost, quicHint. mPort, 124 nativeAddQuicHint(urlRequestContextConfig, quicHint.mHost, quicHint. mPort,
124 quicHint.mAlternatePort); 125 quicHint.mAlternatePort);
125 } 126 }
126 for (Builder.Pkp pkp : builder.publicKeyPins()) { 127 for (Builder.Pkp pkp : builder.publicKeyPins()) {
127 nativeAddPkp(urlRequestContextConfig, pkp.mHost, pkp.mHashes, pkp.mI ncludeSubdomains, 128 nativeAddPkp(urlRequestContextConfig, pkp.mHost, pkp.mHashes, pkp.mI ncludeSubdomains,
128 pkp.mExpirationDate.getTime()); 129 pkp.mExpirationDate.getTime());
129 } 130 }
130 return urlRequestContextConfig; 131 return urlRequestContextConfig;
131 } 132 }
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 } 536 }
536 } 537 }
537 538
538 // Native methods are implemented in cronet_url_request_context_adapter.cc. 539 // Native methods are implemented in cronet_url_request_context_adapter.cc.
539 private static native long nativeCreateRequestContextConfig(String userAgent , 540 private static native long nativeCreateRequestContextConfig(String userAgent ,
540 String storagePath, boolean quicEnabled, String quicUserAgentId, boo lean http2Enabled, 541 String storagePath, boolean quicEnabled, String quicUserAgentId, boo lean http2Enabled,
541 boolean sdchEnabled, String dataReductionProxyKey, 542 boolean sdchEnabled, String dataReductionProxyKey,
542 String dataReductionProxyPrimaryProxy, String dataReductionProxyFall backProxy, 543 String dataReductionProxyPrimaryProxy, String dataReductionProxyFall backProxy,
543 String dataReductionProxySecureProxyCheckUrl, boolean disableCache, int httpCacheMode, 544 String dataReductionProxySecureProxyCheckUrl, boolean disableCache, int httpCacheMode,
544 long httpCacheMaxSize, String experimentalOptions, long mockCertVeri fier, 545 long httpCacheMaxSize, String experimentalOptions, long mockCertVeri fier,
545 boolean enableNetworkQualityEstimator); 546 boolean enableNetworkQualityEstimator,
547 boolean bypassPublicKeyPinningForLocalTrustAnchors);
546 548
547 private static native void nativeAddQuicHint( 549 private static native void nativeAddQuicHint(
548 long urlRequestContextConfig, String host, int port, int alternatePo rt); 550 long urlRequestContextConfig, String host, int port, int alternatePo rt);
549 551
550 private static native void nativeAddPkp(long urlRequestContextConfig, String host, 552 private static native void nativeAddPkp(long urlRequestContextConfig, String host,
551 byte[][] hashes, boolean includeSubdomains, long expirationTime); 553 byte[][] hashes, boolean includeSubdomains, long expirationTime);
552 554
553 private static native long nativeCreateRequestContextAdapter(long urlRequest ContextConfig); 555 private static native long nativeCreateRequestContextAdapter(long urlRequest ContextConfig);
554 556
555 private static native int nativeSetMinLogLevel(int loggingLevel); 557 private static native int nativeSetMinLogLevel(int loggingLevel);
(...skipping 19 matching lines...) Expand all
575 577
576 @NativeClassQualifiedName("CronetURLRequestContextAdapter") 578 @NativeClassQualifiedName("CronetURLRequestContextAdapter")
577 private native void nativeEnableNetworkQualityEstimator(long nativePtr); 579 private native void nativeEnableNetworkQualityEstimator(long nativePtr);
578 580
579 @NativeClassQualifiedName("CronetURLRequestContextAdapter") 581 @NativeClassQualifiedName("CronetURLRequestContextAdapter")
580 private native void nativeProvideRTTObservations(long nativePtr, boolean sho uld); 582 private native void nativeProvideRTTObservations(long nativePtr, boolean sho uld);
581 583
582 @NativeClassQualifiedName("CronetURLRequestContextAdapter") 584 @NativeClassQualifiedName("CronetURLRequestContextAdapter")
583 private native void nativeProvideThroughputObservations(long nativePtr, bool ean should); 585 private native void nativeProvideThroughputObservations(long nativePtr, bool ean should);
584 } 586 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698