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

Side by Side Diff: net/http2/tools/random_util.h

Issue 2606733004: Add HpackDecoderTables, static and dynamic tables for decoding HPACK. (Closed)
Patch Set: Remove NET_EXPORT from files in the test build target. Created 3 years, 11 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef NET_HTTP2_TOOLS_RANDOM_UTIL_H_
6 #define NET_HTTP2_TOOLS_RANDOM_UTIL_H_
7
8 #include <stddef.h>
9
10 #include <string>
11
12 #include "base/strings/string_piece.h"
13
14 namespace net {
15 namespace test {
16
17 class RandomBase;
18
19 // Returns a random string of length |len|, each character drawn uniformly and
20 // independently fom |alphabet|.
21 std::string RandomString(RandomBase* rng, int len, base::StringPiece alphabet);
22
23 // Returns a random integer in the range [lo, hi).
24 size_t GenerateUniformInRange(size_t lo, size_t hi, RandomBase* rng);
25
26 // Generate a string with the allowed character set for HTTP/2 / HPACK header
27 // names.
28 std::string GenerateHttp2HeaderName(size_t len, RandomBase* rng);
29
30 // Generate a string with the web-safe string character set of specified len.
31 std::string GenerateWebSafeString(size_t len, RandomBase* rng);
32
33 // Generate a string with the web-safe string character set of length [lo, hi).
34 std::string GenerateWebSafeString(size_t lo, size_t hi, RandomBase* rng);
35
36 } // namespace test
37 } // namespace net
38
39 #endif // NET_HTTP2_TOOLS_RANDOM_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698