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

Side by Side Diff: net/http2/tools/http2_random.cc

Issue 2606733004: Add HpackDecoderTables, static and dynamic tables for decoding HPACK. (Closed)
Patch Set: Rebase. 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
« no previous file with comments | « net/http2/tools/http2_random.h ('k') | net/http2/tools/random_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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/http2/tools/http2_random.h" 5 #include "net/http2/tools/http2_random.h"
6 6
7 #include <limits>
8 #include <memory> 7 #include <memory>
9 8
10 #include "base/rand_util.h" 9 #include "base/rand_util.h"
11 10
12 namespace net { 11 namespace net {
13 namespace test { 12 namespace test {
14 13
15 bool Http2Random::OneIn(int n) { 14 bool Http2Random::OneIn(int n) {
16 return base::RandGenerator(n) == 0; 15 return base::RandGenerator(n) == 0;
17 } 16 }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 } 49 }
51 50
52 std::string Http2Random::RandString(int length) { 51 std::string Http2Random::RandString(int length) {
53 std::unique_ptr<char[]> buffer(new char[length]); 52 std::unique_ptr<char[]> buffer(new char[length]);
54 base::RandBytes(buffer.get(), length); 53 base::RandBytes(buffer.get(), length);
55 return std::string(buffer.get(), length); 54 return std::string(buffer.get(), length);
56 } 55 }
57 56
58 } // namespace test 57 } // namespace test
59 } // namespace net 58 } // namespace net
OLDNEW
« no previous file with comments | « net/http2/tools/http2_random.h ('k') | net/http2/tools/random_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698