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

Unified Diff: components/cronet/android/java/src/org/chromium/net/impl/CronetMetrics.java

Issue 2350843005: Set TTFB and total request time from new CronetMetrics constructor (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/cronet/android/java/src/org/chromium/net/impl/CronetMetrics.java
diff --git a/components/cronet/android/java/src/org/chromium/net/impl/CronetMetrics.java b/components/cronet/android/java/src/org/chromium/net/impl/CronetMetrics.java
index ea96bddb2037526fdc9f57ddf9d645a34ccb9db5..d4339e0da9c6c9c28b574825212f14e74a9e7a73 100644
--- a/components/cronet/android/java/src/org/chromium/net/impl/CronetMetrics.java
+++ b/components/cronet/android/java/src/org/chromium/net/impl/CronetMetrics.java
@@ -122,9 +122,17 @@ public final class CronetMetrics extends RequestFinishedInfo.Metrics {
mSentBytesCount = sentBytesCount;
mReceivedBytesCount = receivedBytesCount;
- // Don't care about these anymore
- mTtfbMs = null;
- mTotalTimeMs = null;
+ // TODO(mgersh): delete these after embedders stop using them http://crbug.com/629194
+ if (requestStartMs != -1 && responseStartMs != -1) {
+ mTtfbMs = responseStartMs - requestStartMs;
+ } else {
+ mTtfbMs = null;
+ }
+ if (requestStartMs != -1 && responseEndMs != -1) {
+ mTotalTimeMs = responseEndMs - requestStartMs;
+ } else {
+ mTotalTimeMs = null;
+ }
}
@Nullable
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698