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

Side by Side Diff: net/spdy/buffered_spdy_framer.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_BUFFERED_SPDY_FRAMER_H_ 5 #ifndef NET_SPDY_BUFFERED_SPDY_FRAMER_H_
6 #define NET_SPDY_BUFFERED_SPDY_FRAMER_H_ 6 #define NET_SPDY_BUFFERED_SPDY_FRAMER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 size_t GetFrameMaximumSize() const { 228 size_t GetFrameMaximumSize() const {
229 return spdy_framer_.GetFrameMaximumSize(); 229 return spdy_framer_.GetFrameMaximumSize();
230 } 230 }
231 231
232 size_t GetDataFrameMaximumPayload() const { 232 size_t GetDataFrameMaximumPayload() const {
233 return spdy_framer_.GetDataFrameMaximumPayload(); 233 return spdy_framer_.GetDataFrameMaximumPayload();
234 } 234 }
235 235
236 int frames_received() const { return frames_received_; } 236 int frames_received() const { return frames_received_; }
237 237
238 // Returns the estimate of dynamically allocated memory in bytes.
239 size_t EstimateMemoryUsage() const;
240
238 private: 241 private:
239 void InitHeaderStreaming(SpdyStreamId stream_id); 242 void InitHeaderStreaming(SpdyStreamId stream_id);
240 243
241 SpdyFramer spdy_framer_; 244 SpdyFramer spdy_framer_;
242 BufferedSpdyFramerVisitorInterface* visitor_; 245 BufferedSpdyFramerVisitorInterface* visitor_;
243 246
244 // Header block streaming state: 247 // Header block streaming state:
245 std::string header_buffer_; 248 std::string header_buffer_;
246 bool header_buffer_valid_; 249 bool header_buffer_valid_;
247 SpdyStreamId header_stream_id_; 250 SpdyStreamId header_stream_id_;
(...skipping 14 matching lines...) Expand all
262 bool fin; 265 bool fin;
263 bool unidirectional; 266 bool unidirectional;
264 }; 267 };
265 std::unique_ptr<ControlFrameFields> control_frame_fields_; 268 std::unique_ptr<ControlFrameFields> control_frame_fields_;
266 269
267 // Collection of fields of a GOAWAY frame that this class needs to buffer. 270 // Collection of fields of a GOAWAY frame that this class needs to buffer.
268 struct GoAwayFields { 271 struct GoAwayFields {
269 SpdyStreamId last_accepted_stream_id; 272 SpdyStreamId last_accepted_stream_id;
270 SpdyErrorCode error_code; 273 SpdyErrorCode error_code;
271 std::string debug_data; 274 std::string debug_data;
275
276 // Returns the estimate of dynamically allocated memory in bytes.
277 size_t EstimateMemoryUsage() const;
272 }; 278 };
273 std::unique_ptr<GoAwayFields> goaway_fields_; 279 std::unique_ptr<GoAwayFields> goaway_fields_;
274 280
275 std::unique_ptr<HeaderCoalescer> coalescer_; 281 std::unique_ptr<HeaderCoalescer> coalescer_;
276 282
277 DISALLOW_COPY_AND_ASSIGN(BufferedSpdyFramer); 283 DISALLOW_COPY_AND_ASSIGN(BufferedSpdyFramer);
278 }; 284 };
279 285
280 } // namespace net 286 } // namespace net
281 287
282 #endif // NET_SPDY_BUFFERED_SPDY_FRAMER_H_ 288 #endif // NET_SPDY_BUFFERED_SPDY_FRAMER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698