| 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/http/http_request_headers.h" | 5 #include "net/http/http_request_headers.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 !event_param->GetAsDictionary(&dict) || | 220 !event_param->GetAsDictionary(&dict) || |
| 221 !dict->GetList("headers", &header_list) || | 221 !dict->GetList("headers", &header_list) || |
| 222 !dict->GetString("line", request_line)) { | 222 !dict->GetString("line", request_line)) { |
| 223 return false; | 223 return false; |
| 224 } | 224 } |
| 225 | 225 |
| 226 for (base::ListValue::const_iterator it = header_list->begin(); | 226 for (base::ListValue::const_iterator it = header_list->begin(); |
| 227 it != header_list->end(); | 227 it != header_list->end(); |
| 228 ++it) { | 228 ++it) { |
| 229 std::string header_line; | 229 std::string header_line; |
| 230 if (!it->GetAsString(&header_line)) { | 230 if (!(*it)->GetAsString(&header_line)) { |
| 231 headers->Clear(); | 231 headers->Clear(); |
| 232 *request_line = ""; | 232 *request_line = ""; |
| 233 return false; | 233 return false; |
| 234 } | 234 } |
| 235 headers->AddHeaderFromString(header_line); | 235 headers->AddHeaderFromString(header_line); |
| 236 } | 236 } |
| 237 return true; | 237 return true; |
| 238 } | 238 } |
| 239 | 239 |
| 240 HttpRequestHeaders::HeaderVector::iterator | 240 HttpRequestHeaders::HeaderVector::iterator |
| (...skipping 12 matching lines...) Expand all Loading... |
| 253 for (HeaderVector::const_iterator it = headers_.begin(); | 253 for (HeaderVector::const_iterator it = headers_.begin(); |
| 254 it != headers_.end(); ++it) { | 254 it != headers_.end(); ++it) { |
| 255 if (base::EqualsCaseInsensitiveASCII(key, it->key)) | 255 if (base::EqualsCaseInsensitiveASCII(key, it->key)) |
| 256 return it; | 256 return it; |
| 257 } | 257 } |
| 258 | 258 |
| 259 return headers_.end(); | 259 return headers_.end(); |
| 260 } | 260 } |
| 261 | 261 |
| 262 } // namespace net | 262 } // namespace net |
| OLD | NEW |