OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "net/http/http_response_info.h" | 5 #include "net/http/http_response_info.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/pickle.h" | 8 #include "base/pickle.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "net/base/auth.h" | 10 #include "net/base/auth.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
96 }; | 96 }; |
97 | 97 |
98 HttpResponseInfo::HttpResponseInfo() | 98 HttpResponseInfo::HttpResponseInfo() |
99 : was_cached(false), | 99 : was_cached(false), |
100 server_data_unavailable(false), | 100 server_data_unavailable(false), |
101 network_accessed(false), | 101 network_accessed(false), |
102 was_fetched_via_spdy(false), | 102 was_fetched_via_spdy(false), |
103 was_npn_negotiated(false), | 103 was_npn_negotiated(false), |
104 was_fetched_via_proxy(false), | 104 was_fetched_via_proxy(false), |
105 did_use_http_auth(false), | 105 did_use_http_auth(false), |
106 was_fetched_via_service_worker(false), | |
106 connection_info(CONNECTION_INFO_UNKNOWN) { | 107 connection_info(CONNECTION_INFO_UNKNOWN) { |
107 } | 108 } |
108 | 109 |
109 HttpResponseInfo::HttpResponseInfo(const HttpResponseInfo& rhs) | 110 HttpResponseInfo::HttpResponseInfo(const HttpResponseInfo& rhs) |
110 : was_cached(rhs.was_cached), | 111 : was_cached(rhs.was_cached), |
111 server_data_unavailable(rhs.server_data_unavailable), | 112 server_data_unavailable(rhs.server_data_unavailable), |
112 network_accessed(rhs.network_accessed), | 113 network_accessed(rhs.network_accessed), |
113 was_fetched_via_spdy(rhs.was_fetched_via_spdy), | 114 was_fetched_via_spdy(rhs.was_fetched_via_spdy), |
114 was_npn_negotiated(rhs.was_npn_negotiated), | 115 was_npn_negotiated(rhs.was_npn_negotiated), |
115 was_fetched_via_proxy(rhs.was_fetched_via_proxy), | 116 was_fetched_via_proxy(rhs.was_fetched_via_proxy), |
116 proxy_server(rhs.proxy_server), | 117 proxy_server(rhs.proxy_server), |
117 did_use_http_auth(rhs.did_use_http_auth), | 118 did_use_http_auth(rhs.did_use_http_auth), |
119 was_fetched_via_service_worker(rhs.was_fetched_via_service_worker), | |
120 original_url_via_service_worker(rhs.original_url_via_service_worker), | |
118 socket_address(rhs.socket_address), | 121 socket_address(rhs.socket_address), |
119 npn_negotiated_protocol(rhs.npn_negotiated_protocol), | 122 npn_negotiated_protocol(rhs.npn_negotiated_protocol), |
120 connection_info(rhs.connection_info), | 123 connection_info(rhs.connection_info), |
121 request_time(rhs.request_time), | 124 request_time(rhs.request_time), |
122 response_time(rhs.response_time), | 125 response_time(rhs.response_time), |
123 auth_challenge(rhs.auth_challenge), | 126 auth_challenge(rhs.auth_challenge), |
124 cert_request_info(rhs.cert_request_info), | 127 cert_request_info(rhs.cert_request_info), |
125 ssl_info(rhs.ssl_info), | 128 ssl_info(rhs.ssl_info), |
126 headers(rhs.headers), | 129 headers(rhs.headers), |
127 vary_data(rhs.vary_data), | 130 vary_data(rhs.vary_data), |
128 metadata(rhs.metadata) { | 131 metadata(rhs.metadata) { |
129 } | 132 } |
130 | 133 |
131 HttpResponseInfo::~HttpResponseInfo() { | 134 HttpResponseInfo::~HttpResponseInfo() { |
132 } | 135 } |
133 | 136 |
134 HttpResponseInfo& HttpResponseInfo::operator=(const HttpResponseInfo& rhs) { | 137 HttpResponseInfo& HttpResponseInfo::operator=(const HttpResponseInfo& rhs) { |
135 was_cached = rhs.was_cached; | 138 was_cached = rhs.was_cached; |
136 server_data_unavailable = rhs.server_data_unavailable; | 139 server_data_unavailable = rhs.server_data_unavailable; |
137 network_accessed = rhs.network_accessed; | 140 network_accessed = rhs.network_accessed; |
138 was_fetched_via_spdy = rhs.was_fetched_via_spdy; | 141 was_fetched_via_spdy = rhs.was_fetched_via_spdy; |
139 proxy_server = rhs.proxy_server; | 142 proxy_server = rhs.proxy_server; |
140 was_npn_negotiated = rhs.was_npn_negotiated; | 143 was_npn_negotiated = rhs.was_npn_negotiated; |
141 was_fetched_via_proxy = rhs.was_fetched_via_proxy; | 144 was_fetched_via_proxy = rhs.was_fetched_via_proxy; |
142 did_use_http_auth = rhs.did_use_http_auth; | 145 did_use_http_auth = rhs.did_use_http_auth; |
146 was_fetched_via_service_worker = rhs.was_fetched_via_service_worker; | |
147 original_url_via_service_worker = rhs.original_url_via_service_worker; | |
143 socket_address = rhs.socket_address; | 148 socket_address = rhs.socket_address; |
144 npn_negotiated_protocol = rhs.npn_negotiated_protocol; | 149 npn_negotiated_protocol = rhs.npn_negotiated_protocol; |
145 connection_info = rhs.connection_info; | 150 connection_info = rhs.connection_info; |
146 request_time = rhs.request_time; | 151 request_time = rhs.request_time; |
147 response_time = rhs.response_time; | 152 response_time = rhs.response_time; |
148 auth_challenge = rhs.auth_challenge; | 153 auth_challenge = rhs.auth_challenge; |
149 cert_request_info = rhs.cert_request_info; | 154 cert_request_info = rhs.cert_request_info; |
150 ssl_info = rhs.ssl_info; | 155 ssl_info = rhs.ssl_info; |
151 headers = rhs.headers; | 156 headers = rhs.headers; |
152 vary_data = rhs.vary_data; | 157 vary_data = rhs.vary_data; |
153 metadata = rhs.metadata; | 158 metadata = rhs.metadata; |
154 return *this; | 159 return *this; |
155 } | 160 } |
156 | 161 |
157 bool HttpResponseInfo::InitFromPickle(const Pickle& pickle, | 162 bool HttpResponseInfo::InitFromPickle(const Pickle& pickle, |
tyoshino (SeeGerritForStatus)
2014/07/09 06:35:25
is it ok to skip serializer/deserializer implement
horo
2014/07/09 11:14:03
Added serializer/deserializer of was_fetched_via_s
| |
158 bool* response_truncated) { | 163 bool* response_truncated) { |
159 PickleIterator iter(pickle); | 164 PickleIterator iter(pickle); |
160 | 165 |
161 // Read flags and verify version | 166 // Read flags and verify version |
162 int flags; | 167 int flags; |
163 if (!pickle.ReadInt(&iter, &flags)) | 168 if (!pickle.ReadInt(&iter, &flags)) |
164 return false; | 169 return false; |
165 int version = flags & RESPONSE_INFO_VERSION_MASK; | 170 int version = flags & RESPONSE_INFO_VERSION_MASK; |
166 if (version < RESPONSE_INFO_MINIMUM_VERSION || | 171 if (version < RESPONSE_INFO_MINIMUM_VERSION || |
167 version > RESPONSE_INFO_VERSION) { | 172 version > RESPONSE_INFO_VERSION) { |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
402 case CONNECTION_INFO_QUIC1_SPDY3: | 407 case CONNECTION_INFO_QUIC1_SPDY3: |
403 return "quic/1+spdy/3"; | 408 return "quic/1+spdy/3"; |
404 case NUM_OF_CONNECTION_INFOS: | 409 case NUM_OF_CONNECTION_INFOS: |
405 break; | 410 break; |
406 } | 411 } |
407 NOTREACHED(); | 412 NOTREACHED(); |
408 return ""; | 413 return ""; |
409 } | 414 } |
410 | 415 |
411 } // namespace net | 416 } // namespace net |
OLD | NEW |