Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(505)

Side by Side Diff: net/http2/hpack/decoder/hpack_whole_entry_buffer.h

Issue 2665283003: Improve memory estimate of SpdySessionPool in net/ MemoryDumpProvider. (Closed)
Patch Set: rebased Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef NET_HTTP2_HPACK_DECODER_HPACK_WHOLE_ENTRY_BUFFER_H_ 5 #ifndef NET_HTTP2_HPACK_DECODER_HPACK_WHOLE_ENTRY_BUFFER_H_
6 #define NET_HTTP2_HPACK_DECODER_HPACK_WHOLE_ENTRY_BUFFER_H_ 6 #define NET_HTTP2_HPACK_DECODER_HPACK_WHOLE_ENTRY_BUFFER_H_
7 7
8 // HpackWholeEntryBuffer isolates a listener from the fact that an entry may 8 // HpackWholeEntryBuffer isolates a listener from the fact that an entry may
9 // be split across multiple input buffers, providing one callback per entry. 9 // be split across multiple input buffers, providing one callback per entry.
10 // HpackWholeEntryBuffer requires that the HpackEntryDecoderListener be made in 10 // HpackWholeEntryBuffer requires that the HpackEntryDecoderListener be made in
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 // instances name_ and value_ are buffered, which allows any underlying 53 // instances name_ and value_ are buffered, which allows any underlying
54 // transport buffer to be freed or reused without overwriting the decoded 54 // transport buffer to be freed or reused without overwriting the decoded
55 // strings. This is needed only when an HPACK entry is split across transport 55 // strings. This is needed only when an HPACK entry is split across transport
56 // buffers. See HpackDecoder::DecodeFragment. 56 // buffers. See HpackDecoder::DecodeFragment.
57 void BufferStringsIfUnbuffered(); 57 void BufferStringsIfUnbuffered();
58 58
59 // Was an error detected? After an error has been detected and reported, 59 // Was an error detected? After an error has been detected and reported,
60 // no further callbacks will be made to the listener. 60 // no further callbacks will be made to the listener.
61 bool error_detected() const { return error_detected_; } 61 bool error_detected() const { return error_detected_; }
62 62
63 // Returns the estimate of dynamically allocated memory in bytes.
64 size_t EstimateMemoryUsage() const;
65
63 // Implement the HpackEntryDecoderListener methods. 66 // Implement the HpackEntryDecoderListener methods.
64 67
65 void OnIndexedHeader(size_t index) override; 68 void OnIndexedHeader(size_t index) override;
66 void OnStartLiteralHeader(HpackEntryType entry_type, 69 void OnStartLiteralHeader(HpackEntryType entry_type,
67 size_t maybe_name_index) override; 70 size_t maybe_name_index) override;
68 void OnNameStart(bool huffman_encoded, size_t len) override; 71 void OnNameStart(bool huffman_encoded, size_t len) override;
69 void OnNameData(const char* data, size_t len) override; 72 void OnNameData(const char* data, size_t len) override;
70 void OnNameEnd() override; 73 void OnNameEnd() override;
71 void OnValueStart(bool huffman_encoded, size_t len) override; 74 void OnValueStart(bool huffman_encoded, size_t len) override;
72 void OnValueData(const char* data, size_t len) override; 75 void OnValueData(const char* data, size_t len) override;
(...skipping 19 matching lines...) Expand all
92 HpackEntryType entry_type_; 95 HpackEntryType entry_type_;
93 96
94 bool error_detected_ = false; 97 bool error_detected_ = false;
95 98
96 DISALLOW_COPY_AND_ASSIGN(HpackWholeEntryBuffer); 99 DISALLOW_COPY_AND_ASSIGN(HpackWholeEntryBuffer);
97 }; 100 };
98 101
99 } // namespace net 102 } // namespace net
100 103
101 #endif // NET_HTTP2_HPACK_DECODER_HPACK_WHOLE_ENTRY_BUFFER_H_ 104 #endif // NET_HTTP2_HPACK_DECODER_HPACK_WHOLE_ENTRY_BUFFER_H_
OLDNEW
« no previous file with comments | « net/http2/hpack/decoder/hpack_decoder_string_buffer.cc ('k') | net/http2/hpack/decoder/hpack_whole_entry_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698