Chromium Code Reviews| 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/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
| 12 #include "base/trace_event/memory_usage_estimator.h" | |
| 12 | 13 |
| 13 namespace net { | 14 namespace net { |
| 14 | 15 |
| 15 namespace { | 16 namespace { |
| 16 | 17 |
| 17 // GOAWAY frame debug data is only buffered up to this many bytes. | 18 // GOAWAY frame debug data is only buffered up to this many bytes. |
| 18 size_t kGoAwayDebugDataMaxSize = 1024; | 19 size_t kGoAwayDebugDataMaxSize = 1024; |
| 19 | 20 |
| 20 } // namespace | 21 } // namespace |
| 21 | 22 |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 327 int weight, | 328 int weight, |
| 328 bool exclusive) const { | 329 bool exclusive) const { |
| 329 SpdyPriorityIR priority_ir(stream_id, dependency_id, weight, exclusive); | 330 SpdyPriorityIR priority_ir(stream_id, dependency_id, weight, exclusive); |
| 330 return new SpdySerializedFrame(spdy_framer_.SerializePriority(priority_ir)); | 331 return new SpdySerializedFrame(spdy_framer_.SerializePriority(priority_ir)); |
| 331 } | 332 } |
| 332 | 333 |
| 333 SpdyPriority BufferedSpdyFramer::GetHighestPriority() const { | 334 SpdyPriority BufferedSpdyFramer::GetHighestPriority() const { |
| 334 return spdy_framer_.GetHighestPriority(); | 335 return spdy_framer_.GetHighestPriority(); |
| 335 } | 336 } |
| 336 | 337 |
| 338 size_t BufferedSpdyFramer::EstimateMemoryUsage() const { | |
| 339 return base::trace_event::EstimateMemoryUsage(spdy_framer_) + | |
| 340 base::trace_event::EstimateMemoryUsage(header_buffer_) + | |
| 341 base::trace_event::EstimateMemoryUsage(coalescer_); | |
|
DmitrySkiba
2017/02/02 18:16:27
I would also add control_frame_fields_ and goaway
xunjieli
2017/02/03 22:25:09
Done for goaway_fields_. ControlFrameFields do not
| |
| 342 } | |
| 343 | |
| 337 void BufferedSpdyFramer::InitHeaderStreaming(SpdyStreamId stream_id) { | 344 void BufferedSpdyFramer::InitHeaderStreaming(SpdyStreamId stream_id) { |
| 338 header_buffer_.clear(); | 345 header_buffer_.clear(); |
| 339 header_buffer_valid_ = true; | 346 header_buffer_valid_ = true; |
| 340 header_stream_id_ = stream_id; | 347 header_stream_id_ = stream_id; |
| 341 DCHECK_NE(header_stream_id_, SpdyFramer::kInvalidStream); | 348 DCHECK_NE(header_stream_id_, SpdyFramer::kInvalidStream); |
| 342 } | 349 } |
| 343 | 350 |
| 344 } // namespace net | 351 } // namespace net |
| OLD | NEW |