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

Side by Side Diff: Source/wtf/CryptographicallyRandomNumber.cpp

Issue 14178012: Remove the USE(OS_RANDOMNESS) guard. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 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 unified diff | Download patch
« no previous file with comments | « Source/wtf/CryptographicallyRandomNumber.h ('k') | Source/wtf/OSRandomSource.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 /* 1 /*
2 * Copyright (c) 1996, David Mazieres <dm@uun.org> 2 * Copyright (c) 1996, David Mazieres <dm@uun.org>
3 * Copyright (c) 2008, Damien Miller <djm@openbsd.org> 3 * Copyright (c) 2008, Damien Miller <djm@openbsd.org>
4 * 4 *
5 * Permission to use, copy, modify, and distribute this software for any 5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above 6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies. 7 * copyright notice and this permission notice appear in all copies.
8 * 8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
(...skipping 18 matching lines...) Expand all
29 29
30 #include "config.h" 30 #include "config.h"
31 #include "CryptographicallyRandomNumber.h" 31 #include "CryptographicallyRandomNumber.h"
32 32
33 #include "OSRandomSource.h" 33 #include "OSRandomSource.h"
34 #include "StdLibExtras.h" 34 #include "StdLibExtras.h"
35 #include "ThreadingPrimitives.h" 35 #include "ThreadingPrimitives.h"
36 36
37 namespace WTF { 37 namespace WTF {
38 38
39 #if USE(OS_RANDOMNESS)
40
41 namespace { 39 namespace {
42 40
43 class ARC4Stream { 41 class ARC4Stream {
44 public: 42 public:
45 ARC4Stream(); 43 ARC4Stream();
46 44
47 uint8_t i; 45 uint8_t i;
48 uint8_t j; 46 uint8_t j;
49 uint8_t s[256]; 47 uint8_t s[256];
50 }; 48 };
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 uint32_t cryptographicallyRandomNumber() 167 uint32_t cryptographicallyRandomNumber()
170 { 168 {
171 return sharedRandomNumberGenerator().randomNumber(); 169 return sharedRandomNumberGenerator().randomNumber();
172 } 170 }
173 171
174 void cryptographicallyRandomValues(void* buffer, size_t length) 172 void cryptographicallyRandomValues(void* buffer, size_t length)
175 { 173 {
176 sharedRandomNumberGenerator().randomValues(buffer, length); 174 sharedRandomNumberGenerator().randomValues(buffer, length);
177 } 175 }
178 176
179 #endif
180
181 } 177 }
OLDNEW
« no previous file with comments | « Source/wtf/CryptographicallyRandomNumber.h ('k') | Source/wtf/OSRandomSource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698