| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/hpack/hpack_huffman_table.h" | 5 #include "net/spdy/core/hpack/hpack_huffman_table.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/numerics/safe_conversions.h" | 12 #include "base/numerics/safe_conversions.h" |
| 13 #include "net/spdy/hpack/hpack_input_stream.h" | 13 #include "net/spdy/core/hpack/hpack_input_stream.h" |
| 14 #include "net/spdy/hpack/hpack_output_stream.h" | 14 #include "net/spdy/core/hpack/hpack_output_stream.h" |
| 15 #include "net/spdy/platform/api/spdy_estimate_memory_usage.h" | 15 #include "net/spdy/platform/api/spdy_estimate_memory_usage.h" |
| 16 | 16 |
| 17 namespace net { | 17 namespace net { |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 // How many bits to index in the root decode table. | 21 // How many bits to index in the root decode table. |
| 22 const uint8_t kDecodeTableRootBits = 9; | 22 const uint8_t kDecodeTableRootBits = 9; |
| 23 // Maximum number of bits to index in successive decode tables. | 23 // Maximum number of bits to index in successive decode tables. |
| 24 const uint8_t kDecodeTableBranchBits = 6; | 24 const uint8_t kDecodeTableBranchBits = 6; |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 } | 317 } |
| 318 | 318 |
| 319 size_t HpackHuffmanTable::EstimateMemoryUsage() const { | 319 size_t HpackHuffmanTable::EstimateMemoryUsage() const { |
| 320 return SpdyEstimateMemoryUsage(decode_tables_) + | 320 return SpdyEstimateMemoryUsage(decode_tables_) + |
| 321 SpdyEstimateMemoryUsage(decode_entries_) + | 321 SpdyEstimateMemoryUsage(decode_entries_) + |
| 322 SpdyEstimateMemoryUsage(code_by_id_) + | 322 SpdyEstimateMemoryUsage(code_by_id_) + |
| 323 SpdyEstimateMemoryUsage(length_by_id_); | 323 SpdyEstimateMemoryUsage(length_by_id_); |
| 324 } | 324 } |
| 325 | 325 |
| 326 } // namespace net | 326 } // namespace net |
| OLD | NEW |