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 java.net.URL; | |
8 import java.util.List; | 7 import java.util.List; |
9 import java.util.Map; | 8 import java.util.Map; |
10 | 9 |
11 /** | 10 /** |
12 * Contains basic information about a response. Sent to the embedder whenever | 11 * Contains basic information about a response. Sent to the embedder whenever |
13 * headers are received. | 12 * headers are received. |
14 */ | 13 */ |
15 public abstract interface ResponseInfo { | 14 public interface ResponseInfo { |
16 /** | 15 /** |
17 * Return the url the response is for (Not the original URL - after | 16 * Return the url the response is for (Not the original URL - after |
18 * redirects, it's the new URL). | 17 * redirects, it's the new URL). |
19 */ | 18 */ |
20 URL getUrl(); | 19 String getUrl(); |
21 | 20 |
22 /** | 21 /** |
23 * | 22 * |
24 * @return the url chain, including all redirects. The originally | 23 * @return the url chain, including all redirects. The originally |
25 * requested URL is first. | 24 * requested URL is first. |
26 */ | 25 */ |
27 URL[] getUrlChain(); | 26 String[] getUrlChain(); |
28 | 27 |
29 /** | 28 /** |
30 * Returns the HTTP status code. | 29 * Returns the HTTP status code. |
31 */ | 30 */ |
32 int getHttpStatusCode(); | 31 int getHttpStatusCode(); |
33 | 32 |
34 /** | 33 /** |
35 * Returns an unmodifiable map of the response-header fields and values. | 34 * Returns an unmodifiable map of the response-header fields and values. |
36 * The null key is mapped to the HTTP status line for compatibility with | 35 * The null key is mapped to the HTTP status line for compatibility with |
37 * HttpUrlConnection. | 36 * HttpUrlConnection. |
38 */ | 37 */ |
39 Map<String, List<String>> getAllHeaders(); | 38 Map<String, List<String>> getAllHeaders(); |
40 | 39 |
41 /** True if the response came from the cache. Requests that were | 40 /** True if the response came from the cache. Requests that were |
42 * revalidated over the network before being retrieved from the cache are | 41 * revalidated over the network before being retrieved from the cache are |
43 * considered cached. | 42 * considered cached. |
44 */ | 43 */ |
45 boolean wasCached(); | 44 boolean wasCached(); |
46 | 45 |
47 /** | 46 /** |
48 * | 47 * Returns protocol (e.g. "quic/1+spdy/3") negotiated with server. Returns |
49 * @return | 48 * empty string if no protocol was negotiated, or the protocol is not known. |
49 * Returns empty when using plain http or https. | |
50 */ | 50 */ |
51 boolean wasFetchedOverSPDY(); | 51 String getNegotiatedProtocol(); |
52 | 52 |
53 /** | 53 /** |
54 * | 54 * Returns the total amount of data received from network after SSL |
55 * @return | 55 * decoding and proxy handling if available. |
56 */ | 56 */ |
57 boolean wasFetchedOverQUIC(); | 57 long getTotalReceivedBytes(); |
Charles
2014/09/26 22:52:26
Does this include uploaded bytes? I think getTotal
mef
2014/09/29 17:57:37
Judging by the name it is just number of received
| |
58 }; | 58 }; |
OLD | NEW |