| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/hpack/hpack_output_stream.h" | 5 #include "net/spdy/hpack/hpack_output_stream.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "net/spdy/platform/api/spdy_estimate_memory_usage.h" |
| 10 | 11 |
| 11 namespace net { | 12 namespace net { |
| 12 | 13 |
| 13 using base::StringPiece; | 14 using base::StringPiece; |
| 14 using std::string; | 15 using std::string; |
| 15 | 16 |
| 16 HpackOutputStream::HpackOutputStream() : bit_offset_(0) {} | 17 HpackOutputStream::HpackOutputStream() : bit_offset_(0) {} |
| 17 | 18 |
| 18 HpackOutputStream::~HpackOutputStream() {} | 19 HpackOutputStream::~HpackOutputStream() {} |
| 19 | 20 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 // Give buffer to output string. | 86 // Give buffer to output string. |
| 86 *output = std::move(buffer_); | 87 *output = std::move(buffer_); |
| 87 | 88 |
| 88 // Reset to contain overflow. | 89 // Reset to contain overflow. |
| 89 buffer_ = std::move(overflow); | 90 buffer_ = std::move(overflow); |
| 90 } else { | 91 } else { |
| 91 TakeString(output); | 92 TakeString(output); |
| 92 } | 93 } |
| 93 } | 94 } |
| 94 | 95 |
| 96 size_t HpackOutputStream::EstimateMemoryUsage() const { |
| 97 return SpdyEstimateMemoryUsage(buffer_); |
| 98 } |
| 99 |
| 95 } // namespace net | 100 } // namespace net |
| OLD | NEW |