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

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

Issue 2220023002: Add API for new Cronet metrics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698