Chromium Code Reviews| 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.os.SystemClock; | 7 import android.os.SystemClock; |
| 8 import android.support.annotation.Nullable; | 8 import android.support.annotation.Nullable; |
| 9 import android.util.Log; | 9 import android.util.Log; |
| 10 | 10 |
| (...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 485 }; | 485 }; |
| 486 postTaskToExecutor(task); | 486 postTaskToExecutor(task); |
| 487 } | 487 } |
| 488 | 488 |
| 489 //////////////////////////////////////////////// | 489 //////////////////////////////////////////////// |
| 490 // Private methods called by the native code. | 490 // Private methods called by the native code. |
| 491 // Always called on network thread. | 491 // Always called on network thread. |
| 492 //////////////////////////////////////////////// | 492 //////////////////////////////////////////////// |
| 493 | 493 |
| 494 /** | 494 /** |
| 495 * Called before following redirects. The redirect will automatically be | 495 * Called before following redirects. The redirect will only be followed if |
| 496 * followed, unless the request is paused or canceled during this | 496 * {@link #followRedirect()} is called. If the redirect response has a body, it will be ignored. |
| 497 * callback. If the redirect response has a body, it will be ignored. | |
| 498 * This will only be called between start and onResponseStarted. | 497 * This will only be called between start and onResponseStarted. |
| 499 * | 498 * |
| 500 * @param newLocation Location where request is redirected. | 499 * @param newLocation Location where request is redirected. |
| 501 * @param httpStatusCode from redirect response | 500 * @param httpStatusCode from redirect response |
| 502 * @param receivedBytesCount count of bytes received for redirect response | 501 * @param receivedBytesCount count of bytes received for redirect response |
| 503 * @param headers an array of response headers with keys at the even indices | 502 * @param headers an array of response headers with keys at the even indices followed by the |
|
xunjieli
2016/07/29 16:35:24
Why is this line changed? Could you revert?
mgersh
2016/07/29 18:21:52
Done.
| |
| 504 * followed by the corresponding values at the odd indices. | 503 * corresponding values at the odd indices. |
| 505 */ | 504 */ |
| 506 @SuppressWarnings("unused") | 505 @SuppressWarnings("unused") |
| 507 @CalledByNative | 506 @CalledByNative |
| 508 private void onRedirectReceived(final String newLocation, int httpStatusCode , | 507 private void onRedirectReceived(final String newLocation, int httpStatusCode , |
| 509 String httpStatusText, String[] headers, boolean wasCached, String n egotiatedProtocol, | 508 String httpStatusText, String[] headers, boolean wasCached, String n egotiatedProtocol, |
| 510 String proxyServer, long receivedBytesCount) { | 509 String proxyServer, long receivedBytesCount) { |
| 511 final UrlResponseInfo responseInfo = prepareResponseInfoOnNetworkThread( httpStatusCode, | 510 final UrlResponseInfo responseInfo = prepareResponseInfoOnNetworkThread( httpStatusCode, |
| 512 httpStatusText, headers, wasCached, negotiatedProtocol, proxySer ver); | 511 httpStatusText, headers, wasCached, negotiatedProtocol, proxySer ver); |
| 513 mReceivedBytesCountFromRedirects += receivedBytesCount; | 512 mReceivedBytesCountFromRedirects += receivedBytesCount; |
| 514 responseInfo.setReceivedBytesCount(mReceivedBytesCountFromRedirects); | 513 responseInfo.setReceivedBytesCount(mReceivedBytesCountFromRedirects); |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 758 @NativeClassQualifiedName("CronetURLRequestAdapter") | 757 @NativeClassQualifiedName("CronetURLRequestAdapter") |
| 759 private native boolean nativeReadData( | 758 private native boolean nativeReadData( |
| 760 long nativePtr, ByteBuffer byteBuffer, int position, int capacity); | 759 long nativePtr, ByteBuffer byteBuffer, int position, int capacity); |
| 761 | 760 |
| 762 @NativeClassQualifiedName("CronetURLRequestAdapter") | 761 @NativeClassQualifiedName("CronetURLRequestAdapter") |
| 763 private native void nativeDestroy(long nativePtr, boolean sendOnCanceled); | 762 private native void nativeDestroy(long nativePtr, boolean sendOnCanceled); |
| 764 | 763 |
| 765 @NativeClassQualifiedName("CronetURLRequestAdapter") | 764 @NativeClassQualifiedName("CronetURLRequestAdapter") |
| 766 private native void nativeGetStatus(long nativePtr, UrlRequest.StatusListene r listener); | 765 private native void nativeGetStatus(long nativePtr, UrlRequest.StatusListene r listener); |
| 767 } | 766 } |
| OLD | NEW |