| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 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/http2/hpack/decoder/hpack_decoder_string_buffer.h" | 5 #include "net/http2/hpack/decoder/hpack_decoder_string_buffer.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/trace_event/memory_usage_estimator.h" |
| 10 #include "net/http2/tools/http2_bug_tracker.h" | 11 #include "net/http2/tools/http2_bug_tracker.h" |
| 11 | 12 |
| 12 using base::StringPiece; | 13 using base::StringPiece; |
| 13 using std::string; | 14 using std::string; |
| 14 | 15 |
| 15 namespace net { | 16 namespace net { |
| 16 | 17 |
| 17 std::ostream& operator<<(std::ostream& out, | 18 std::ostream& operator<<(std::ostream& out, |
| 18 const HpackDecoderStringBuffer::State v) { | 19 const HpackDecoderStringBuffer::State v) { |
| 19 switch (v) { | 20 switch (v) { |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 out << ", is_huffman_encoded=" << is_huffman_encoded_; | 218 out << ", is_huffman_encoded=" << is_huffman_encoded_; |
| 218 if (backing_ == Backing::BUFFERED) { | 219 if (backing_ == Backing::BUFFERED) { |
| 219 out << ", buffer: " << buffer_; | 220 out << ", buffer: " << buffer_; |
| 220 } else { | 221 } else { |
| 221 out << ", value: " << value_; | 222 out << ", value: " << value_; |
| 222 } | 223 } |
| 223 } | 224 } |
| 224 out << "}"; | 225 out << "}"; |
| 225 } | 226 } |
| 226 | 227 |
| 228 size_t HpackDecoderStringBuffer::EstimateMemoryUsage() const { |
| 229 return base::trace_event::EstimateMemoryUsage(buffer_); |
| 230 } |
| 231 |
| 227 std::ostream& operator<<(std::ostream& out, const HpackDecoderStringBuffer& v) { | 232 std::ostream& operator<<(std::ostream& out, const HpackDecoderStringBuffer& v) { |
| 228 v.OutputDebugStringTo(out); | 233 v.OutputDebugStringTo(out); |
| 229 return out; | 234 return out; |
| 230 } | 235 } |
| 231 | 236 |
| 232 } // namespace net | 237 } // namespace net |
| OLD | NEW |