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

Side by Side Diff: net/quic/test_tools/mock_random.cc

Issue 399313006: Move bit_cast from base/macros.h to its own header (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix chromeos compile after r368203 Created 4 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 | Annotate | Revision Log
« no previous file with comments | « net/filter/sdch_filter_unittest.cc ('k') | pdf/out_of_process_instance.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/quic/test_tools/mock_random.h" 5 #include "net/quic/test_tools/mock_random.h"
6 6
7 #include <string.h>
8
7 namespace net { 9 namespace net {
8 namespace test { 10 namespace test {
9 11
10 MockRandom::MockRandom() : base_(0xDEADBEEF), increment_(0) {} 12 MockRandom::MockRandom() : base_(0xDEADBEEF), increment_(0) {}
11 13
12 MockRandom::MockRandom(uint32_t base) : base_(base), increment_(0) {} 14 MockRandom::MockRandom(uint32_t base) : base_(base), increment_(0) {}
13 15
14 void MockRandom::RandBytes(void* data, size_t len) { 16 void MockRandom::RandBytes(void* data, size_t len) {
15 memset(data, 'r' + increment_, len); 17 memset(data, 'r' + increment_, len);
16 } 18 }
17 19
18 uint64_t MockRandom::RandUint64() { 20 uint64_t MockRandom::RandUint64() {
19 return base_ + increment_; 21 return base_ + increment_;
20 } 22 }
21 23
22 void MockRandom::Reseed(const void* additional_entropy, size_t entropy_len) {} 24 void MockRandom::Reseed(const void* additional_entropy, size_t entropy_len) {}
23 25
24 void MockRandom::ChangeValue() { 26 void MockRandom::ChangeValue() {
25 increment_++; 27 increment_++;
26 } 28 }
27 29
28 } // namespace test 30 } // namespace test
29 } // namespace net 31 } // namespace net
OLDNEW
« no previous file with comments | « net/filter/sdch_filter_unittest.cc ('k') | pdf/out_of_process_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698