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.util.Log; | 7 import android.util.Log; |
8 | 8 |
9 import org.chromium.base.VisibleForTesting; | 9 import org.chromium.base.VisibleForTesting; |
10 import org.chromium.base.annotations.CalledByNative; | 10 import org.chromium.base.annotations.CalledByNative; |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 mOnDestroyedCallbackForTesting = onDestroyedCallbackForTesting; | 341 mOnDestroyedCallbackForTesting = onDestroyedCallbackForTesting; |
342 } | 342 } |
343 | 343 |
344 @VisibleForTesting | 344 @VisibleForTesting |
345 public void setOnDestroyedUploadCallbackForTesting( | 345 public void setOnDestroyedUploadCallbackForTesting( |
346 Runnable onDestroyedUploadCallbackForTesting) { | 346 Runnable onDestroyedUploadCallbackForTesting) { |
347 mUploadDataStream.setOnDestroyedCallbackForTesting(onDestroyedUploadCall
backForTesting); | 347 mUploadDataStream.setOnDestroyedCallbackForTesting(onDestroyedUploadCall
backForTesting); |
348 } | 348 } |
349 | 349 |
350 @VisibleForTesting | 350 @VisibleForTesting |
351 public long getUrlRequestAdapterForTesting() { | 351 public long getUrlRequestForTesting() { |
352 synchronized (mUrlRequestAdapterLock) { | 352 synchronized (mUrlRequestAdapterLock) { |
353 return mUrlRequestAdapter; | 353 return nativeGetUrlRequestForTesting(mUrlRequestAdapter); |
354 } | 354 } |
355 } | 355 } |
356 | 356 |
357 /** | 357 /** |
358 * Posts task to application Executor. Used for Listener callbacks | 358 * Posts task to application Executor. Used for Listener callbacks |
359 * and other tasks that should not be executed on network thread. | 359 * and other tasks that should not be executed on network thread. |
360 */ | 360 */ |
361 private void postTaskToExecutor(Runnable task) { | 361 private void postTaskToExecutor(Runnable task) { |
362 try { | 362 try { |
363 mExecutor.execute(task); | 363 mExecutor.execute(task); |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 | 744 |
745 @NativeClassQualifiedName("CronetURLRequestAdapter") | 745 @NativeClassQualifiedName("CronetURLRequestAdapter") |
746 private native boolean nativeReadData( | 746 private native boolean nativeReadData( |
747 long nativePtr, ByteBuffer byteBuffer, int position, int capacity); | 747 long nativePtr, ByteBuffer byteBuffer, int position, int capacity); |
748 | 748 |
749 @NativeClassQualifiedName("CronetURLRequestAdapter") | 749 @NativeClassQualifiedName("CronetURLRequestAdapter") |
750 private native void nativeDestroy(long nativePtr, boolean sendOnCanceled); | 750 private native void nativeDestroy(long nativePtr, boolean sendOnCanceled); |
751 | 751 |
752 @NativeClassQualifiedName("CronetURLRequestAdapter") | 752 @NativeClassQualifiedName("CronetURLRequestAdapter") |
753 private native void nativeGetStatus(long nativePtr, UrlRequest.StatusListene
r listener); | 753 private native void nativeGetStatus(long nativePtr, UrlRequest.StatusListene
r listener); |
| 754 |
| 755 @NativeClassQualifiedName("CronetURLRequestAdapter") |
| 756 private native long nativeGetUrlRequestForTesting(long nativePtr); |
754 } | 757 } |
OLD | NEW |