| 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; |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 } | 420 } |
| 421 } | 421 } |
| 422 | 422 |
| 423 @Override | 423 @Override |
| 424 public void removeRequestFinishedListener(RequestFinishedInfo.Listener liste
ner) { | 424 public void removeRequestFinishedListener(RequestFinishedInfo.Listener liste
ner) { |
| 425 synchronized (mFinishedListenerLock) { | 425 synchronized (mFinishedListenerLock) { |
| 426 mFinishedListenerList.remove(listener); | 426 mFinishedListenerList.remove(listener); |
| 427 } | 427 } |
| 428 } | 428 } |
| 429 | 429 |
| 430 boolean hasRequestFinishedListener() { |
| 431 synchronized (mFinishedListenerLock) { |
| 432 return !mFinishedListenerList.isEmpty(); |
| 433 } |
| 434 } |
| 435 |
| 430 @Override | 436 @Override |
| 431 public URLConnection openConnection(URL url) { | 437 public URLConnection openConnection(URL url) { |
| 432 return openConnection(url, Proxy.NO_PROXY); | 438 return openConnection(url, Proxy.NO_PROXY); |
| 433 } | 439 } |
| 434 | 440 |
| 435 @Override | 441 @Override |
| 436 public URLConnection openConnection(URL url, Proxy proxy) { | 442 public URLConnection openConnection(URL url, Proxy proxy) { |
| 437 if (proxy.type() != Proxy.Type.DIRECT) { | 443 if (proxy.type() != Proxy.Type.DIRECT) { |
| 438 throw new UnsupportedOperationException(); | 444 throw new UnsupportedOperationException(); |
| 439 } | 445 } |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 @NativeClassQualifiedName("CronetURLRequestContextAdapter") | 640 @NativeClassQualifiedName("CronetURLRequestContextAdapter") |
| 635 private native void nativeProvideRTTObservations(long nativePtr, boolean sho
uld); | 641 private native void nativeProvideRTTObservations(long nativePtr, boolean sho
uld); |
| 636 | 642 |
| 637 @NativeClassQualifiedName("CronetURLRequestContextAdapter") | 643 @NativeClassQualifiedName("CronetURLRequestContextAdapter") |
| 638 private native void nativeProvideThroughputObservations(long nativePtr, bool
ean should); | 644 private native void nativeProvideThroughputObservations(long nativePtr, bool
ean should); |
| 639 | 645 |
| 640 public boolean isNetworkThread(Thread thread) { | 646 public boolean isNetworkThread(Thread thread) { |
| 641 return thread == mNetworkThread; | 647 return thread == mNetworkThread; |
| 642 } | 648 } |
| 643 } | 649 } |
| OLD | NEW |