| 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; | 5 package org.chromium.net; |
| 6 | 6 |
| 7 import android.support.annotation.IntDef; | 7 import android.support.annotation.IntDef; |
| 8 import android.support.annotation.Nullable; | 8 import android.support.annotation.Nullable; |
| 9 | 9 |
| 10 import java.lang.annotation.Retention; | 10 import java.lang.annotation.Retention; |
| 11 import java.lang.annotation.RetentionPolicy; | 11 import java.lang.annotation.RetentionPolicy; |
| 12 import java.util.Collection; | 12 import java.util.Collection; |
| 13 import java.util.Collections; |
| 13 import java.util.Date; | 14 import java.util.Date; |
| 14 import java.util.concurrent.Executor; | 15 import java.util.concurrent.Executor; |
| 15 | 16 |
| 16 /** | 17 /** |
| 17 * Information about a finished request. Passed to {@link RequestFinishedInfo.Li
stener}. | 18 * Information about a finished request. Passed to {@link RequestFinishedInfo.Li
stener}. |
| 18 * | 19 * |
| 19 * {@hide} as it's a prototype. | 20 * {@hide} as it's a prototype. |
| 20 */ | 21 */ |
| 21 public final class RequestFinishedInfo { | 22 public final class RequestFinishedInfo { |
| 22 /** | 23 /** |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 mException = exception; | 292 mException = exception; |
| 292 } | 293 } |
| 293 | 294 |
| 294 /** Returns the request's original URL. */ | 295 /** Returns the request's original URL. */ |
| 295 public String getUrl() { | 296 public String getUrl() { |
| 296 return mUrl; | 297 return mUrl; |
| 297 } | 298 } |
| 298 | 299 |
| 299 /** Returns the objects that the caller has supplied when initiating the req
uest. */ | 300 /** Returns the objects that the caller has supplied when initiating the req
uest. */ |
| 300 public Collection<Object> getAnnotations() { | 301 public Collection<Object> getAnnotations() { |
| 302 if (mAnnotations == null) { |
| 303 return Collections.emptyList(); |
| 304 } |
| 301 return mAnnotations; | 305 return mAnnotations; |
| 302 } | 306 } |
| 303 | 307 |
| 304 // TODO(klm): Collect and return a chain of Metrics objects for redirect res
ponses. | 308 // TODO(klm): Collect and return a chain of Metrics objects for redirect res
ponses. |
| 305 // TODO(mgersh): Update this javadoc when new metrics are fully implemented | 309 // TODO(mgersh): Update this javadoc when new metrics are fully implemented |
| 306 /** | 310 /** |
| 307 * Returns metrics collected for this request. | 311 * Returns metrics collected for this request. |
| 308 * | 312 * |
| 309 * <p>The reported times and bytes account for all redirects, i.e. | 313 * <p>The reported times and bytes account for all redirects, i.e. |
| 310 * the TTFB is from the start of the original request to the ultimate respon
se headers, | 314 * the TTFB is from the start of the original request to the ultimate respon
se headers, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 341 * If the request failed, returns the same {@link UrlRequestException} provi
ded to | 345 * If the request failed, returns the same {@link UrlRequestException} provi
ded to |
| 342 * {@link UrlRequest.Callback#onFailed}. | 346 * {@link UrlRequest.Callback#onFailed}. |
| 343 * | 347 * |
| 344 * @return the request's {@link UrlRequestException}, if the request failed | 348 * @return the request's {@link UrlRequestException}, if the request failed |
| 345 */ | 349 */ |
| 346 @Nullable | 350 @Nullable |
| 347 public UrlRequestException getException() { | 351 public UrlRequestException getException() { |
| 348 return mException; | 352 return mException; |
| 349 } | 353 } |
| 350 } | 354 } |
| OLD | NEW |