Chromium Code Reviews| 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(); |
| +}; |