| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef NET_HTTP_HTTP_RESPONSE_INFO_H_ | 5 #ifndef NET_HTTP_HTTP_RESPONSE_INFO_H_ |
| 6 #define NET_HTTP_HTTP_RESPONSE_INFO_H_ | 6 #define NET_HTTP_HTTP_RESPONSE_INFO_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 // that would prevent us from doing a bunch of forward declaration. | 52 // that would prevent us from doing a bunch of forward declaration. |
| 53 | 53 |
| 54 // Initializes from the representation stored in the given pickle. | 54 // Initializes from the representation stored in the given pickle. |
| 55 bool InitFromPickle(const Pickle& pickle, bool* response_truncated); | 55 bool InitFromPickle(const Pickle& pickle, bool* response_truncated); |
| 56 | 56 |
| 57 // Call this method to persist the response info. | 57 // Call this method to persist the response info. |
| 58 void Persist(Pickle* pickle, | 58 void Persist(Pickle* pickle, |
| 59 bool skip_transient_headers, | 59 bool skip_transient_headers, |
| 60 bool response_truncated) const; | 60 bool response_truncated) const; |
| 61 | 61 |
| 62 // Whether QUIC is used or not. |
| 63 bool DidUseQuic() const { |
| 64 return connection_info == CONNECTION_INFO_QUIC1_SPDY3; |
| 65 } |
| 66 |
| 62 // The following is only defined if the request_time member is set. | 67 // The following is only defined if the request_time member is set. |
| 63 // If this resource was found in the cache, then this bool is set, and | 68 // If this resource was found in the cache, then this bool is set, and |
| 64 // request_time may corresponds to a time "far" in the past. Note that | 69 // request_time may corresponds to a time "far" in the past. Note that |
| 65 // stale content (perhaps un-cacheable) may be fetched from cache subject to | 70 // stale content (perhaps un-cacheable) may be fetched from cache subject to |
| 66 // the load flags specified on the request info. For example, this is done | 71 // the load flags specified on the request info. For example, this is done |
| 67 // when a user presses the back button to re-render pages, or at startup, | 72 // when a user presses the back button to re-render pages, or at startup, |
| 68 // when reloading previously visited pages (without going over the network). | 73 // when reloading previously visited pages (without going over the network). |
| 69 // Note also that under normal circumstances, was_cached is set to the correct | 74 // Note also that under normal circumstances, was_cached is set to the correct |
| 70 // value even if the request fails. | 75 // value even if the request fails. |
| 71 bool was_cached; | 76 bool was_cached; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 scoped_refptr<IOBufferWithSize> metadata; | 150 scoped_refptr<IOBufferWithSize> metadata; |
| 146 | 151 |
| 147 static ConnectionInfo ConnectionInfoFromNextProto(NextProto next_proto); | 152 static ConnectionInfo ConnectionInfoFromNextProto(NextProto next_proto); |
| 148 | 153 |
| 149 static std::string ConnectionInfoToString(ConnectionInfo connection_info); | 154 static std::string ConnectionInfoToString(ConnectionInfo connection_info); |
| 150 }; | 155 }; |
| 151 | 156 |
| 152 } // namespace net | 157 } // namespace net |
| 153 | 158 |
| 154 #endif // NET_HTTP_HTTP_RESPONSE_INFO_H_ | 159 #endif // NET_HTTP_HTTP_RESPONSE_INFO_H_ |
| OLD | NEW |