| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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/header_coalescer.h" | 5 #include "net/spdy/header_coalescer.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 8 | 10 |
| 9 namespace net { | 11 namespace net { |
| 10 | 12 |
| 11 const size_t kMaxHeaderListSize = 256 * 1024; | 13 const size_t kMaxHeaderListSize = 256 * 1024; |
| 12 | 14 |
| 13 void HeaderCoalescer::OnHeader(base::StringPiece key, base::StringPiece value) { | 15 void HeaderCoalescer::OnHeader(base::StringPiece key, base::StringPiece value) { |
| 14 if (error_seen_) { | 16 if (error_seen_) { |
| 15 return; | 17 return; |
| 16 } | 18 } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 // Obeys section 8.1.2.5 in RFC 7540 for cookie reconstruction. | 50 // Obeys section 8.1.2.5 in RFC 7540 for cookie reconstruction. |
| 49 s.append("; "); | 51 s.append("; "); |
| 50 } else { | 52 } else { |
| 51 base::StringPiece("\0", 1).AppendToString(&s); | 53 base::StringPiece("\0", 1).AppendToString(&s); |
| 52 } | 54 } |
| 53 value.AppendToString(&s); | 55 value.AppendToString(&s); |
| 54 headers_.ReplaceOrAppendHeader(key, s); | 56 headers_.ReplaceOrAppendHeader(key, s); |
| 55 } | 57 } |
| 56 } | 58 } |
| 57 | 59 |
| 60 SpdyHeaderBlock HeaderCoalescer::release_headers() { |
| 61 DCHECK(headers_valid_); |
| 62 headers_valid_ = false; |
| 63 return std::move(headers_); |
| 64 } |
| 65 |
| 58 } // namespace net | 66 } // namespace net |
| OLD | NEW |