| 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> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "net/spdy/platform/api/spdy_estimate_memory_usage.h" |
| 10 | 11 |
| 11 namespace net { | 12 namespace net { |
| 12 | 13 |
| 13 const size_t kMaxHeaderListSize = 256 * 1024; | 14 const size_t kMaxHeaderListSize = 256 * 1024; |
| 14 | 15 |
| 15 void HeaderCoalescer::OnHeader(base::StringPiece key, base::StringPiece value) { | 16 void HeaderCoalescer::OnHeader(base::StringPiece key, base::StringPiece value) { |
| 16 if (error_seen_) { | 17 if (error_seen_) { |
| 17 return; | 18 return; |
| 18 } | 19 } |
| 19 | 20 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 headers_[key] = s; | 64 headers_[key] = s; |
| 64 } | 65 } |
| 65 } | 66 } |
| 66 | 67 |
| 67 SpdyHeaderBlock HeaderCoalescer::release_headers() { | 68 SpdyHeaderBlock HeaderCoalescer::release_headers() { |
| 68 DCHECK(headers_valid_); | 69 DCHECK(headers_valid_); |
| 69 headers_valid_ = false; | 70 headers_valid_ = false; |
| 70 return std::move(headers_); | 71 return std::move(headers_); |
| 71 } | 72 } |
| 72 | 73 |
| 74 size_t HeaderCoalescer::EstimateMemoryUsage() const { |
| 75 return SpdyEstimateMemoryUsage(headers_); |
| 76 } |
| 77 |
| 73 } // namespace net | 78 } // namespace net |
| OLD | NEW |