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

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

Issue 1154283003: Change most uses of Pickle to base::Pickle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « net/http/http_cache_unittest.cc ('k') | net/http/http_response_headers_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // The rules for header parsing were borrowed from Firefox: 5 // The rules for header parsing were borrowed from Firefox:
6 // http://lxr.mozilla.org/seamonkey/source/netwerk/protocol/http/src/nsHttpRespo nseHead.cpp 6 // http://lxr.mozilla.org/seamonkey/source/netwerk/protocol/http/src/nsHttpRespo nseHead.cpp
7 // The rules for parsing content-types were also borrowed from Firefox: 7 // The rules for parsing content-types were also borrowed from Firefox:
8 // http://lxr.mozilla.org/mozilla/source/netwerk/base/src/nsURLHelper.cpp#834 8 // http://lxr.mozilla.org/mozilla/source/netwerk/base/src/nsURLHelper.cpp#834
9 9
10 #include "net/http/http_response_headers.h" 10 #include "net/http/http_response_headers.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 // new object from that pickle. 149 // new object from that pickle.
150 UMA_HISTOGRAM_CUSTOM_ENUMERATION("Net.HttpResponseCode", 150 UMA_HISTOGRAM_CUSTOM_ENUMERATION("Net.HttpResponseCode",
151 HttpUtil::MapStatusCodeForHistogram( 151 HttpUtil::MapStatusCodeForHistogram(
152 response_code_), 152 response_code_),
153 // Note the third argument is only 153 // Note the third argument is only
154 // evaluated once, see macro 154 // evaluated once, see macro
155 // definition for details. 155 // definition for details.
156 HttpUtil::GetStatusCodesForHistogram()); 156 HttpUtil::GetStatusCodesForHistogram());
157 } 157 }
158 158
159 HttpResponseHeaders::HttpResponseHeaders(PickleIterator* iter) 159 HttpResponseHeaders::HttpResponseHeaders(base::PickleIterator* iter)
160 : response_code_(-1) { 160 : response_code_(-1) {
161 std::string raw_input; 161 std::string raw_input;
162 if (iter->ReadString(&raw_input)) 162 if (iter->ReadString(&raw_input))
163 Parse(raw_input); 163 Parse(raw_input);
164 } 164 }
165 165
166 void HttpResponseHeaders::Persist(Pickle* pickle, PersistOptions options) { 166 void HttpResponseHeaders::Persist(base::Pickle* pickle,
167 PersistOptions options) {
167 if (options == PERSIST_RAW) { 168 if (options == PERSIST_RAW) {
168 pickle->WriteString(raw_headers_); 169 pickle->WriteString(raw_headers_);
169 return; // Done. 170 return; // Done.
170 } 171 }
171 172
172 HeaderSet filter_headers; 173 HeaderSet filter_headers;
173 174
174 // Construct set of headers to filter out based on options. 175 // Construct set of headers to filter out based on options.
175 if ((options & PERSIST_SANS_NON_CACHEABLE) == PERSIST_SANS_NON_CACHEABLE) 176 if ((options & PERSIST_SANS_NON_CACHEABLE) == PERSIST_SANS_NON_CACHEABLE)
176 AddNonCacheableHeaders(&filter_headers); 177 AddNonCacheableHeaders(&filter_headers);
(...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after
1444 return true; 1445 return true;
1445 } 1446 }
1446 1447
1447 bool HttpResponseHeaders::IsChunkEncoded() const { 1448 bool HttpResponseHeaders::IsChunkEncoded() const {
1448 // Ignore spurious chunked responses from HTTP/1.0 servers and proxies. 1449 // Ignore spurious chunked responses from HTTP/1.0 servers and proxies.
1449 return GetHttpVersion() >= HttpVersion(1, 1) && 1450 return GetHttpVersion() >= HttpVersion(1, 1) &&
1450 HasHeaderValue("Transfer-Encoding", "chunked"); 1451 HasHeaderValue("Transfer-Encoding", "chunked");
1451 } 1452 }
1452 1453
1453 } // namespace net 1454 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_cache_unittest.cc ('k') | net/http/http_response_headers_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698