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

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

Issue 1393713005: [Cronet] Add error code and immediatelyRetryable() to UrlRequestException (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix missing test annotation Created 4 years, 10 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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698