| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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.support.annotation.Nullable; | 7 import android.support.annotation.Nullable; |
| 8 | 8 |
| 9 import org.chromium.base.VisibleForTesting; | 9 import org.chromium.base.VisibleForTesting; |
| 10 import org.chromium.net.RequestFinishedInfo; | 10 import org.chromium.net.RequestFinishedInfo; |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 mSendingStartMs = sendingStartMs; | 115 mSendingStartMs = sendingStartMs; |
| 116 mSendingEndMs = sendingEndMs; | 116 mSendingEndMs = sendingEndMs; |
| 117 mPushStartMs = pushStartMs; | 117 mPushStartMs = pushStartMs; |
| 118 mPushEndMs = pushEndMs; | 118 mPushEndMs = pushEndMs; |
| 119 mResponseStartMs = responseStartMs; | 119 mResponseStartMs = responseStartMs; |
| 120 mResponseEndMs = responseEndMs; | 120 mResponseEndMs = responseEndMs; |
| 121 mSocketReused = socketReused; | 121 mSocketReused = socketReused; |
| 122 mSentBytesCount = sentBytesCount; | 122 mSentBytesCount = sentBytesCount; |
| 123 mReceivedBytesCount = receivedBytesCount; | 123 mReceivedBytesCount = receivedBytesCount; |
| 124 | 124 |
| 125 // Don't care about these anymore | 125 // TODO(mgersh): delete these after embedders stop using them http://crb
ug.com/629194 |
| 126 mTtfbMs = null; | 126 if (requestStartMs != -1 && responseStartMs != -1) { |
| 127 mTotalTimeMs = null; | 127 mTtfbMs = responseStartMs - requestStartMs; |
| 128 } else { |
| 129 mTtfbMs = null; |
| 130 } |
| 131 if (requestStartMs != -1 && responseEndMs != -1) { |
| 132 mTotalTimeMs = responseEndMs - requestStartMs; |
| 133 } else { |
| 134 mTotalTimeMs = null; |
| 135 } |
| 128 } | 136 } |
| 129 | 137 |
| 130 @Nullable | 138 @Nullable |
| 131 public Date getRequestStart() { | 139 public Date getRequestStart() { |
| 132 return toDate(mRequestStartMs); | 140 return toDate(mRequestStartMs); |
| 133 } | 141 } |
| 134 | 142 |
| 135 @Nullable | 143 @Nullable |
| 136 public Date getDnsStart() { | 144 public Date getDnsStart() { |
| 137 return toDate(mDnsStartMs); | 145 return toDate(mDnsStartMs); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 @Nullable | 218 @Nullable |
| 211 public Long getSentBytesCount() { | 219 public Long getSentBytesCount() { |
| 212 return mSentBytesCount; | 220 return mSentBytesCount; |
| 213 } | 221 } |
| 214 | 222 |
| 215 @Nullable | 223 @Nullable |
| 216 public Long getReceivedBytesCount() { | 224 public Long getReceivedBytesCount() { |
| 217 return mReceivedBytesCount; | 225 return mReceivedBytesCount; |
| 218 } | 226 } |
| 219 } | 227 } |
| OLD | NEW |