| 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_header_block.h" | 5 #include "net/spdy/spdy_header_block.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 | 336 |
| 337 std::unique_ptr<base::Value> SpdyHeaderBlockNetLogCallback( | 337 std::unique_ptr<base::Value> SpdyHeaderBlockNetLogCallback( |
| 338 const SpdyHeaderBlock* headers, | 338 const SpdyHeaderBlock* headers, |
| 339 NetLogCaptureMode capture_mode) { | 339 NetLogCaptureMode capture_mode) { |
| 340 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); | 340 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| 341 base::DictionaryValue* headers_dict = new base::DictionaryValue(); | 341 base::DictionaryValue* headers_dict = new base::DictionaryValue(); |
| 342 for (SpdyHeaderBlock::const_iterator it = headers->begin(); | 342 for (SpdyHeaderBlock::const_iterator it = headers->begin(); |
| 343 it != headers->end(); ++it) { | 343 it != headers->end(); ++it) { |
| 344 headers_dict->SetWithoutPathExpansion( | 344 headers_dict->SetWithoutPathExpansion( |
| 345 it->first.as_string(), | 345 it->first.as_string(), |
| 346 new base::StringValue(ElideHeaderValueForNetLog( | 346 new base::Value(ElideHeaderValueForNetLog( |
| 347 capture_mode, it->first.as_string(), it->second.as_string()))); | 347 capture_mode, it->first.as_string(), it->second.as_string()))); |
| 348 } | 348 } |
| 349 dict->Set("headers", headers_dict); | 349 dict->Set("headers", headers_dict); |
| 350 return std::move(dict); | 350 return std::move(dict); |
| 351 } | 351 } |
| 352 | 352 |
| 353 bool SpdyHeaderBlockFromNetLogParam( | 353 bool SpdyHeaderBlockFromNetLogParam( |
| 354 const base::Value* event_param, | 354 const base::Value* event_param, |
| 355 SpdyHeaderBlock* headers) { | 355 SpdyHeaderBlock* headers) { |
| 356 headers->clear(); | 356 headers->clear(); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 for (++it; it != fragments.end(); ++it) { | 397 for (++it; it != fragments.end(); ++it) { |
| 398 memcpy(dst, separator.data(), separator.size()); | 398 memcpy(dst, separator.data(), separator.size()); |
| 399 dst += separator.size(); | 399 dst += separator.size(); |
| 400 memcpy(dst, it->data(), it->size()); | 400 memcpy(dst, it->data(), it->size()); |
| 401 dst += it->size(); | 401 dst += it->size(); |
| 402 } | 402 } |
| 403 return dst - original_dst; | 403 return dst - original_dst; |
| 404 } | 404 } |
| 405 | 405 |
| 406 } // namespace net | 406 } // namespace net |
| OLD | NEW |