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

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

Issue 520093002: Initial declaration of Cronet Async API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments, add to cronet.gyp Created 6 years, 3 months 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
new file mode 100644
index 0000000000000000000000000000000000000000..388d7bba07314e3f9b6313cf4a59ad7e2fea786d
--- /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;
+
+/**
+ * I'm sure I've left out a lot of things we may want here,
+ * this list is not intended to be complete, though comments are welcome.
mmenke 2014/09/03 21:19:20 Should clean up these comments. Maybe something l
mef 2014/09/03 21:55:39 Done.
+ */
+public abstract interface ResponseInfo {
+ /**
+ * 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.
+ */
mmenke 2014/09/03 21:19:20 nit: Fix indent.
mef 2014/09/03 21:55:39 Done.
+ boolean wasCached();
+
+ /**
+ *
+ * @return
+ */
+ boolean wasFetchedOverSPDY();
+
+ /**
+ *
+ * @return
+ */
+ boolean wasFetchedOverQUIC();
+};

Powered by Google App Engine
This is Rietveld 408576698