| OLD | NEW |
| 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/buffered_spdy_framer.h" | 5 #include "net/spdy/buffered_spdy_framer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
| 12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
| 13 #include "net/spdy/platform/api/spdy_estimate_memory_usage.h" |
| 13 | 14 |
| 14 namespace net { | 15 namespace net { |
| 15 | 16 |
| 16 namespace { | 17 namespace { |
| 17 | 18 |
| 18 // GOAWAY frame debug data is only buffered up to this many bytes. | 19 // GOAWAY frame debug data is only buffered up to this many bytes. |
| 19 size_t kGoAwayDebugDataMaxSize = 1024; | 20 size_t kGoAwayDebugDataMaxSize = 1024; |
| 20 | 21 |
| 21 } // namespace | 22 } // namespace |
| 22 | 23 |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 bool exclusive) const { | 300 bool exclusive) const { |
| 300 SpdyPriorityIR priority_ir(stream_id, dependency_id, weight, exclusive); | 301 SpdyPriorityIR priority_ir(stream_id, dependency_id, weight, exclusive); |
| 301 return base::MakeUnique<SpdySerializedFrame>( | 302 return base::MakeUnique<SpdySerializedFrame>( |
| 302 spdy_framer_.SerializePriority(priority_ir)); | 303 spdy_framer_.SerializePriority(priority_ir)); |
| 303 } | 304 } |
| 304 | 305 |
| 305 SpdyPriority BufferedSpdyFramer::GetHighestPriority() const { | 306 SpdyPriority BufferedSpdyFramer::GetHighestPriority() const { |
| 306 return spdy_framer_.GetHighestPriority(); | 307 return spdy_framer_.GetHighestPriority(); |
| 307 } | 308 } |
| 308 | 309 |
| 310 size_t BufferedSpdyFramer::EstimateMemoryUsage() const { |
| 311 return SpdyEstimateMemoryUsage(spdy_framer_) + |
| 312 SpdyEstimateMemoryUsage(coalescer_) + |
| 313 SpdyEstimateMemoryUsage(control_frame_fields_) + |
| 314 SpdyEstimateMemoryUsage(goaway_fields_); |
| 315 } |
| 316 |
| 317 size_t BufferedSpdyFramer::GoAwayFields::EstimateMemoryUsage() const { |
| 318 return SpdyEstimateMemoryUsage(debug_data); |
| 319 } |
| 320 |
| 309 } // namespace net | 321 } // namespace net |
| OLD | NEW |