| 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.impl; | 5 package org.chromium.net.impl; |
| 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; |
| 11 import android.os.Looper; | 11 import android.os.Looper; |
| 12 import android.os.Process; | 12 import android.os.Process; |
| 13 import android.util.Log; | 13 import android.util.Log; |
| 14 | 14 |
| 15 import org.chromium.base.ObserverList; | 15 import org.chromium.base.ObserverList; |
| 16 import org.chromium.base.VisibleForTesting; | 16 import org.chromium.base.VisibleForTesting; |
| 17 import org.chromium.base.annotations.CalledByNative; | 17 import org.chromium.base.annotations.CalledByNative; |
| 18 import org.chromium.base.annotations.JNINamespace; | 18 import org.chromium.base.annotations.JNINamespace; |
| 19 import org.chromium.base.annotations.NativeClassQualifiedName; | 19 import org.chromium.base.annotations.NativeClassQualifiedName; |
| 20 import org.chromium.base.annotations.UsedByReflection; | 20 import org.chromium.base.annotations.UsedByReflection; |
| 21 import org.chromium.net.BidirectionalStream; | 21 import org.chromium.net.BidirectionalStream; |
| 22 import org.chromium.net.CronetEngine; | 22 import org.chromium.net.CronetEngine; |
| 23 import org.chromium.net.NetworkQualityRttListener; | 23 import org.chromium.net.NetworkQualityRttListener; |
| 24 import org.chromium.net.NetworkQualityThroughputListener; | 24 import org.chromium.net.NetworkQualityThroughputListener; |
| 25 import org.chromium.net.RequestFinishedInfo; |
| 25 import org.chromium.net.RequestFinishedListener; | 26 import org.chromium.net.RequestFinishedListener; |
| 26 import org.chromium.net.UrlRequest; | 27 import org.chromium.net.UrlRequest; |
| 27 import org.chromium.net.urlconnection.CronetHttpURLConnection; | 28 import org.chromium.net.urlconnection.CronetHttpURLConnection; |
| 28 import org.chromium.net.urlconnection.CronetURLStreamHandlerFactory; | 29 import org.chromium.net.urlconnection.CronetURLStreamHandlerFactory; |
| 29 | 30 |
| 30 import java.net.Proxy; | 31 import java.net.Proxy; |
| 31 import java.net.URL; | 32 import java.net.URL; |
| 32 import java.net.URLConnection; | 33 import java.net.URLConnection; |
| 33 import java.net.URLStreamHandlerFactory; | 34 import java.net.URLStreamHandlerFactory; |
| 34 import java.util.ArrayList; | 35 import java.util.ArrayList; |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 } | 470 } |
| 470 | 471 |
| 471 @SuppressWarnings("unused") | 472 @SuppressWarnings("unused") |
| 472 @CalledByNative | 473 @CalledByNative |
| 473 private void onGetCertVerifierData(String certVerifierData) { | 474 private void onGetCertVerifierData(String certVerifierData) { |
| 474 mCertVerifierData = certVerifierData; | 475 mCertVerifierData = certVerifierData; |
| 475 mWaitGetCertVerifierDataComplete.open(); | 476 mWaitGetCertVerifierDataComplete.open(); |
| 476 } | 477 } |
| 477 | 478 |
| 478 void reportFinished(final CronetUrlRequest request) { | 479 void reportFinished(final CronetUrlRequest request) { |
| 479 final UrlRequestInfo requestInfo = request.getRequestInfo(); | 480 final RequestFinishedInfo requestInfo = request.getRequestInfo(); |
| 480 ArrayList<RequestFinishedListener> currentListeners; | 481 ArrayList<RequestFinishedListener> currentListeners; |
| 481 synchronized (mFinishedListenerLock) { | 482 synchronized (mFinishedListenerLock) { |
| 482 currentListeners = new ArrayList<RequestFinishedListener>(mFinishedL
istenerList); | 483 currentListeners = new ArrayList<RequestFinishedListener>(mFinishedL
istenerList); |
| 483 } | 484 } |
| 484 for (final RequestFinishedListener listener : currentListeners) { | 485 for (final RequestFinishedListener listener : currentListeners) { |
| 485 Runnable task = new Runnable() { | 486 Runnable task = new Runnable() { |
| 486 @Override | 487 @Override |
| 487 public void run() { | 488 public void run() { |
| 488 listener.onRequestFinished(requestInfo); | 489 listener.onRequestFinished(requestInfo); |
| 489 } | 490 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 @NativeClassQualifiedName("CronetURLRequestContextAdapter") | 542 @NativeClassQualifiedName("CronetURLRequestContextAdapter") |
| 542 private native void nativeConfigureNetworkQualityEstimatorForTesting( | 543 private native void nativeConfigureNetworkQualityEstimatorForTesting( |
| 543 long nativePtr, boolean useLocalHostRequests, boolean useSmallerResp
onses); | 544 long nativePtr, boolean useLocalHostRequests, boolean useSmallerResp
onses); |
| 544 | 545 |
| 545 @NativeClassQualifiedName("CronetURLRequestContextAdapter") | 546 @NativeClassQualifiedName("CronetURLRequestContextAdapter") |
| 546 private native void nativeProvideRTTObservations(long nativePtr, boolean sho
uld); | 547 private native void nativeProvideRTTObservations(long nativePtr, boolean sho
uld); |
| 547 | 548 |
| 548 @NativeClassQualifiedName("CronetURLRequestContextAdapter") | 549 @NativeClassQualifiedName("CronetURLRequestContextAdapter") |
| 549 private native void nativeProvideThroughputObservations(long nativePtr, bool
ean should); | 550 private native void nativeProvideThroughputObservations(long nativePtr, bool
ean should); |
| 550 } | 551 } |
| OLD | NEW |