| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 org.chromium.base.Log; | 7 import org.chromium.base.Log; |
| 8 import org.chromium.base.VisibleForTesting; | 8 import org.chromium.base.VisibleForTesting; |
| 9 import org.chromium.base.annotations.CalledByNative; | 9 import org.chromium.base.annotations.CalledByNative; |
| 10 import org.chromium.base.annotations.JNINamespace; | 10 import org.chromium.base.annotations.JNINamespace; |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 CronetBidirectionalStream.this, mResponseInfo, trail
ersBlock); | 421 CronetBidirectionalStream.this, mResponseInfo, trail
ersBlock); |
| 422 } catch (Exception e) { | 422 } catch (Exception e) { |
| 423 onCallbackException(e); | 423 onCallbackException(e); |
| 424 } | 424 } |
| 425 } | 425 } |
| 426 }); | 426 }); |
| 427 } | 427 } |
| 428 | 428 |
| 429 @SuppressWarnings("unused") | 429 @SuppressWarnings("unused") |
| 430 @CalledByNative | 430 @CalledByNative |
| 431 private void onError(final int nativeError, final String errorString, long r
eceivedBytesCount) { | 431 private void onError( |
| 432 int errorCode, int nativeError, String errorString, long receivedByt
esCount) { |
| 432 if (mResponseInfo != null) { | 433 if (mResponseInfo != null) { |
| 433 mResponseInfo.setReceivedBytesCount(receivedBytesCount); | 434 mResponseInfo.setReceivedBytesCount(receivedBytesCount); |
| 434 } | 435 } |
| 435 failWithException(new CronetException( | 436 failWithException(new CronetException( |
| 436 "Exception in BidirectionalStream: " + errorString, nativeError)
); | 437 "Exception in BidirectionalStream: " + errorString, errorCode, n
ativeError)); |
| 437 } | 438 } |
| 438 | 439 |
| 439 /** | 440 /** |
| 440 * Called when request is canceled, no callbacks will be called afterwards. | 441 * Called when request is canceled, no callbacks will be called afterwards. |
| 441 */ | 442 */ |
| 442 @SuppressWarnings("unused") | 443 @SuppressWarnings("unused") |
| 443 @CalledByNative | 444 @CalledByNative |
| 444 private void onCanceled() { | 445 private void onCanceled() { |
| 445 postTaskToExecutor(new Runnable() { | 446 postTaskToExecutor(new Runnable() { |
| 446 public void run() { | 447 public void run() { |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 private native boolean nativeReadData( | 636 private native boolean nativeReadData( |
| 636 long nativePtr, ByteBuffer byteBuffer, int position, int limit); | 637 long nativePtr, ByteBuffer byteBuffer, int position, int limit); |
| 637 | 638 |
| 638 @NativeClassQualifiedName("CronetBidirectionalStreamAdapter") | 639 @NativeClassQualifiedName("CronetBidirectionalStreamAdapter") |
| 639 private native boolean nativeWriteData( | 640 private native boolean nativeWriteData( |
| 640 long nativePtr, ByteBuffer byteBuffer, int position, int limit, bool
ean endOfStream); | 641 long nativePtr, ByteBuffer byteBuffer, int position, int limit, bool
ean endOfStream); |
| 641 | 642 |
| 642 @NativeClassQualifiedName("CronetBidirectionalStreamAdapter") | 643 @NativeClassQualifiedName("CronetBidirectionalStreamAdapter") |
| 643 private native void nativeDestroy(long nativePtr, boolean sendOnCanceled); | 644 private native void nativeDestroy(long nativePtr, boolean sendOnCanceled); |
| 644 } | 645 } |
| OLD | NEW |