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 |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e6679d97ec2f80d0db38f0931e7324041cf9147e |
--- /dev/null |
+++ b/components/cronet/android/java/src/org/chromium/net/ResponseInfo.java |
@@ -0,0 +1,58 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+package org.chromium.net; |
+ |
+import java.net.URL; |
+import java.util.List; |
+import java.util.Map; |
+ |
+/** |
+ * Contains basic information about a response. Sent to the embedder whenever |
+ * headers are received. |
+ */ |
+public abstract interface ResponseInfo { |
Charles
2014/09/05 18:10:57
Abstract is redundant
|
+ /** |
+ * Return the url the response is for (Not the original URL - after |
+ * redirects, it's the new URL). |
+ */ |
+ URL getUrl(); |
+ |
+ /** |
+ * |
+ * @return the url chain, including all redirects. The originally |
+ * requested URL is first. |
+ */ |
+ URL[] getUrlChain(); |
+ |
+ /** |
+ * Returns the HTTP status code. |
+ */ |
+ int getHttpStatusCode(); |
+ |
+ /** |
+ * Returns 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 |
+ * revalidated over the network before being retrieved from the cache are |
+ * considered cached. |
+ */ |
+ boolean wasCached(); |
+ |
+ /** |
+ * |
+ * @return |
+ */ |
+ boolean wasFetchedOverSPDY(); |
Charles
2014/09/05 18:10:57
I'd rather have a method that returns an enum of s
mmenke
2014/09/05 19:14:39
We've been discussing this over at https://coderev
|
+ |
+ /** |
+ * |
+ * @return |
+ */ |
+ boolean wasFetchedOverQUIC(); |
+}; |