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.os.Build; | 7 import android.os.Build; |
8 import android.os.ConditionVariable; | 8 import android.os.ConditionVariable; |
9 import android.os.Handler; | 9 import android.os.Handler; |
10 import android.os.Looper; | 10 import android.os.Looper; |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 quicHint.mAlternatePort); | 112 quicHint.mAlternatePort); |
113 } | 113 } |
114 for (Builder.Pkp pkp : builder.publicKeyPins()) { | 114 for (Builder.Pkp pkp : builder.publicKeyPins()) { |
115 nativeAddPkp(urlRequestContextConfig, pkp.mHost, pkp.mHashes, pkp.mI
ncludeSubdomains, | 115 nativeAddPkp(urlRequestContextConfig, pkp.mHost, pkp.mHashes, pkp.mI
ncludeSubdomains, |
116 pkp.mExpirationDate.getTime()); | 116 pkp.mExpirationDate.getTime()); |
117 } | 117 } |
118 return urlRequestContextConfig; | 118 return urlRequestContextConfig; |
119 } | 119 } |
120 | 120 |
121 @Override | 121 @Override |
122 public UrlRequest createRequest(String url, UrlRequest.Callback callback, Ex
ecutor executor) { | |
123 synchronized (mLock) { | |
124 checkHaveAdapter(); | |
125 return new CronetUrlRequest(this, mUrlRequestContextAdapter, url, | |
126 UrlRequest.Builder.REQUEST_PRIORITY_MEDIUM, callback, execut
or); | |
127 } | |
128 } | |
129 | |
130 @Override | |
131 public UrlRequest createRequest(String url, UrlRequest.Callback callback, Ex
ecutor executor, | 122 public UrlRequest createRequest(String url, UrlRequest.Callback callback, Ex
ecutor executor, |
132 @UrlRequest.Builder.RequestPriority int priority) { | 123 @UrlRequest.Builder.RequestPriority int priority) { |
133 synchronized (mLock) { | 124 synchronized (mLock) { |
134 checkHaveAdapter(); | 125 checkHaveAdapter(); |
135 return new CronetUrlRequest( | 126 return new CronetUrlRequest( |
136 this, mUrlRequestContextAdapter, url, priority, callback, ex
ecutor); | 127 this, mUrlRequestContextAdapter, url, priority, callback, ex
ecutor); |
137 } | 128 } |
138 } | 129 } |
139 | 130 |
140 @Override | 131 @Override |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 @NativeClassQualifiedName("CronetURLRequestContextAdapter") | 447 @NativeClassQualifiedName("CronetURLRequestContextAdapter") |
457 private native void nativeEnableNetworkQualityEstimator( | 448 private native void nativeEnableNetworkQualityEstimator( |
458 long nativePtr, boolean useLocalHostRequests, boolean useSmallerResp
onses); | 449 long nativePtr, boolean useLocalHostRequests, boolean useSmallerResp
onses); |
459 | 450 |
460 @NativeClassQualifiedName("CronetURLRequestContextAdapter") | 451 @NativeClassQualifiedName("CronetURLRequestContextAdapter") |
461 private native void nativeProvideRTTObservations(long nativePtr, boolean sho
uld); | 452 private native void nativeProvideRTTObservations(long nativePtr, boolean sho
uld); |
462 | 453 |
463 @NativeClassQualifiedName("CronetURLRequestContextAdapter") | 454 @NativeClassQualifiedName("CronetURLRequestContextAdapter") |
464 private native void nativeProvideThroughputObservations(long nativePtr, bool
ean should); | 455 private native void nativeProvideThroughputObservations(long nativePtr, bool
ean should); |
465 } | 456 } |
OLD | NEW |