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> |
| 8 |
7 #include "base/logging.h" | 9 #include "base/logging.h" |
8 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
9 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
10 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
11 #include "base/values.h" | 13 #include "base/values.h" |
12 #include "net/http/http_log_util.h" | 14 #include "net/http/http_log_util.h" |
13 #include "net/http/http_util.h" | 15 #include "net/http/http_util.h" |
14 | 16 |
15 namespace net { | 17 namespace net { |
16 | 18 |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 base::ListValue* headers = new base::ListValue(); | 198 base::ListValue* headers = new base::ListValue(); |
197 for (HeaderVector::const_iterator it = headers_.begin(); | 199 for (HeaderVector::const_iterator it = headers_.begin(); |
198 it != headers_.end(); ++it) { | 200 it != headers_.end(); ++it) { |
199 std::string log_value = | 201 std::string log_value = |
200 ElideHeaderValueForNetLog(capture_mode, it->key, it->value); | 202 ElideHeaderValueForNetLog(capture_mode, it->key, it->value); |
201 headers->Append(new base::StringValue( | 203 headers->Append(new base::StringValue( |
202 base::StringPrintf("%s: %s", | 204 base::StringPrintf("%s: %s", |
203 it->key.c_str(), log_value.c_str()))); | 205 it->key.c_str(), log_value.c_str()))); |
204 } | 206 } |
205 dict->Set("headers", headers); | 207 dict->Set("headers", headers); |
206 return dict.Pass(); | 208 return std::move(dict); |
207 } | 209 } |
208 | 210 |
209 // static | 211 // static |
210 bool HttpRequestHeaders::FromNetLogParam(const base::Value* event_param, | 212 bool HttpRequestHeaders::FromNetLogParam(const base::Value* event_param, |
211 HttpRequestHeaders* headers, | 213 HttpRequestHeaders* headers, |
212 std::string* request_line) { | 214 std::string* request_line) { |
213 headers->Clear(); | 215 headers->Clear(); |
214 *request_line = ""; | 216 *request_line = ""; |
215 | 217 |
216 const base::DictionaryValue* dict = NULL; | 218 const base::DictionaryValue* dict = NULL; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 for (HeaderVector::const_iterator it = headers_.begin(); | 255 for (HeaderVector::const_iterator it = headers_.begin(); |
254 it != headers_.end(); ++it) { | 256 it != headers_.end(); ++it) { |
255 if (base::EqualsCaseInsensitiveASCII(key, it->key)) | 257 if (base::EqualsCaseInsensitiveASCII(key, it->key)) |
256 return it; | 258 return it; |
257 } | 259 } |
258 | 260 |
259 return headers_.end(); | 261 return headers_.end(); |
260 } | 262 } |
261 | 263 |
262 } // namespace net | 264 } // namespace net |
OLD | NEW |