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

Side by Side Diff: net/spdy/hpack/hpack_output_stream.cc

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/spdy/hpack/hpack_output_stream.h ('k') | net/spdy/hpack/hpack_static_table.h » ('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 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 #include "net/spdy/hpack/hpack_output_stream.h" 5 #include "net/spdy/hpack/hpack_output_stream.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "net/spdy/platform/api/spdy_estimate_memory_usage.h"
10 11
11 namespace net { 12 namespace net {
12 13
13 using base::StringPiece; 14 using base::StringPiece;
14 using std::string; 15 using std::string;
15 16
16 HpackOutputStream::HpackOutputStream() : bit_offset_(0) {} 17 HpackOutputStream::HpackOutputStream() : bit_offset_(0) {}
17 18
18 HpackOutputStream::~HpackOutputStream() {} 19 HpackOutputStream::~HpackOutputStream() {}
19 20
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 // Give buffer to output string. 86 // Give buffer to output string.
86 *output = std::move(buffer_); 87 *output = std::move(buffer_);
87 88
88 // Reset to contain overflow. 89 // Reset to contain overflow.
89 buffer_ = std::move(overflow); 90 buffer_ = std::move(overflow);
90 } else { 91 } else {
91 TakeString(output); 92 TakeString(output);
92 } 93 }
93 } 94 }
94 95
96 size_t HpackOutputStream::EstimateMemoryUsage() const {
97 return SpdyEstimateMemoryUsage(buffer_);
98 }
99
95 } // namespace net 100 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/hpack/hpack_output_stream.h ('k') | net/spdy/hpack/hpack_static_table.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698