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 |