| 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/spdy_framer.h" | 5 #include "net/spdy/spdy_framer.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <ios> | 10 #include <ios> |
| (...skipping 3247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3258 | 3258 |
| 3259 void SpdyFramer::SetEncoderHeaderTableDebugVisitor( | 3259 void SpdyFramer::SetEncoderHeaderTableDebugVisitor( |
| 3260 std::unique_ptr<HpackHeaderTable::DebugVisitorInterface> visitor) { | 3260 std::unique_ptr<HpackHeaderTable::DebugVisitorInterface> visitor) { |
| 3261 GetHpackEncoder()->SetHeaderTableDebugVisitor(std::move(visitor)); | 3261 GetHpackEncoder()->SetHeaderTableDebugVisitor(std::move(visitor)); |
| 3262 } | 3262 } |
| 3263 | 3263 |
| 3264 void SpdyFramer::UpdateHeaderEncoderTableSize(uint32_t value) { | 3264 void SpdyFramer::UpdateHeaderEncoderTableSize(uint32_t value) { |
| 3265 GetHpackEncoder()->ApplyHeaderTableSizeSetting(value); | 3265 GetHpackEncoder()->ApplyHeaderTableSizeSetting(value); |
| 3266 } | 3266 } |
| 3267 | 3267 |
| 3268 void SpdyFramer::UpdateHeaderDecoderTableSize(uint32_t value) { | |
| 3269 GetHpackDecoder()->ApplyHeaderTableSizeSetting(value); | |
| 3270 } | |
| 3271 | |
| 3272 size_t SpdyFramer::header_encoder_table_size() const { | 3268 size_t SpdyFramer::header_encoder_table_size() const { |
| 3273 if (hpack_encoder_ == nullptr) { | 3269 if (hpack_encoder_ == nullptr) { |
| 3274 return kDefaultHeaderTableSizeSetting; | 3270 return kDefaultHeaderTableSizeSetting; |
| 3275 } else { | 3271 } else { |
| 3276 return hpack_encoder_->CurrentHeaderTableSizeSetting(); | 3272 return hpack_encoder_->CurrentHeaderTableSizeSetting(); |
| 3277 } | 3273 } |
| 3278 } | 3274 } |
| 3279 | 3275 |
| 3280 void SpdyFramer::SerializeHeaderBlockWithoutCompression( | 3276 void SpdyFramer::SerializeHeaderBlockWithoutCompression( |
| 3281 SpdyFrameBuilder* builder, | 3277 SpdyFrameBuilder* builder, |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3342 #else | 3338 #else |
| 3343 WriteHeaderBlockToZ(&frame.header_block(), compressor); | 3339 WriteHeaderBlockToZ(&frame.header_block(), compressor); |
| 3344 #endif // defined(USE_SYSTEM_ZLIB) | 3340 #endif // defined(USE_SYSTEM_ZLIB) |
| 3345 | 3341 |
| 3346 int compressed_size = compressed_max_size - compressor->avail_out; | 3342 int compressed_size = compressed_max_size - compressor->avail_out; |
| 3347 builder->Seek(compressed_size); | 3343 builder->Seek(compressed_size); |
| 3348 builder->RewriteLength(*this); | 3344 builder->RewriteLength(*this); |
| 3349 } | 3345 } |
| 3350 | 3346 |
| 3351 } // namespace net | 3347 } // namespace net |
| OLD | NEW |