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

Side by Side Diff: components/cronet/android/api/src/org/chromium/net/RequestFinishedInfo.java

Issue 2560603002: Explain how to associate RequestFinishedInfo with original request (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.Nullable; 7 import android.support.annotation.Nullable;
8 8
9 import java.util.Collection; 9 import java.util.Collection;
10 import java.util.Date; 10 import java.util.Date;
11 import java.util.concurrent.Executor; 11 import java.util.concurrent.Executor;
12 12
13 /** 13 /**
14 * Information about a finished request. Passed to {@link RequestFinishedInfo.Li stener}. 14 * Information about a finished request. Passed to {@link RequestFinishedInfo.Li stener}.
15 * 15 *
16 * To associate the data with the original request, use
17 * {@link ExperimentalUrlRequest.Builder#addRequestAnnotation} or
18 * {@link ExperimentalBidirectionalStream.Builder#addRequestAnnotation} to add a unique identifier
19 * when creating the request, and call {@link #getAnnotations} when the {@link R equestFinishedInfo}
20 * is received to retrieve the identifier.
21 *
16 * {@hide} as it's a prototype. 22 * {@hide} as it's a prototype.
17 */ 23 */
18 public abstract class RequestFinishedInfo { 24 public abstract class RequestFinishedInfo {
19 /** 25 /**
20 * Listens for finished requests for the purpose of collecting metrics. 26 * Listens for finished requests for the purpose of collecting metrics.
21 * 27 *
22 * {@hide} as it's a prototype. 28 * {@hide} as it's a prototype.
23 */ 29 */
24 public abstract static class Listener { 30 public abstract static class Listener {
25 private final Executor mExecutor; 31 private final Executor mExecutor;
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 * Reason value indicating that the request failed or returned an error. Ret urned from 256 * Reason value indicating that the request failed or returned an error. Ret urned from
251 * {@link #getFinishedReason}. 257 * {@link #getFinishedReason}.
252 */ 258 */
253 public static final int FAILED = 1; 259 public static final int FAILED = 1;
254 /** 260 /**
255 * Reason value indicating that the request was canceled. Returned from 261 * Reason value indicating that the request was canceled. Returned from
256 * {@link #getFinishedReason}. 262 * {@link #getFinishedReason}.
257 */ 263 */
258 public static final int CANCELED = 2; 264 public static final int CANCELED = 2;
259 265
260 266 /**
261 /** Returns the request's original URL. */ 267 * Returns the request's original URL.
268 *
269 * @return the request's original URL
270 */
262 public abstract String getUrl(); 271 public abstract String getUrl();
263 272
264 /** Returns the objects that the caller has supplied when initiating the req uest. */ 273 /**
274 * Returns the objects that the caller has supplied when initiating the requ est, using
275 * {@link ExperimentalUrlRequest.Builder#addRequestAnnotation} or
276 * {@link ExperimentalBidirectionalStream.Builder#addRequestAnnotation}.
277 * Annotations can be used to associate a {@link RequestFinishedInfo} with t he original request
278 * or type of request.
279 *
280 * @return annotations supplied when creating the request
281 */
265 public abstract Collection<Object> getAnnotations(); 282 public abstract Collection<Object> getAnnotations();
266 283
267 // TODO(klm): Collect and return a chain of Metrics objects for redirect res ponses. 284 // TODO(klm): Collect and return a chain of Metrics objects for redirect res ponses.
268 // TODO(mgersh): Update this javadoc when new metrics are fully implemented 285 // TODO(mgersh): Update this javadoc when new metrics are fully implemented
269 /** 286 /**
270 * Returns metrics collected for this request. 287 * Returns metrics collected for this request.
271 * 288 *
272 * <p>The reported times and bytes account for all redirects, i.e. 289 * <p>The reported times and bytes account for all redirects, i.e.
273 * the TTFB is from the start of the original request to the ultimate respon se headers, 290 * the TTFB is from the start of the original request to the ultimate respon se headers,
274 * the TTLB is from the start of the original request to the end of the ulti mate response, 291 * the TTLB is from the start of the original request to the end of the ulti mate response,
(...skipping 20 matching lines...) Expand all
295 312
296 /** 313 /**
297 * If the request failed, returns the same {@link CronetException} provided to 314 * If the request failed, returns the same {@link CronetException} provided to
298 * {@link UrlRequest.Callback#onFailed}. 315 * {@link UrlRequest.Callback#onFailed}.
299 * 316 *
300 * @return the request's {@link CronetException}, if the request failed 317 * @return the request's {@link CronetException}, if the request failed
301 */ 318 */
302 @Nullable 319 @Nullable
303 public abstract CronetException getException(); 320 public abstract CronetException getException();
304 } 321 }
OLDNEW
« 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