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

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

Issue 2816513002: Revert of Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: Created 3 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
« no previous file with comments | « net/http/http_request_headers.cc ('k') | net/http/http_server_properties_manager.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 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after
1298 !event_param->GetAsDictionary(&dict) || 1298 !event_param->GetAsDictionary(&dict) ||
1299 !dict->GetList("headers", &header_list)) { 1299 !dict->GetList("headers", &header_list)) {
1300 return false; 1300 return false;
1301 } 1301 }
1302 1302
1303 std::string raw_headers; 1303 std::string raw_headers;
1304 for (base::ListValue::const_iterator it = header_list->begin(); 1304 for (base::ListValue::const_iterator it = header_list->begin();
1305 it != header_list->end(); 1305 it != header_list->end();
1306 ++it) { 1306 ++it) {
1307 std::string header_line; 1307 std::string header_line;
1308 if (!it->GetAsString(&header_line)) 1308 if (!(*it)->GetAsString(&header_line))
1309 return false; 1309 return false;
1310 1310
1311 raw_headers.append(header_line); 1311 raw_headers.append(header_line);
1312 raw_headers.push_back('\0'); 1312 raw_headers.push_back('\0');
1313 } 1313 }
1314 raw_headers.push_back('\0'); 1314 raw_headers.push_back('\0');
1315 *http_response_headers = new HttpResponseHeaders(raw_headers); 1315 *http_response_headers = new HttpResponseHeaders(raw_headers);
1316 return true; 1316 return true;
1317 } 1317 }
1318 1318
1319 bool HttpResponseHeaders::IsChunkEncoded() const { 1319 bool HttpResponseHeaders::IsChunkEncoded() const {
1320 // Ignore spurious chunked responses from HTTP/1.0 servers and proxies. 1320 // Ignore spurious chunked responses from HTTP/1.0 servers and proxies.
1321 return GetHttpVersion() >= HttpVersion(1, 1) && 1321 return GetHttpVersion() >= HttpVersion(1, 1) &&
1322 HasHeaderValue("Transfer-Encoding", "chunked"); 1322 HasHeaderValue("Transfer-Encoding", "chunked");
1323 } 1323 }
1324 1324
1325 } // namespace net 1325 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_request_headers.cc ('k') | net/http/http_server_properties_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698