| 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 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 } | 705 } |
| 706 mMetrics = new CronetMetrics(requestStartMs, dnsStartMs, dnsEndMs, c
onnectStartMs, | 706 mMetrics = new CronetMetrics(requestStartMs, dnsStartMs, dnsEndMs, c
onnectStartMs, |
| 707 connectEndMs, sslStartMs, sslEndMs, sendingStartMs, sendingE
ndMs, pushStartMs, | 707 connectEndMs, sslStartMs, sslEndMs, sendingStartMs, sendingE
ndMs, pushStartMs, |
| 708 pushEndMs, responseStartMs, requestEndMs, socketReused, sent
BytesCount, | 708 pushEndMs, responseStartMs, requestEndMs, socketReused, sent
BytesCount, |
| 709 receivedBytesCount); | 709 receivedBytesCount); |
| 710 } | 710 } |
| 711 mRequestContext.reportFinished(getRequestFinishedInfo()); | 711 mRequestContext.reportFinished(getRequestFinishedInfo()); |
| 712 } | 712 } |
| 713 | 713 |
| 714 private RequestFinishedInfo getRequestFinishedInfo() { | 714 private RequestFinishedInfo getRequestFinishedInfo() { |
| 715 // TODO(mgersh): fill in real values for finishedReason and exception | |
| 716 return new RequestFinishedInfo(mInitialUrl, mRequestAnnotations, mMetric
s, mFinishedReason, | 715 return new RequestFinishedInfo(mInitialUrl, mRequestAnnotations, mMetric
s, mFinishedReason, |
| 717 mResponseInfo, mException); | 716 mResponseInfo, mException); |
| 718 } | 717 } |
| 719 | 718 |
| 720 /** Enforces prohibition of direct execution. */ | 719 /** Enforces prohibition of direct execution. */ |
| 721 void checkCallingThread() { | 720 void checkCallingThread() { |
| 722 if (!mAllowDirectExecutor && mRequestContext.isNetworkThread(Thread.curr
entThread())) { | 721 if (!mAllowDirectExecutor && mRequestContext.isNetworkThread(Thread.curr
entThread())) { |
| 723 throw new InlineExecutionProhibitedException(); | 722 throw new InlineExecutionProhibitedException(); |
| 724 } | 723 } |
| 725 } | 724 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 745 @NativeClassQualifiedName("CronetURLRequestAdapter") | 744 @NativeClassQualifiedName("CronetURLRequestAdapter") |
| 746 private native boolean nativeReadData( | 745 private native boolean nativeReadData( |
| 747 long nativePtr, ByteBuffer byteBuffer, int position, int capacity); | 746 long nativePtr, ByteBuffer byteBuffer, int position, int capacity); |
| 748 | 747 |
| 749 @NativeClassQualifiedName("CronetURLRequestAdapter") | 748 @NativeClassQualifiedName("CronetURLRequestAdapter") |
| 750 private native void nativeDestroy(long nativePtr, boolean sendOnCanceled); | 749 private native void nativeDestroy(long nativePtr, boolean sendOnCanceled); |
| 751 | 750 |
| 752 @NativeClassQualifiedName("CronetURLRequestAdapter") | 751 @NativeClassQualifiedName("CronetURLRequestAdapter") |
| 753 private native void nativeGetStatus(long nativePtr, UrlRequest.StatusListene
r listener); | 752 private native void nativeGetStatus(long nativePtr, UrlRequest.StatusListene
r listener); |
| 754 } | 753 } |
| OLD | NEW |