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

Unified Diff: runtime/lib/math.cc

Issue 200483003: - Do not rely on time to seed the default PRNG. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 9 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 | « no previous file | runtime/lib/math_patch.dart » ('j') | runtime/lib/math_patch.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/math.cc
===================================================================
--- runtime/lib/math.cc (revision 33702)
+++ runtime/lib/math.cc (working copy)
@@ -178,4 +178,12 @@
return Object::null();
}
+
+DEFINE_NATIVE_ENTRY(Random_initialSeed, 0) {
+ Random* rnd = isolate->random();
+ int64_t seed = rnd->NextUInt32();
+ seed |= (static_cast<int64_t>(rnd->NextUInt32())) << 32;
siva 2014/03/14 17:27:13 I would prefer seed |= (static_cast<int64_t>(rnd-
+ return Integer::New(seed);
+}
+
} // namespace dart
« no previous file with comments | « no previous file | runtime/lib/math_patch.dart » ('j') | runtime/lib/math_patch.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698