Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1546)

Unified Diff: net/spdy/hpack/hpack_huffman_decoder.h

Issue 2832973003: Split net/spdy into core and chromium subdirectories. (Closed)
Patch Set: Fix some more build rules. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/spdy/hpack/hpack_header_table_test.cc ('k') | net/spdy/hpack/hpack_huffman_decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/hpack/hpack_huffman_decoder.h
diff --git a/net/spdy/hpack/hpack_huffman_decoder.h b/net/spdy/hpack/hpack_huffman_decoder.h
deleted file mode 100644
index 802701419ff4bdc831b9d91eaedd67531a3945d8..0000000000000000000000000000000000000000
--- a/net/spdy/hpack/hpack_huffman_decoder.h
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef NET_SPDY_HPACK_HPACK_HUFFMAN_DECODER_H_
-#define NET_SPDY_HPACK_HPACK_HUFFMAN_DECODER_H_
-
-#include <stddef.h>
-#include <stdint.h>
-
-#include "net/base/net_export.h"
-#include "net/spdy/hpack/hpack_input_stream.h"
-#include "net/spdy/platform/api/spdy_string.h"
-
-namespace net {
-namespace test {
-class HpackHuffmanDecoderPeer;
-} // namespace test
-
-// Declared as a class to simplify testing.
-// No instances are actually allocated.
-class NET_EXPORT_PRIVATE HpackHuffmanDecoder {
- public:
- typedef uint32_t HuffmanWord;
- typedef size_t HuffmanCodeLength;
-
- HpackHuffmanDecoder() = delete;
-
- // Decodes a string that has been encoded using the HPACK Huffman Code (see
- // https://httpwg.github.io/specs/rfc7541.html#huffman.code), reading the
- // encoded bitstream from |*in|, appending each decoded char to |*out|.
- // To avoid repeatedly growing the |*out| string, the caller should reserve
- // sufficient space in |*out| to hold decoded output.
- // DecodeString() halts when |in| runs out of input, in which case true is
- // returned. It also halts (returning false) if an invalid Huffman code
- // prefix is read.
- static bool DecodeString(HpackInputStream* in, SpdyString* out);
-
- private:
- friend class test::HpackHuffmanDecoderPeer;
-
- // The following private methods are declared here rather than simply
- // inlined into DecodeString so that they can be tested directly.
-
- // Returns the length (in bits) of the HPACK Huffman code that starts with
- // the high bits of |value|.
- static HuffmanCodeLength CodeLengthOfPrefix(HuffmanWord value);
-
- // Decodes the code in the high |code_length| bits of |bits| to the
- // corresponding canonical symbol.
- // Returns a value in the range [0, 256] (257 values). 256 is the EOS symbol,
- // which must not be explicitly encoded; the HPACK spec says that a decoder
- // must treat EOS as a decoding error.
- // Note that the canonical symbol is not the final value to be output because
- // the source symbols are not in descending probability order, so another
- // translation is required (see CanonicalToSource below).
- static HuffmanWord DecodeToCanonical(HuffmanCodeLength code_length,
- HuffmanWord bits);
-
- // Converts a canonical symbol to the source symbol (the char in the original
- // string that was encoded).
- static char CanonicalToSource(HuffmanWord canonical);
-};
-
-} // namespace net
-
-#endif // NET_SPDY_HPACK_HPACK_HUFFMAN_DECODER_H_
« no previous file with comments | « net/spdy/hpack/hpack_header_table_test.cc ('k') | net/spdy/hpack/hpack_huffman_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698