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

Side by Side Diff: net/spdy/spdy_http_utils.cc

Issue 17382012: [SPDY] Refactor SpdyStream's handling of response headers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More updates from rebase Created 7 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 | Annotate | Revision Log
« no previous file with comments | « net/spdy/spdy_http_stream.cc ('k') | net/spdy/spdy_network_transaction_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 #include "net/spdy/spdy_http_utils.h" 5 #include "net/spdy/spdy_http_utils.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 22 matching lines...) Expand all
33 it = headers.find(status_key); 33 it = headers.find(status_key);
34 if (it == headers.end()) 34 if (it == headers.end())
35 return false; 35 return false;
36 status = it->second; 36 status = it->second;
37 37
38 it = headers.find(version_key); 38 it = headers.find(version_key);
39 if (it == headers.end()) 39 if (it == headers.end())
40 return false; 40 return false;
41 version = it->second; 41 version = it->second;
42 42
43 response->response_time = base::Time::Now();
44
45 std::string raw_headers(version); 43 std::string raw_headers(version);
46 raw_headers.push_back(' '); 44 raw_headers.push_back(' ');
47 raw_headers.append(status); 45 raw_headers.append(status);
48 raw_headers.push_back('\0'); 46 raw_headers.push_back('\0');
49 for (it = headers.begin(); it != headers.end(); ++it) { 47 for (it = headers.begin(); it != headers.end(); ++it) {
50 // For each value, if the server sends a NUL-separated 48 // For each value, if the server sends a NUL-separated
51 // list of values, we separate that back out into 49 // list of values, we separate that back out into
52 // individual headers for each value in the list. 50 // individual headers for each value in the list.
53 // e.g. 51 // e.g.
54 // Set-Cookie "foo\0bar" 52 // Set-Cookie "foo\0bar"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 194
197 bool ShouldShowHttpHeaderValue(const std::string& header_name) { 195 bool ShouldShowHttpHeaderValue(const std::string& header_name) {
198 #if defined(SPDY_PROXY_AUTH_ORIGIN) 196 #if defined(SPDY_PROXY_AUTH_ORIGIN)
199 if (header_name == "proxy-authorization") 197 if (header_name == "proxy-authorization")
200 return false; 198 return false;
201 #endif 199 #endif
202 return true; 200 return true;
203 } 201 }
204 202
205 } // namespace net 203 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_http_stream.cc ('k') | net/spdy/spdy_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698