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

Unified Diff: ppapi/shared_impl/crypto_impl.cc

Issue 6873156: Move crypto_helpers from sync to base (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Follow bbretw review Created 9 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 | « chrome/common/random_unittest.cc ('k') | webkit/glue/webkitclient_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/crypto_impl.cc
diff --git a/ppapi/shared_impl/crypto_impl.cc b/ppapi/shared_impl/crypto_impl.cc
index 6295bb2274138a588463ecf87ed0ce0f513440be..f8e4aa27e68e48a3bf2da31b9d8811f78d859954 100644
--- a/ppapi/shared_impl/crypto_impl.cc
+++ b/ppapi/shared_impl/crypto_impl.cc
@@ -11,14 +11,7 @@ namespace shared_impl {
// static
void CryptoImpl::GetRandomBytes(char* buffer, uint32_t num_bytes) {
- // Note: this is a copy of WebKitClientImpl::cryptographicallyRandomValues.
- uint64 bytes = 0;
- for (uint32_t i = 0; i < num_bytes; ++i) {
- uint32_t offset = i % sizeof(bytes);
- if (!offset)
- bytes = base::RandUint64();
- buffer[i] = reinterpret_cast<char*>(&bytes)[offset];
- }
+ base::RandBytes(buffer, num_bytes);
}
} // namespace shared_impl
« no previous file with comments | « chrome/common/random_unittest.cc ('k') | webkit/glue/webkitclient_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698