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

Side by Side Diff: net/spdy/spdy_write_queue.h

Issue 2665283003: Improve memory estimate of SpdySessionPool in net/ MemoryDumpProvider. (Closed)
Patch Set: 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_SPDY_WRITE_QUEUE_H_ 5 #ifndef NET_SPDY_SPDY_WRITE_QUEUE_H_
6 #define NET_SPDY_SPDY_WRITE_QUEUE_H_ 6 #define NET_SPDY_SPDY_WRITE_QUEUE_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 // non-NULL. 52 // non-NULL.
53 void RemovePendingWritesForStream(const base::WeakPtr<SpdyStream>& stream); 53 void RemovePendingWritesForStream(const base::WeakPtr<SpdyStream>& stream);
54 54
55 // Removes all pending writes for streams after |last_good_stream_id| 55 // Removes all pending writes for streams after |last_good_stream_id|
56 // and streams with no stream id. 56 // and streams with no stream id.
57 void RemovePendingWritesForStreamsAfter(SpdyStreamId last_good_stream_id); 57 void RemovePendingWritesForStreamsAfter(SpdyStreamId last_good_stream_id);
58 58
59 // Removes all pending writes. 59 // Removes all pending writes.
60 void Clear(); 60 void Clear();
61 61
62 // Returns the estimate of dynamically allocated memory in bytes.
63 size_t EstimateMemoryUsage() const;
64
62 private: 65 private:
63 // A struct holding a frame producer and its associated stream. 66 // A struct holding a frame producer and its associated stream.
64 struct PendingWrite { 67 struct PendingWrite {
65 SpdyFrameType frame_type; 68 SpdyFrameType frame_type;
66 std::unique_ptr<SpdyBufferProducer> frame_producer; 69 std::unique_ptr<SpdyBufferProducer> frame_producer;
67 base::WeakPtr<SpdyStream> stream; 70 base::WeakPtr<SpdyStream> stream;
68 // Whether |stream| was non-NULL when enqueued. 71 // Whether |stream| was non-NULL when enqueued.
69 bool has_stream; 72 bool has_stream;
70 73
71 PendingWrite(); 74 PendingWrite();
(...skipping 11 matching lines...) Expand all
83 86
84 // The actual write queue, binned by priority. 87 // The actual write queue, binned by priority.
85 std::deque<PendingWrite> queue_[NUM_PRIORITIES]; 88 std::deque<PendingWrite> queue_[NUM_PRIORITIES];
86 89
87 DISALLOW_COPY_AND_ASSIGN(SpdyWriteQueue); 90 DISALLOW_COPY_AND_ASSIGN(SpdyWriteQueue);
88 }; 91 };
89 92
90 } // namespace net 93 } // namespace net
91 94
92 #endif // NET_SPDY_SPDY_WRITE_QUEUE_H_ 95 #endif // NET_SPDY_SPDY_WRITE_QUEUE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698