Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(379)

Side by Side Diff: net/http/http_response_info.cc

Issue 12886022: Implement offline mode behind a flag (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added tests. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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.h" 9 #include "base/time.h"
10 #include "net/base/auth.h" 10 #include "net/base/auth.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 // This bit is set if the response info has connection info. 84 // This bit is set if the response info has connection info.
85 RESPONSE_INFO_HAS_CONNECTION_INFO = 1 << 18, 85 RESPONSE_INFO_HAS_CONNECTION_INFO = 1 << 18,
86 86
87 // TODO(darin): Add other bits to indicate alternate request methods. 87 // TODO(darin): Add other bits to indicate alternate request methods.
88 // For now, we don't support storing those. 88 // For now, we don't support storing those.
89 }; 89 };
90 90
91 HttpResponseInfo::HttpResponseInfo() 91 HttpResponseInfo::HttpResponseInfo()
92 : was_cached(false), 92 : was_cached(false),
93 server_data_unavailable(false), 93 server_data_unavailable(false),
94 network_accessed(false),
94 was_fetched_via_spdy(false), 95 was_fetched_via_spdy(false),
95 was_npn_negotiated(false), 96 was_npn_negotiated(false),
96 was_fetched_via_proxy(false), 97 was_fetched_via_proxy(false),
97 connection_info(CONNECTION_INFO_UNKNOWN) { 98 connection_info(CONNECTION_INFO_UNKNOWN) {
98 } 99 }
99 100
100 HttpResponseInfo::HttpResponseInfo(const HttpResponseInfo& rhs) 101 HttpResponseInfo::HttpResponseInfo(const HttpResponseInfo& rhs)
101 : was_cached(rhs.was_cached), 102 : was_cached(rhs.was_cached),
102 server_data_unavailable(rhs.server_data_unavailable), 103 server_data_unavailable(rhs.server_data_unavailable),
104 network_accessed(rhs.network_accessed),
103 was_fetched_via_spdy(rhs.was_fetched_via_spdy), 105 was_fetched_via_spdy(rhs.was_fetched_via_spdy),
104 was_npn_negotiated(rhs.was_npn_negotiated), 106 was_npn_negotiated(rhs.was_npn_negotiated),
105 was_fetched_via_proxy(rhs.was_fetched_via_proxy), 107 was_fetched_via_proxy(rhs.was_fetched_via_proxy),
106 socket_address(rhs.socket_address), 108 socket_address(rhs.socket_address),
107 npn_negotiated_protocol(rhs.npn_negotiated_protocol), 109 npn_negotiated_protocol(rhs.npn_negotiated_protocol),
108 connection_info(rhs.connection_info), 110 connection_info(rhs.connection_info),
109 request_time(rhs.request_time), 111 request_time(rhs.request_time),
110 response_time(rhs.response_time), 112 response_time(rhs.response_time),
111 auth_challenge(rhs.auth_challenge), 113 auth_challenge(rhs.auth_challenge),
112 cert_request_info(rhs.cert_request_info), 114 cert_request_info(rhs.cert_request_info),
113 ssl_info(rhs.ssl_info), 115 ssl_info(rhs.ssl_info),
114 headers(rhs.headers), 116 headers(rhs.headers),
115 vary_data(rhs.vary_data), 117 vary_data(rhs.vary_data),
116 metadata(rhs.metadata) { 118 metadata(rhs.metadata) {
117 } 119 }
118 120
119 HttpResponseInfo::~HttpResponseInfo() { 121 HttpResponseInfo::~HttpResponseInfo() {
120 } 122 }
121 123
122 HttpResponseInfo& HttpResponseInfo::operator=(const HttpResponseInfo& rhs) { 124 HttpResponseInfo& HttpResponseInfo::operator=(const HttpResponseInfo& rhs) {
123 was_cached = rhs.was_cached; 125 was_cached = rhs.was_cached;
124 server_data_unavailable = rhs.server_data_unavailable; 126 server_data_unavailable = rhs.server_data_unavailable;
127 network_accessed = rhs.network_accessed;
125 was_fetched_via_spdy = rhs.was_fetched_via_spdy; 128 was_fetched_via_spdy = rhs.was_fetched_via_spdy;
126 was_npn_negotiated = rhs.was_npn_negotiated; 129 was_npn_negotiated = rhs.was_npn_negotiated;
127 was_fetched_via_proxy = rhs.was_fetched_via_proxy; 130 was_fetched_via_proxy = rhs.was_fetched_via_proxy;
128 socket_address = rhs.socket_address; 131 socket_address = rhs.socket_address;
129 npn_negotiated_protocol = rhs.npn_negotiated_protocol; 132 npn_negotiated_protocol = rhs.npn_negotiated_protocol;
130 request_time = rhs.request_time; 133 request_time = rhs.request_time;
131 response_time = rhs.response_time; 134 response_time = rhs.response_time;
132 auth_challenge = rhs.auth_challenge; 135 auth_challenge = rhs.auth_challenge;
133 cert_request_info = rhs.cert_request_info; 136 cert_request_info = rhs.cert_request_info;
134 ssl_info = rhs.ssl_info; 137 ssl_info = rhs.ssl_info;
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 pickle->WriteUInt16(socket_address.port()); 311 pickle->WriteUInt16(socket_address.port());
309 312
310 if (was_npn_negotiated) 313 if (was_npn_negotiated)
311 pickle->WriteString(npn_negotiated_protocol); 314 pickle->WriteString(npn_negotiated_protocol);
312 315
313 if (connection_info != CONNECTION_INFO_UNKNOWN) 316 if (connection_info != CONNECTION_INFO_UNKNOWN)
314 pickle->WriteInt(static_cast<int>(connection_info)); 317 pickle->WriteInt(static_cast<int>(connection_info));
315 } 318 }
316 319
317 } // namespace net 320 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698