Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 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/http2_priority_dependencies.h" | 5 #include "net/spdy/http2_priority_dependencies.h" |
| 6 #include "base/trace_event/memory_usage_estimator.h" | |
| 6 | 7 |
| 7 namespace net { | 8 namespace net { |
| 8 | 9 |
| 9 Http2PriorityDependencies::Http2PriorityDependencies() {} | 10 Http2PriorityDependencies::Http2PriorityDependencies() {} |
| 10 | 11 |
| 11 Http2PriorityDependencies::~Http2PriorityDependencies() {} | 12 Http2PriorityDependencies::~Http2PriorityDependencies() {} |
| 12 | 13 |
| 13 void Http2PriorityDependencies::OnStreamCreation( | 14 void Http2PriorityDependencies::OnStreamCreation( |
| 14 SpdyStreamId id, | 15 SpdyStreamId id, |
| 15 SpdyPriority priority, | 16 SpdyPriority priority, |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 150 | 151 |
| 151 void Http2PriorityDependencies::OnStreamDestruction(SpdyStreamId id) { | 152 void Http2PriorityDependencies::OnStreamDestruction(SpdyStreamId id) { |
| 152 EntryMap::iterator emit = entry_by_stream_id_.find(id); | 153 EntryMap::iterator emit = entry_by_stream_id_.find(id); |
| 153 DCHECK(emit != entry_by_stream_id_.end()); | 154 DCHECK(emit != entry_by_stream_id_.end()); |
| 154 | 155 |
| 155 IdList::iterator it = emit->second; | 156 IdList::iterator it = emit->second; |
| 156 id_priority_lists_[it->second].erase(it); | 157 id_priority_lists_[it->second].erase(it); |
| 157 entry_by_stream_id_.erase(emit); | 158 entry_by_stream_id_.erase(emit); |
| 158 } | 159 } |
| 159 | 160 |
| 161 size_t Http2PriorityDependencies::EstimateMemoryUsage() const { | |
| 162 return base::trace_event::EstimateMemoryUsage(id_priority_lists_); | |
| 163 // TODO(xunjieli): https://crbug.com/669108. Include |entry_by_stream_id_| | |
| 164 // when memory_usage_estimator.h supports std::list::iterator. | |
|
DmitrySkiba
2017/02/06 18:02:34
Nice catch! I'll implement EMUs for iterators (I w
xunjieli
2017/02/08 15:42:50
Acknowledged. Thanks! I will file 690015 to keep t
| |
| 165 } | |
| 166 | |
| 160 } // namespace net | 167 } // namespace net |
| OLD | NEW |