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

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

Issue 2665283003: Improve memory estimate of SpdySessionPool in net/ MemoryDumpProvider. (Closed)
Patch Set: Address Bence 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 (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_SPDY_HEADER_BLOCK_H_ 5 #ifndef NET_SPDY_SPDY_HEADER_BLOCK_H_
6 #define NET_SPDY_SPDY_HEADER_BLOCK_H_ 6 #define NET_SPDY_SPDY_HEADER_BLOCK_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <list> 10 #include <list>
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 SpdyHeaderBlock::MapType::iterator lookup_result, 211 SpdyHeaderBlock::MapType::iterator lookup_result,
212 const base::StringPiece key); 212 const base::StringPiece key);
213 213
214 SpdyHeaderBlock::MapType* block_; 214 SpdyHeaderBlock::MapType* block_;
215 SpdyHeaderBlock::Storage* storage_; 215 SpdyHeaderBlock::Storage* storage_;
216 SpdyHeaderBlock::MapType::iterator lookup_result_; 216 SpdyHeaderBlock::MapType::iterator lookup_result_;
217 base::StringPiece key_; 217 base::StringPiece key_;
218 bool valid_; 218 bool valid_;
219 }; 219 };
220 220
221 // Returns the estimate of dynamically allocated memory in bytes.
222 size_t EstimateMemoryUsage() const;
223
221 private: 224 private:
222 friend class test::SpdyHeaderBlockPeer; 225 friend class test::SpdyHeaderBlockPeer;
223 226
224 void AppendHeader(const base::StringPiece key, const base::StringPiece value); 227 void AppendHeader(const base::StringPiece key, const base::StringPiece value);
225 Storage* GetStorage(); 228 Storage* GetStorage();
226 size_t bytes_allocated() const; 229 size_t bytes_allocated() const;
227 230
228 // StringPieces held by |block_| point to memory owned by |*storage_|. 231 // StringPieces held by |block_| point to memory owned by |*storage_|.
229 // |storage_| might be nullptr as long as |block_| is empty. 232 // |storage_| might be nullptr as long as |block_| is empty.
230 MapType block_; 233 MapType block_;
(...skipping 15 matching lines...) Expand all
246 // to |headers|. |event_param| must have been created by 249 // to |headers|. |event_param| must have been created by
247 // SpdyHeaderBlockNetLogCallback. On failure, returns false and clears 250 // SpdyHeaderBlockNetLogCallback. On failure, returns false and clears
248 // |headers|. 251 // |headers|.
249 NET_EXPORT bool SpdyHeaderBlockFromNetLogParam( 252 NET_EXPORT bool SpdyHeaderBlockFromNetLogParam(
250 const base::Value* event_param, 253 const base::Value* event_param,
251 SpdyHeaderBlock* headers); 254 SpdyHeaderBlock* headers);
252 255
253 } // namespace net 256 } // namespace net
254 257
255 #endif // NET_SPDY_SPDY_HEADER_BLOCK_H_ 258 #endif // NET_SPDY_SPDY_HEADER_BLOCK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698