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.os.SystemClock; | 7 import android.os.SystemClock; |
8 import android.support.annotation.Nullable; | 8 import android.support.annotation.Nullable; |
9 import android.util.Log; | 9 import android.util.Log; |
10 | 10 |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 Runnable task = new Runnable() { | 689 Runnable task = new Runnable() { |
690 @Override | 690 @Override |
691 public void run() { | 691 public void run() { |
692 listener.onStatus(UrlRequest.Status.convertLoadState(loadState))
; | 692 listener.onStatus(UrlRequest.Status.convertLoadState(loadState))
; |
693 } | 693 } |
694 }; | 694 }; |
695 postTaskToExecutor(task); | 695 postTaskToExecutor(task); |
696 } | 696 } |
697 | 697 |
698 RequestFinishedInfo getRequestFinishedInfo() { | 698 RequestFinishedInfo getRequestFinishedInfo() { |
| 699 // TODO(mgersh): fill in real values for finishedReason and exception |
699 return new RequestFinishedInfo(mInitialUrl, mRequestAnnotations, | 700 return new RequestFinishedInfo(mInitialUrl, mRequestAnnotations, |
700 (mRequestMetricsAccumulator != null ? mRequestMetricsAccumulator
.getRequestMetrics() | 701 (mRequestMetricsAccumulator != null ? mRequestMetricsAccumulator
.getRequestMetrics() |
701 : EMPTY_METRICS), | 702 : EMPTY_METRICS), |
702 mResponseInfo); | 703 RequestFinishedInfo.SUCCEEDED, mResponseInfo, null); |
703 } | 704 } |
704 | 705 |
705 private final class UrlRequestMetricsAccumulator { | 706 private final class UrlRequestMetricsAccumulator { |
706 @Nullable | 707 @Nullable |
707 private Long mRequestStartTime; | 708 private Long mRequestStartTime; |
708 @Nullable | 709 @Nullable |
709 private Long mTtfbMs; | 710 private Long mTtfbMs; |
710 @Nullable | 711 @Nullable |
711 private Long mTotalTimeMs; | 712 private Long mTotalTimeMs; |
712 | 713 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 @NativeClassQualifiedName("CronetURLRequestAdapter") | 757 @NativeClassQualifiedName("CronetURLRequestAdapter") |
757 private native boolean nativeReadData( | 758 private native boolean nativeReadData( |
758 long nativePtr, ByteBuffer byteBuffer, int position, int capacity); | 759 long nativePtr, ByteBuffer byteBuffer, int position, int capacity); |
759 | 760 |
760 @NativeClassQualifiedName("CronetURLRequestAdapter") | 761 @NativeClassQualifiedName("CronetURLRequestAdapter") |
761 private native void nativeDestroy(long nativePtr, boolean sendOnCanceled); | 762 private native void nativeDestroy(long nativePtr, boolean sendOnCanceled); |
762 | 763 |
763 @NativeClassQualifiedName("CronetURLRequestAdapter") | 764 @NativeClassQualifiedName("CronetURLRequestAdapter") |
764 private native void nativeGetStatus(long nativePtr, UrlRequest.StatusListene
r listener); | 765 private native void nativeGetStatus(long nativePtr, UrlRequest.StatusListene
r listener); |
765 } | 766 } |
OLD | NEW |