OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.net; | 5 package org.chromium.net; |
6 | 6 |
7 import android.util.Pair; | |
8 | |
9 import java.util.List; | 7 import java.util.List; |
10 import java.util.Map; | 8 import java.util.Map; |
11 | 9 |
12 /** | 10 /** |
13 * Contains basic information about a response. Sent to the embedder whenever | 11 * Contains basic information about a response. Sent to the embedder whenever |
14 * headers are received. | 12 * headers are received. |
| 13 * @deprecated Use {@link UrlResponseInfo} instead of this and {@link ExtendedRe
sponseInfo}. |
15 */ | 14 */ |
| 15 @Deprecated |
16 public interface ResponseInfo { | 16 public interface ResponseInfo { |
17 /** | 17 /** |
18 * Returns the URL the response is for. This is the URL after following | 18 * Returns the URL the response is for. This is the URL after following |
19 * redirects, so it may not be the originally requested URL. | 19 * redirects, so it may not be the originally requested URL. |
20 * @return the URL the response is for. | 20 * @return the URL the response is for. |
21 */ | 21 */ |
22 String getUrl(); | 22 String getUrl(); |
23 | 23 |
24 /** | 24 /** |
25 * Returns the URL chain. The first entry is the origianlly requested URL; | 25 * Returns the URL chain. The first entry is the origianlly requested URL; |
26 * the following entries are redirects followed. | 26 * the following entries are redirects followed. |
27 * @return the URL chain. | 27 * @return the URL chain. |
28 */ | 28 */ |
29 String[] getUrlChain(); | 29 List<String> getUrlChain(); |
30 | 30 |
31 /** | 31 /** |
32 * Returns the HTTP status code. When a resource is retrieved from the cache
, | 32 * Returns the HTTP status code. When a resource is retrieved from the cache
, |
33 * whether it was revalidated or not, the original status code is returned. | 33 * whether it was revalidated or not, the original status code is returned. |
34 * @return the HTTP status code. | 34 * @return the HTTP status code. |
35 */ | 35 */ |
36 int getHttpStatusCode(); | 36 int getHttpStatusCode(); |
37 | 37 |
38 /** | 38 /** |
39 * Returns the HTTP status text of the status line. For example, if the | 39 * Returns the HTTP status text of the status line. For example, if the |
40 * request has a "HTTP/1.1 200 OK" response, this method returns "OK". | 40 * request has a "HTTP/1.1 200 OK" response, this method returns "OK". |
41 * @return the HTTP status text of the status line. | 41 * @return the HTTP status text of the status line. |
42 */ | 42 */ |
43 String getHttpStatusText(); | 43 String getHttpStatusText(); |
44 | 44 |
45 /** | 45 /** |
46 * Returns an unmodifiable list of response header field and value pairs. | 46 * Returns an unmodifiable list of response header field and value pairs. |
47 * The headers are in the same order they are received over the wire. | 47 * The headers are in the same order they are received over the wire. |
48 * @return an unmodifiable list of response header field and value pairs. | 48 * @return an unmodifiable list of response header field and value pairs. |
49 */ | 49 */ |
50 List<Pair<String, String>> getAllHeadersAsList(); | 50 List<Map.Entry<String, String>> getAllHeadersAsList(); |
51 | 51 |
52 /** | 52 /** |
53 * Returns an unmodifiable map of the response-header fields and values. | 53 * Returns an unmodifiable map of the response-header fields and values. |
54 * Each list of values for a single header field is in the same order they | 54 * Each list of values for a single header field is in the same order they |
55 * were received over the wire. | 55 * were received over the wire. |
56 * @return an unmodifiable map of the response-header fields and values. | 56 * @return an unmodifiable map of the response-header fields and values. |
57 */ | 57 */ |
58 Map<String, List<String>> getAllHeaders(); | 58 Map<String, List<String>> getAllHeaders(); |
59 | 59 |
60 /** | 60 /** |
(...skipping 14 matching lines...) Expand all Loading... |
75 // TODO(mef): Figure out what this returns in the cached case, both with | 75 // TODO(mef): Figure out what this returns in the cached case, both with |
76 // and without a revalidation request. | 76 // and without a revalidation request. |
77 String getNegotiatedProtocol(); | 77 String getNegotiatedProtocol(); |
78 | 78 |
79 /** | 79 /** |
80 * Returns the proxy server that was used for the request. | 80 * Returns the proxy server that was used for the request. |
81 * @return the proxy server that was used for the request. | 81 * @return the proxy server that was used for the request. |
82 */ | 82 */ |
83 String getProxyServer(); | 83 String getProxyServer(); |
84 }; | 84 }; |
OLD | NEW |