| 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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 synchronized (mNativeStreamLock) { | 396 synchronized (mNativeStreamLock) { |
| 397 List<ByteBuffer> flushData = new LinkedList<ByteBuffer>(); | 397 List<ByteBuffer> flushData = new LinkedList<ByteBuffer>(); |
| 398 for (ByteBuffer buffer : mFlushData) { | 398 for (ByteBuffer buffer : mFlushData) { |
| 399 flushData.add(buffer.asReadOnlyBuffer()); | 399 flushData.add(buffer.asReadOnlyBuffer()); |
| 400 } | 400 } |
| 401 return flushData; | 401 return flushData; |
| 402 } | 402 } |
| 403 } | 403 } |
| 404 | 404 |
| 405 @Override | 405 @Override |
| 406 public void ping(PingCallback callback, Executor executor) { | |
| 407 // TODO(mef): May be last thing to be implemented on Android. | |
| 408 throw new UnsupportedOperationException("ping is not supported yet."); | |
| 409 } | |
| 410 | |
| 411 @Override | |
| 412 public void windowUpdate(int windowSizeIncrement) { | |
| 413 // TODO(mef): Understand the needs and semantics of this method. | |
| 414 throw new UnsupportedOperationException("windowUpdate is not supported y
et."); | |
| 415 } | |
| 416 | |
| 417 @Override | |
| 418 public void cancel() { | 406 public void cancel() { |
| 419 synchronized (mNativeStreamLock) { | 407 synchronized (mNativeStreamLock) { |
| 420 if (isDoneLocked() || mReadState == State.NOT_STARTED) { | 408 if (isDoneLocked() || mReadState == State.NOT_STARTED) { |
| 421 return; | 409 return; |
| 422 } | 410 } |
| 423 mReadState = mWriteState = State.CANCELED; | 411 mReadState = mWriteState = State.CANCELED; |
| 424 destroyNativeStreamLocked(true); | 412 destroyNativeStreamLocked(true); |
| 425 } | 413 } |
| 426 } | 414 } |
| 427 | 415 |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 private native boolean nativeReadData( | 753 private native boolean nativeReadData( |
| 766 long nativePtr, ByteBuffer byteBuffer, int position, int limit); | 754 long nativePtr, ByteBuffer byteBuffer, int position, int limit); |
| 767 | 755 |
| 768 @NativeClassQualifiedName("CronetBidirectionalStreamAdapter") | 756 @NativeClassQualifiedName("CronetBidirectionalStreamAdapter") |
| 769 private native boolean nativeWritevData(long nativePtr, ByteBuffer[] buffers
, int[] positions, | 757 private native boolean nativeWritevData(long nativePtr, ByteBuffer[] buffers
, int[] positions, |
| 770 int[] limits, boolean endOfStream); | 758 int[] limits, boolean endOfStream); |
| 771 | 759 |
| 772 @NativeClassQualifiedName("CronetBidirectionalStreamAdapter") | 760 @NativeClassQualifiedName("CronetBidirectionalStreamAdapter") |
| 773 private native void nativeDestroy(long nativePtr, boolean sendOnCanceled); | 761 private native void nativeDestroy(long nativePtr, boolean sendOnCanceled); |
| 774 } | 762 } |
| OLD | NEW |