Reviewed by Darin Adler.
authorzimmermann@webkit.org <zimmermann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Dec 2008 21:15:22 +0000 (21:15 +0000)
committerzimmermann@webkit.org <zimmermann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Dec 2008 21:15:22 +0000 (21:15 +0000)
commit36eb181f7e8cc2aa6d37e5f97e9806bec8b47a99
treef8b18a736de85281200e13be8cc2ee1f015a94de
parent06360b4af38a8d638a53a520d8edb223e59a7c5e
Reviewed by Darin Adler.

Fixes: https://bugs.webkit.org/show_bug.cgi?id=22876

Unify random number generation in JavaScriptCore & WebCore, by introducing
wtf/RandomNumber.h and moving wtf_random/wtf_random_init out of MathExtras.h.

wtf_random_init() has been renamed to initializeRandomNumberGenerator() and
lives in it's own private header: wtf/RandomNumberSeed.h, only intended to
be used from within JavaScriptCore.

wtf_random() has been renamed to randomNumber() and lives in a public header
wtf/RandomNumber.h, usable from within JavaScriptCore & WebCore. It encapsulates
the code taking care of initializing the random number generator (only when
building without ENABLE(JSC_MULTIPLE_THREADS), otherwhise initializeThreading()
already took care of that).

Functional change on darwin: Use random() instead of rand(), as it got a larger
period (more randomness). HTMLFormElement already contains this implementation
and I just moved it in randomNumber(), as  special case for PLATFORM(DARWIN).

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@39337 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
JavaScriptCore/ChangeLog
JavaScriptCore/GNUmakefile.am
JavaScriptCore/JavaScriptCore.exp
JavaScriptCore/JavaScriptCore.pri
JavaScriptCore/JavaScriptCore.scons
JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj
JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
JavaScriptCore/JavaScriptCoreSources.bkl
JavaScriptCore/runtime/MathObject.cpp
JavaScriptCore/wtf/MathExtras.h
JavaScriptCore/wtf/RandomNumber.cpp [new file with mode: 0644]
JavaScriptCore/wtf/RandomNumber.h [new file with mode: 0644]
JavaScriptCore/wtf/RandomNumberSeed.h [new file with mode: 0644]
JavaScriptCore/wtf/ThreadingGtk.cpp
JavaScriptCore/wtf/ThreadingPthreads.cpp
JavaScriptCore/wtf/ThreadingQt.cpp
JavaScriptCore/wtf/ThreadingWin.cpp
WebCore/ChangeLog
WebCore/ForwardingHeaders/wtf/RandomNumber.h [new file with mode: 0644]
WebCore/html/HTMLFormElement.cpp