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

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

Issue 2805053005: [Cronet] Enable Brotli (Closed)
Patch Set: add test Created 3 years, 8 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.impl; 5 package org.chromium.net.impl;
6 6
7 import android.os.ConditionVariable; 7 import android.os.ConditionVariable;
8 import android.os.Handler; 8 import android.os.Handler;
9 import android.os.Looper; 9 import android.os.Looper;
10 import android.os.Process; 10 import android.os.Process;
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 } else { 180 } else {
181 new Handler(Looper.getMainLooper()).post(task); 181 new Handler(Looper.getMainLooper()).post(task);
182 } 182 }
183 } 183 }
184 184
185 @VisibleForTesting 185 @VisibleForTesting
186 public static long createNativeUrlRequestContextConfig(CronetEngineBuilderIm pl builder) { 186 public static long createNativeUrlRequestContextConfig(CronetEngineBuilderIm pl builder) {
187 final long urlRequestContextConfig = nativeCreateRequestContextConfig( 187 final long urlRequestContextConfig = nativeCreateRequestContextConfig(
188 builder.getUserAgent(), builder.storagePath(), builder.quicEnabl ed(), 188 builder.getUserAgent(), builder.storagePath(), builder.quicEnabl ed(),
189 builder.getDefaultQuicUserAgentId(), builder.http2Enabled(), bui lder.sdchEnabled(), 189 builder.getDefaultQuicUserAgentId(), builder.http2Enabled(), bui lder.sdchEnabled(),
190 builder.dataReductionProxyKey(), builder.dataReductionProxyPrima ryProxy(), 190 builder.brotliEnabled(), builder.dataReductionProxyKey(),
191 builder.dataReductionProxyFallbackProxy(), 191 builder.dataReductionProxyPrimaryProxy(), builder.dataReductionP roxyFallbackProxy(),
192 builder.dataReductionProxySecureProxyCheckUrl(), builder.cacheDi sabled(), 192 builder.dataReductionProxySecureProxyCheckUrl(), builder.cacheDi sabled(),
193 builder.httpCacheMode(), builder.httpCacheMaxSize(), builder.exp erimentalOptions(), 193 builder.httpCacheMode(), builder.httpCacheMaxSize(), builder.exp erimentalOptions(),
194 builder.mockCertVerifier(), builder.networkQualityEstimatorEnabl ed(), 194 builder.mockCertVerifier(), builder.networkQualityEstimatorEnabl ed(),
195 builder.publicKeyPinningBypassForLocalTrustAnchorsEnabled(), 195 builder.publicKeyPinningBypassForLocalTrustAnchorsEnabled(),
196 builder.certVerifierData()); 196 builder.certVerifierData());
197 for (CronetEngineBuilderImpl.QuicHint quicHint : builder.quicHints()) { 197 for (CronetEngineBuilderImpl.QuicHint quicHint : builder.quicHints()) {
198 nativeAddQuicHint(urlRequestContextConfig, quicHint.mHost, quicHint. mPort, 198 nativeAddQuicHint(urlRequestContextConfig, quicHint.mHost, quicHint. mPort,
199 quicHint.mAlternatePort); 199 quicHint.mAlternatePort);
200 } 200 }
201 for (CronetEngineBuilderImpl.Pkp pkp : builder.publicKeyPins()) { 201 for (CronetEngineBuilderImpl.Pkp pkp : builder.publicKeyPins()) {
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 executor.execute(task); 673 executor.execute(task);
674 } catch (RejectedExecutionException failException) { 674 } catch (RejectedExecutionException failException) {
675 Log.e(CronetUrlRequestContext.LOG_TAG, "Exception posting task to ex ecutor", 675 Log.e(CronetUrlRequestContext.LOG_TAG, "Exception posting task to ex ecutor",
676 failException); 676 failException);
677 } 677 }
678 } 678 }
679 679
680 // Native methods are implemented in cronet_url_request_context_adapter.cc. 680 // Native methods are implemented in cronet_url_request_context_adapter.cc.
681 private static native long nativeCreateRequestContextConfig(String userAgent , 681 private static native long nativeCreateRequestContextConfig(String userAgent ,
682 String storagePath, boolean quicEnabled, String quicUserAgentId, boo lean http2Enabled, 682 String storagePath, boolean quicEnabled, String quicUserAgentId, boo lean http2Enabled,
683 boolean sdchEnabled, String dataReductionProxyKey, 683 boolean sdchEnabled, boolean brotliEnabled, String dataReductionProx yKey,
684 String dataReductionProxyPrimaryProxy, String dataReductionProxyFall backProxy, 684 String dataReductionProxyPrimaryProxy, String dataReductionProxyFall backProxy,
685 String dataReductionProxySecureProxyCheckUrl, boolean disableCache, int httpCacheMode, 685 String dataReductionProxySecureProxyCheckUrl, boolean disableCache, int httpCacheMode,
686 long httpCacheMaxSize, String experimentalOptions, long mockCertVeri fier, 686 long httpCacheMaxSize, String experimentalOptions, long mockCertVeri fier,
687 boolean enableNetworkQualityEstimator, 687 boolean enableNetworkQualityEstimator,
688 boolean bypassPublicKeyPinningForLocalTrustAnchors, String certVerif ierData); 688 boolean bypassPublicKeyPinningForLocalTrustAnchors, String certVerif ierData);
689 689
690 private static native void nativeAddQuicHint( 690 private static native void nativeAddQuicHint(
691 long urlRequestContextConfig, String host, int port, int alternatePo rt); 691 long urlRequestContextConfig, String host, int port, int alternatePo rt);
692 692
693 private static native void nativeAddPkp(long urlRequestContextConfig, String host, 693 private static native void nativeAddPkp(long urlRequestContextConfig, String host,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 @NativeClassQualifiedName("CronetURLRequestContextAdapter") 725 @NativeClassQualifiedName("CronetURLRequestContextAdapter")
726 private native void nativeProvideRTTObservations(long nativePtr, boolean sho uld); 726 private native void nativeProvideRTTObservations(long nativePtr, boolean sho uld);
727 727
728 @NativeClassQualifiedName("CronetURLRequestContextAdapter") 728 @NativeClassQualifiedName("CronetURLRequestContextAdapter")
729 private native void nativeProvideThroughputObservations(long nativePtr, bool ean should); 729 private native void nativeProvideThroughputObservations(long nativePtr, bool ean should);
730 730
731 public boolean isNetworkThread(Thread thread) { 731 public boolean isNetworkThread(Thread thread) {
732 return thread == mNetworkThread; 732 return thread == mNetworkThread;
733 } 733 }
734 } 734 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698