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_encoder.h" | 5 #include "net/spdy/core/hpack/hpack_encoder.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
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 "net/spdy/hpack/hpack_constants.h" | 12 #include "net/spdy/core/hpack/hpack_constants.h" |
13 #include "net/spdy/hpack/hpack_header_table.h" | 13 #include "net/spdy/core/hpack/hpack_header_table.h" |
14 #include "net/spdy/hpack/hpack_huffman_table.h" | 14 #include "net/spdy/core/hpack/hpack_huffman_table.h" |
15 #include "net/spdy/hpack/hpack_output_stream.h" | 15 #include "net/spdy/core/hpack/hpack_output_stream.h" |
16 #include "net/spdy/platform/api/spdy_estimate_memory_usage.h" | 16 #include "net/spdy/platform/api/spdy_estimate_memory_usage.h" |
17 | 17 |
18 namespace net { | 18 namespace net { |
19 | 19 |
20 class HpackEncoder::RepresentationIterator { | 20 class HpackEncoder::RepresentationIterator { |
21 public: | 21 public: |
22 // |pseudo_headers| and |regular_headers| must outlive the iterator. | 22 // |pseudo_headers| and |regular_headers| must outlive the iterator. |
23 RepresentationIterator(const Representations& pseudo_headers, | 23 RepresentationIterator(const Representations& pseudo_headers, |
24 const Representations& regular_headers) | 24 const Representations& regular_headers) |
25 : pseudo_begin_(pseudo_headers.begin()), | 25 : pseudo_begin_(pseudo_headers.begin()), |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 has_next_ = encoder_->output_stream_.size() > max_encoded_bytes; | 362 has_next_ = encoder_->output_stream_.size() > max_encoded_bytes; |
363 encoder_->output_stream_.BoundedTakeString(max_encoded_bytes, output); | 363 encoder_->output_stream_.BoundedTakeString(max_encoded_bytes, output); |
364 } | 364 } |
365 | 365 |
366 std::unique_ptr<HpackEncoder::ProgressiveEncoder> HpackEncoder::EncodeHeaderSet( | 366 std::unique_ptr<HpackEncoder::ProgressiveEncoder> HpackEncoder::EncodeHeaderSet( |
367 const SpdyHeaderBlock& header_set) { | 367 const SpdyHeaderBlock& header_set) { |
368 return base::MakeUnique<Encoderator>(header_set, this); | 368 return base::MakeUnique<Encoderator>(header_set, this); |
369 } | 369 } |
370 | 370 |
371 } // namespace net | 371 } // namespace net |
OLD | NEW |