| 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/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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 std::find(status_line.begin(), status_line.end(), ' '); | 157 std::find(status_line.begin(), status_line.end(), ' '); |
| 158 if (protocol_version < HTTP2) { | 158 if (protocol_version < HTTP2) { |
| 159 (*headers)[version_key] = std::string(status_line.begin(), after_version); | 159 (*headers)[version_key] = std::string(status_line.begin(), after_version); |
| 160 } | 160 } |
| 161 | 161 |
| 162 // Get status code only. | 162 // Get status code only. |
| 163 std::string::const_iterator after_status = | 163 std::string::const_iterator after_status = |
| 164 std::find(after_version + 1, status_line.end(), ' '); | 164 std::find(after_version + 1, status_line.end(), ' '); |
| 165 (*headers)[status_key] = std::string(after_version + 1, after_status); | 165 (*headers)[status_key] = std::string(after_version + 1, after_status); |
| 166 | 166 |
| 167 void* iter = NULL; | 167 size_t iter = 0; |
| 168 std::string raw_name, value; | 168 std::string raw_name, value; |
| 169 while (response_headers.EnumerateHeaderLines(&iter, &raw_name, &value)) { | 169 while (response_headers.EnumerateHeaderLines(iter, &raw_name, &value)) { |
| 170 std::string name = base::ToLowerASCII(raw_name); | 170 std::string name = base::ToLowerASCII(raw_name); |
| 171 AddSpdyHeader(name, value, headers); | 171 AddSpdyHeader(name, value, headers); |
| 172 } | 172 } |
| 173 } | 173 } |
| 174 | 174 |
| 175 static_assert(HIGHEST - LOWEST < 4 && HIGHEST - MINIMUM_PRIORITY < 5, | 175 static_assert(HIGHEST - LOWEST < 4 && HIGHEST - MINIMUM_PRIORITY < 5, |
| 176 "request priority incompatible with spdy"); | 176 "request priority incompatible with spdy"); |
| 177 | 177 |
| 178 SpdyPriority ConvertRequestPriorityToSpdyPriority( | 178 SpdyPriority ConvertRequestPriorityToSpdyPriority( |
| 179 const RequestPriority priority, | 179 const RequestPriority priority, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 208 url.append(it->second.as_string()); | 208 url.append(it->second.as_string()); |
| 209 | 209 |
| 210 it = headers.find(":path"); | 210 it = headers.find(":path"); |
| 211 if (it == headers.end()) | 211 if (it == headers.end()) |
| 212 return GURL(); | 212 return GURL(); |
| 213 url.append(it->second.as_string()); | 213 url.append(it->second.as_string()); |
| 214 return GURL(url); | 214 return GURL(url); |
| 215 } | 215 } |
| 216 | 216 |
| 217 } // namespace net | 217 } // namespace net |
| OLD | NEW |