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

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

Issue 586143002: Initial implementation of Cronet Async API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync Created 6 years, 1 month 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
Index: components/cronet/android/java/src/org/chromium/net/ResponseInfo.java
diff --git a/components/cronet/android/java/src/org/chromium/net/ResponseInfo.java b/components/cronet/android/java/src/org/chromium/net/ResponseInfo.java
index e6679d97ec2f80d0db38f0931e7324041cf9147e..3d5e53e3e1d667b4b657a2ce08328cb4af99464f 100644
--- a/components/cronet/android/java/src/org/chromium/net/ResponseInfo.java
+++ b/components/cronet/android/java/src/org/chromium/net/ResponseInfo.java
@@ -4,7 +4,6 @@
package org.chromium.net;
-import java.net.URL;
import java.util.List;
import java.util.Map;
@@ -12,47 +11,47 @@ import java.util.Map;
* Contains basic information about a response. Sent to the embedder whenever
* headers are received.
*/
-public abstract interface ResponseInfo {
+public interface ResponseInfo {
/**
- * Return the url the response is for (Not the original URL - after
- * redirects, it's the new URL).
+ * @return the URL the response is for (Not the original URL - after
+ * redirects, it's the new URL). Includes scheme, path, and query.
*/
- URL getUrl();
+ String getUrl();
/**
*
- * @return the url chain, including all redirects. The originally
+ * @return the url chain, including all redirects. The originally
* requested URL is first.
*/
- URL[] getUrlChain();
+ String[] getUrlChain();
/**
- * Returns the HTTP status code.
+ * @return the HTTP status code.
*/
int getHttpStatusCode();
/**
- * Returns an unmodifiable map of the response-header fields and values.
+ * @return an unmodifiable map of the response-header fields and values.
* The null key is mapped to the HTTP status line for compatibility with
* HttpUrlConnection.
*/
Map<String, List<String>> getAllHeaders();
- /** True if the response came from the cache. Requests that were
+ /**
+ * @return True if the response came from the cache. Requests that were
* revalidated over the network before being retrieved from the cache are
- * considered cached.
+ * considered cached. When a resource is retrieved from the cache
+ * (Whether it was revalidated or not), getHttpStatusCode returns the
+ * original status code.
*/
boolean wasCached();
/**
- *
- * @return
- */
- boolean wasFetchedOverSPDY();
-
- /**
- *
- * @return
+ * @return protocol (e.g. "quic/1+spdy/3") negotiated with server. Returns
+ * empty string if no protocol was negotiated, or the protocol is not known.
+ * Returns empty when using plain http or https.
+ * TODO(mef): Figure out what this returns in the cached case, both with
+ * and without a revalidation request.
*/
- boolean wasFetchedOverQUIC();
+ String getNegotiatedProtocol();
};

Powered by Google App Engine
This is Rietveld 408576698