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

Side by Side Diff: net/http2/hpack/decoder/hpack_decoder_string_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
« no previous file with comments | « net/base/host_port_pair.cc ('k') | net/http2/hpack/decoder/hpack_decoder_string_buffer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_DECODER_STRING_BUFFER_H_ 5 #ifndef NET_HTTP2_HPACK_DECODER_HPACK_DECODER_STRING_BUFFER_H_
6 #define NET_HTTP2_HPACK_DECODER_HPACK_DECODER_STRING_BUFFER_H_ 6 #define NET_HTTP2_HPACK_DECODER_HPACK_DECODER_STRING_BUFFER_H_
7 7
8 // HpackDecoderStringBuffer helps an HPACK decoder to avoid copies of a string 8 // HpackDecoderStringBuffer helps an HPACK decoder to avoid copies of a string
9 // literal (name or value) except when necessary (e.g. when split across two 9 // literal (name or value) except when necessary (e.g. when split across two
10 // or more HPACK block fragments). 10 // or more HPACK block fragments).
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 // effort to avoid unnecessary copies. ReleaseString() must not be called 55 // effort to avoid unnecessary copies. ReleaseString() must not be called
56 // unless the string has been buffered (to avoid forcing a potentially 56 // unless the string has been buffered (to avoid forcing a potentially
57 // unnecessary copy). ReleaseString() also resets the instance so that it can 57 // unnecessary copy). ReleaseString() also resets the instance so that it can
58 // be used to collect another string. 58 // be used to collect another string.
59 std::string ReleaseString(); 59 std::string ReleaseString();
60 60
61 State state_for_testing() const { return state_; } 61 State state_for_testing() const { return state_; }
62 Backing backing_for_testing() const { return backing_; } 62 Backing backing_for_testing() const { return backing_; }
63 void OutputDebugStringTo(std::ostream& out) const; 63 void OutputDebugStringTo(std::ostream& out) const;
64 64
65 // Returns the estimate of dynamically allocated memory in bytes.
66 size_t EstimateMemoryUsage() const;
67
65 private: 68 private:
66 // Storage for the string being buffered, if buffering is necessary 69 // Storage for the string being buffered, if buffering is necessary
67 // (e.g. if Huffman encoded, buffer_ is storage for the decoded string). 70 // (e.g. if Huffman encoded, buffer_ is storage for the decoded string).
68 std::string buffer_; 71 std::string buffer_;
69 72
70 // The StringPiece to be returned by HpackDecoderStringBuffer::str(). If a 73 // The StringPiece to be returned by HpackDecoderStringBuffer::str(). If a
71 // string has been collected, but not buffered, value_ points to that string. 74 // string has been collected, but not buffered, value_ points to that string.
72 base::StringPiece value_; 75 base::StringPiece value_;
73 76
74 // The decoder to use if the string is Huffman encoded. 77 // The decoder to use if the string is Huffman encoded.
(...skipping 13 matching lines...) Expand all
88 91
89 DISALLOW_COPY_AND_ASSIGN(HpackDecoderStringBuffer); 92 DISALLOW_COPY_AND_ASSIGN(HpackDecoderStringBuffer);
90 }; 93 };
91 94
92 NET_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& out, 95 NET_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& out,
93 const HpackDecoderStringBuffer& v); 96 const HpackDecoderStringBuffer& v);
94 97
95 } // namespace net 98 } // namespace net
96 99
97 #endif // NET_HTTP2_HPACK_DECODER_HPACK_DECODER_STRING_BUFFER_H_ 100 #endif // NET_HTTP2_HPACK_DECODER_HPACK_DECODER_STRING_BUFFER_H_
OLDNEW
« no previous file with comments | « net/base/host_port_pair.cc ('k') | net/http2/hpack/decoder/hpack_decoder_string_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698