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

Side by Side Diff: net/spdy/header_coalescer.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/header_coalescer.h ('k') | net/spdy/hpack/hpack_decoder.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 (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 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/header_coalescer.h" 5 #include "net/spdy/header_coalescer.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "net/spdy/platform/api/spdy_estimate_memory_usage.h"
10 11
11 namespace net { 12 namespace net {
12 13
13 const size_t kMaxHeaderListSize = 256 * 1024; 14 const size_t kMaxHeaderListSize = 256 * 1024;
14 15
15 void HeaderCoalescer::OnHeader(base::StringPiece key, base::StringPiece value) { 16 void HeaderCoalescer::OnHeader(base::StringPiece key, base::StringPiece value) {
16 if (error_seen_) { 17 if (error_seen_) {
17 return; 18 return;
18 } 19 }
19 20
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 headers_[key] = s; 64 headers_[key] = s;
64 } 65 }
65 } 66 }
66 67
67 SpdyHeaderBlock HeaderCoalescer::release_headers() { 68 SpdyHeaderBlock HeaderCoalescer::release_headers() {
68 DCHECK(headers_valid_); 69 DCHECK(headers_valid_);
69 headers_valid_ = false; 70 headers_valid_ = false;
70 return std::move(headers_); 71 return std::move(headers_);
71 } 72 }
72 73
74 size_t HeaderCoalescer::EstimateMemoryUsage() const {
75 return SpdyEstimateMemoryUsage(headers_);
76 }
77
73 } // namespace net 78 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/header_coalescer.h ('k') | net/spdy/hpack/hpack_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698