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.util.Log; | 7 import android.util.Log; |
8 import android.util.Pair; | 8 import android.util.Pair; |
9 | 9 |
10 import org.chromium.base.VisibleForTesting; | 10 import org.chromium.base.VisibleForTesting; |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 Log.e(CronetUrlRequestContext.LOG_TAG, | 459 Log.e(CronetUrlRequestContext.LOG_TAG, |
460 "Exception posting task to executor", failException); | 460 "Exception posting task to executor", failException); |
461 // If posting a task throws an exception, then there is no choice | 461 // If posting a task throws an exception, then there is no choice |
462 // but to cancel the request. | 462 // but to cancel the request. |
463 cancel(); | 463 cancel(); |
464 } | 464 } |
465 } | 465 } |
466 | 466 |
467 private static int convertRequestPriority(int priority) { | 467 private static int convertRequestPriority(int priority) { |
468 switch (priority) { | 468 switch (priority) { |
469 case REQUEST_PRIORITY_IDLE: | 469 case Builder.REQUEST_PRIORITY_IDLE: |
470 return RequestPriority.IDLE; | 470 return RequestPriority.IDLE; |
471 case REQUEST_PRIORITY_LOWEST: | 471 case Builder.REQUEST_PRIORITY_LOWEST: |
472 return RequestPriority.LOWEST; | 472 return RequestPriority.LOWEST; |
473 case REQUEST_PRIORITY_LOW: | 473 case Builder.REQUEST_PRIORITY_LOW: |
474 return RequestPriority.LOW; | 474 return RequestPriority.LOW; |
475 case REQUEST_PRIORITY_MEDIUM: | 475 case Builder.REQUEST_PRIORITY_MEDIUM: |
476 return RequestPriority.MEDIUM; | 476 return RequestPriority.MEDIUM; |
477 case REQUEST_PRIORITY_HIGHEST: | 477 case Builder.REQUEST_PRIORITY_HIGHEST: |
478 return RequestPriority.HIGHEST; | 478 return RequestPriority.HIGHEST; |
479 default: | 479 default: |
480 return RequestPriority.MEDIUM; | 480 return RequestPriority.MEDIUM; |
481 } | 481 } |
482 } | 482 } |
483 | 483 |
484 private NativeResponseInfo prepareResponseInfoOnNetworkThread( | 484 private NativeResponseInfo prepareResponseInfoOnNetworkThread( |
485 int httpStatusCode) { | 485 int httpStatusCode) { |
486 long urlRequestAdapter; | 486 long urlRequestAdapter; |
487 synchronized (mUrlRequestAdapterLock) { | 487 synchronized (mUrlRequestAdapterLock) { |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 | 805 |
806 @NativeClassQualifiedName("CronetURLRequestAdapter") | 806 @NativeClassQualifiedName("CronetURLRequestAdapter") |
807 private native String nativeGetProxyServer(long nativePtr); | 807 private native String nativeGetProxyServer(long nativePtr); |
808 | 808 |
809 @NativeClassQualifiedName("CronetURLRequestAdapter") | 809 @NativeClassQualifiedName("CronetURLRequestAdapter") |
810 private native void nativeGetStatus(long nativePtr, UrlRequest.StatusListene
r listener); | 810 private native void nativeGetStatus(long nativePtr, UrlRequest.StatusListene
r listener); |
811 | 811 |
812 @NativeClassQualifiedName("CronetURLRequestAdapter") | 812 @NativeClassQualifiedName("CronetURLRequestAdapter") |
813 private native boolean nativeGetWasCached(long nativePtr); | 813 private native boolean nativeGetWasCached(long nativePtr); |
814 } | 814 } |
OLD | NEW |