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

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
« no previous file with comments | « net/quic/chromium/quic_stream_factory.cc ('k') | net/spdy/buffered_spdy_framer.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 (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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 size_t GetFrameMaximumSize() const { 223 size_t GetFrameMaximumSize() const {
224 return spdy_framer_.GetFrameMaximumSize(); 224 return spdy_framer_.GetFrameMaximumSize();
225 } 225 }
226 226
227 size_t GetDataFrameMaximumPayload() const { 227 size_t GetDataFrameMaximumPayload() const {
228 return spdy_framer_.GetDataFrameMaximumPayload(); 228 return spdy_framer_.GetDataFrameMaximumPayload();
229 } 229 }
230 230
231 int frames_received() const { return frames_received_; } 231 int frames_received() const { return frames_received_; }
232 232
233 // Returns the estimate of dynamically allocated memory in bytes.
234 size_t EstimateMemoryUsage() const;
235
233 private: 236 private:
234 SpdyFramer spdy_framer_; 237 SpdyFramer spdy_framer_;
235 BufferedSpdyFramerVisitorInterface* visitor_; 238 BufferedSpdyFramerVisitorInterface* visitor_;
236 239
237 int frames_received_; 240 int frames_received_;
238 241
239 // Collection of fields from control frames that we need to 242 // Collection of fields from control frames that we need to
240 // buffer up from the spdy framer. 243 // buffer up from the spdy framer.
241 struct ControlFrameFields { 244 struct ControlFrameFields {
242 SpdyFrameType type; 245 SpdyFrameType type;
243 SpdyStreamId stream_id; 246 SpdyStreamId stream_id;
244 SpdyStreamId associated_stream_id; 247 SpdyStreamId associated_stream_id;
245 SpdyStreamId promised_stream_id; 248 SpdyStreamId promised_stream_id;
246 bool has_priority; 249 bool has_priority;
247 SpdyPriority priority; 250 SpdyPriority priority;
248 int weight; 251 int weight;
249 SpdyStreamId parent_stream_id; 252 SpdyStreamId parent_stream_id;
250 bool exclusive; 253 bool exclusive;
251 bool fin; 254 bool fin;
252 bool unidirectional; 255 bool unidirectional;
253 }; 256 };
254 std::unique_ptr<ControlFrameFields> control_frame_fields_; 257 std::unique_ptr<ControlFrameFields> control_frame_fields_;
255 258
256 // Collection of fields of a GOAWAY frame that this class needs to buffer. 259 // Collection of fields of a GOAWAY frame that this class needs to buffer.
257 struct GoAwayFields { 260 struct GoAwayFields {
258 SpdyStreamId last_accepted_stream_id; 261 SpdyStreamId last_accepted_stream_id;
259 SpdyErrorCode error_code; 262 SpdyErrorCode error_code;
260 std::string debug_data; 263 std::string debug_data;
264
265 // Returns the estimate of dynamically allocated memory in bytes.
266 size_t EstimateMemoryUsage() const;
261 }; 267 };
262 std::unique_ptr<GoAwayFields> goaway_fields_; 268 std::unique_ptr<GoAwayFields> goaway_fields_;
263 269
264 std::unique_ptr<HeaderCoalescer> coalescer_; 270 std::unique_ptr<HeaderCoalescer> coalescer_;
265 271
266 DISALLOW_COPY_AND_ASSIGN(BufferedSpdyFramer); 272 DISALLOW_COPY_AND_ASSIGN(BufferedSpdyFramer);
267 }; 273 };
268 274
269 } // namespace net 275 } // namespace net
270 276
271 #endif // NET_SPDY_BUFFERED_SPDY_FRAMER_H_ 277 #endif // NET_SPDY_BUFFERED_SPDY_FRAMER_H_
OLDNEW
« no previous file with comments | « net/quic/chromium/quic_stream_factory.cc ('k') | net/spdy/buffered_spdy_framer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698