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

Side by Side Diff: net/spdy/spdy_session_key.cc

Issue 2665283003: Improve memory estimate of SpdySessionPool in net/ MemoryDumpProvider. (Closed)
Patch Set: address bnc 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 #include "net/spdy/spdy_session_key.h" 5 #include "net/spdy/spdy_session_key.h"
6 6
7 #include <tuple> 7 #include <tuple>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/trace_event/memory_usage_estimator.h"
11 #include "net/base/host_port_pair.h"
10 12
11 namespace net { 13 namespace net {
12 14
13 SpdySessionKey::SpdySessionKey() : privacy_mode_(PRIVACY_MODE_DISABLED) { 15 SpdySessionKey::SpdySessionKey() : privacy_mode_(PRIVACY_MODE_DISABLED) {
14 } 16 }
15 17
16 SpdySessionKey::SpdySessionKey(const HostPortPair& host_port_pair, 18 SpdySessionKey::SpdySessionKey(const HostPortPair& host_port_pair,
17 const ProxyServer& proxy_server, 19 const ProxyServer& proxy_server,
18 PrivacyMode privacy_mode) 20 PrivacyMode privacy_mode)
19 : host_port_proxy_pair_(host_port_pair, proxy_server), 21 : host_port_proxy_pair_(host_port_pair, proxy_server),
(...skipping 22 matching lines...) Expand all
42 std::tie(other.privacy_mode_, other.host_port_proxy_pair_.first, 44 std::tie(other.privacy_mode_, other.host_port_proxy_pair_.first,
43 other.host_port_proxy_pair_.second); 45 other.host_port_proxy_pair_.second);
44 } 46 }
45 47
46 bool SpdySessionKey::Equals(const SpdySessionKey& other) const { 48 bool SpdySessionKey::Equals(const SpdySessionKey& other) const {
47 return privacy_mode_ == other.privacy_mode_ && 49 return privacy_mode_ == other.privacy_mode_ &&
48 host_port_proxy_pair_.first.Equals(other.host_port_proxy_pair_.first) && 50 host_port_proxy_pair_.first.Equals(other.host_port_proxy_pair_.first) &&
49 host_port_proxy_pair_.second == other.host_port_proxy_pair_.second; 51 host_port_proxy_pair_.second == other.host_port_proxy_pair_.second;
50 } 52 }
51 53
54 size_t SpdySessionKey::EstimateMemoryUsage() const {
55 return HostPortPair::EstimateMemoryUsage(host_port_proxy_pair_.first) +
DmitrySkiba 2017/02/02 18:16:27 Why EMU() is not an instance method in HostPortPai
xunjieli 2017/02/03 22:25:10 Done.
56 base::trace_event::EstimateMemoryUsage(host_port_proxy_pair_.second);
57 }
58
52 } // namespace net 59 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698