Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(958)

Side by Side Diff: components/cronet/android/java/src/org/chromium/net/CronetBidirectionalStream.java

Issue 2069303002: Add new Cronet exception class for QUIC errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 CronetBidirectionalStream.this, mResponseInfo, trail ersBlock); 548 CronetBidirectionalStream.this, mResponseInfo, trail ersBlock);
549 } catch (Exception e) { 549 } catch (Exception e) {
550 onCallbackException(e); 550 onCallbackException(e);
551 } 551 }
552 } 552 }
553 }); 553 });
554 } 554 }
555 555
556 @SuppressWarnings("unused") 556 @SuppressWarnings("unused")
557 @CalledByNative 557 @CalledByNative
558 private void onError( 558 private void onError(int errorCode, int nativeError, int nativeErrorDetails, String errorString,
559 int errorCode, int nativeError, String errorString, long receivedByt esCount) { 559 long receivedBytesCount) {
560 if (mResponseInfo != null) { 560 if (mResponseInfo != null) {
561 mResponseInfo.setReceivedBytesCount(receivedBytesCount); 561 mResponseInfo.setReceivedBytesCount(receivedBytesCount);
562 } 562 }
563 failWithException(new CronetException( 563 failWithException(new CronetException("Exception in BidirectionalStream: " + errorString,
564 "Exception in BidirectionalStream: " + errorString, errorCode, n ativeError)); 564 errorCode, nativeError, nativeErrorDetails));
565 } 565 }
566 566
567 /** 567 /**
568 * Called when request is canceled, no callbacks will be called afterwards. 568 * Called when request is canceled, no callbacks will be called afterwards.
569 */ 569 */
570 @SuppressWarnings("unused") 570 @SuppressWarnings("unused")
571 @CalledByNative 571 @CalledByNative
572 private void onCanceled() { 572 private void onCanceled() {
573 postTaskToExecutor(new Runnable() { 573 postTaskToExecutor(new Runnable() {
574 public void run() { 574 public void run() {
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 private native boolean nativeReadData( 726 private native boolean nativeReadData(
727 long nativePtr, ByteBuffer byteBuffer, int position, int limit); 727 long nativePtr, ByteBuffer byteBuffer, int position, int limit);
728 728
729 @NativeClassQualifiedName("CronetBidirectionalStreamAdapter") 729 @NativeClassQualifiedName("CronetBidirectionalStreamAdapter")
730 private native boolean nativeWritevData(long nativePtr, ByteBuffer[] buffers , int[] positions, 730 private native boolean nativeWritevData(long nativePtr, ByteBuffer[] buffers , int[] positions,
731 int[] limits, boolean endOfStream); 731 int[] limits, boolean endOfStream);
732 732
733 @NativeClassQualifiedName("CronetBidirectionalStreamAdapter") 733 @NativeClassQualifiedName("CronetBidirectionalStreamAdapter")
734 private native void nativeDestroy(long nativePtr, boolean sendOnCanceled); 734 private native void nativeDestroy(long nativePtr, boolean sendOnCanceled);
735 } 735 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698