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

Unified 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 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/api/src/org/chromium/net/RequestFinishedInfo.java
diff --git a/components/cronet/android/api/src/org/chromium/net/RequestFinishedInfo.java b/components/cronet/android/api/src/org/chromium/net/RequestFinishedInfo.java
index fcc6032d07de95cd17be998539313c4f6768315e..570738feeaedfdd8ce6b2baf547f6692427838d7 100644
--- a/components/cronet/android/api/src/org/chromium/net/RequestFinishedInfo.java
+++ b/components/cronet/android/api/src/org/chromium/net/RequestFinishedInfo.java
@@ -13,6 +13,12 @@ import java.util.concurrent.Executor;
/**
* Information about a finished request. Passed to {@link RequestFinishedInfo.Listener}.
*
+ * To associate the data with the original request, use
+ * {@link ExperimentalUrlRequest.Builder#addRequestAnnotation} or
+ * {@link ExperimentalBidirectionalStream.Builder#addRequestAnnotation} to add a unique identifier
+ * when creating the request, and call {@link #getAnnotations} when the {@link RequestFinishedInfo}
+ * is received to retrieve the identifier.
+ *
* {@hide} as it's a prototype.
*/
public abstract class RequestFinishedInfo {
@@ -257,11 +263,22 @@ public abstract class RequestFinishedInfo {
*/
public static final int CANCELED = 2;
-
- /** Returns the request's original URL. */
+ /**
+ * Returns the request's original URL.
+ *
+ * @return the request's original URL
+ */
public abstract String getUrl();
- /** Returns the objects that the caller has supplied when initiating the request. */
+ /**
+ * Returns the objects that the caller has supplied when initiating the request, using
+ * {@link ExperimentalUrlRequest.Builder#addRequestAnnotation} or
+ * {@link ExperimentalBidirectionalStream.Builder#addRequestAnnotation}.
+ * Annotations can be used to associate a {@link RequestFinishedInfo} with the original request
+ * or type of request.
+ *
+ * @return annotations supplied when creating the request
+ */
public abstract Collection<Object> getAnnotations();
// TODO(klm): Collect and return a chain of Metrics objects for redirect responses.
« 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