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

Side by Side Diff: net/spdy/hpack/hpack_encoder.h

Issue 2665283003: Improve memory estimate of SpdySessionPool in net/ MemoryDumpProvider. (Closed)
Patch Set: address bnc comments 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 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 #ifndef NET_SPDY_HPACK_HPACK_ENCODER_H_ 5 #ifndef NET_SPDY_HPACK_HPACK_ENCODER_H_
6 #define NET_SPDY_HPACK_HPACK_ENCODER_H_ 6 #define NET_SPDY_HPACK_HPACK_ENCODER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <functional> 10 #include <functional>
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 // this encoder. 94 // this encoder.
95 void SetHeaderListener(HeaderListener listener) { listener_ = listener; } 95 void SetHeaderListener(HeaderListener listener) { listener_ = listener; }
96 96
97 void SetHeaderTableDebugVisitor( 97 void SetHeaderTableDebugVisitor(
98 std::unique_ptr<HpackHeaderTable::DebugVisitorInterface> visitor) { 98 std::unique_ptr<HpackHeaderTable::DebugVisitorInterface> visitor) {
99 header_table_.set_debug_visitor(std::move(visitor)); 99 header_table_.set_debug_visitor(std::move(visitor));
100 } 100 }
101 101
102 void DisableCompression() { enable_compression_ = false; } 102 void DisableCompression() { enable_compression_ = false; }
103 103
104 // Returns the estimate of dynamically allocated memory in bytes.
105 size_t EstimateMemoryUsage() const;
106
104 private: 107 private:
105 friend class test::HpackEncoderPeer; 108 friend class test::HpackEncoderPeer;
106 109
107 class RepresentationIterator; 110 class RepresentationIterator;
108 class Encoderator; 111 class Encoderator;
109 112
110 // Encodes a sequence of header name-value pairs as a single header block. 113 // Encodes a sequence of header name-value pairs as a single header block.
111 void EncodeRepresentations(RepresentationIterator* iter, std::string* output); 114 void EncodeRepresentations(RepresentationIterator* iter, std::string* output);
112 115
113 // Emits a static/dynamic indexed representation (Section 7.1). 116 // Emits a static/dynamic indexed representation (Section 7.1).
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 IndexingPolicy should_index_; 149 IndexingPolicy should_index_;
147 bool enable_compression_; 150 bool enable_compression_;
148 bool should_emit_table_size_; 151 bool should_emit_table_size_;
149 152
150 DISALLOW_COPY_AND_ASSIGN(HpackEncoder); 153 DISALLOW_COPY_AND_ASSIGN(HpackEncoder);
151 }; 154 };
152 155
153 } // namespace net 156 } // namespace net
154 157
155 #endif // NET_SPDY_HPACK_HPACK_ENCODER_H_ 158 #endif // NET_SPDY_HPACK_HPACK_ENCODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698