Changeset 69124 in webkit
- Timestamp:
- Oct 5, 2010 10:34:25 AM (14 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r69096 r69124 1 2010-10-05 Kwang Yul Seo <skyul@company100.net> 2 3 Reviewed by Kent Tamura. 4 5 [BREWMP] Use PlatformRefPtr in randomNumber 6 https://bugs.webkit.org/show_bug.cgi?id=46989 7 8 Use PlatformRefPtr to free memory automatically. 9 10 * wtf/RandomNumber.cpp: 11 (WTF::randomNumber): 12 1 13 2010-10-05 Oliver Hunt <oliver@apple.com> 2 14 -
trunk/JavaScriptCore/wtf/RandomNumber.cpp
r60945 r69124 45 45 #include <AEESource.h> 46 46 #include <AEEStdLib.h> 47 #include <wtf/brew/RefPtrBrew.h> 48 #include <wtf/brew/ShellBrew.h> 47 49 #endif 48 50 … … 98 100 #elif PLATFORM(BREWMP) 99 101 uint32_t bits; 100 ISource* randomSource; 101 102 IShell* shell = reinterpret_cast<AEEApplet*>(GETAPPINSTANCE())->m_pIShell; 103 ISHELL_CreateInstance(shell, AEECLSID_RANDOM, reinterpret_cast<void**>(&randomSource)); 104 ISOURCE_Read(randomSource, reinterpret_cast<char*>(&bits), 4); 105 ISOURCE_Release(randomSource); 102 PlatformRefPtr<ISource> randomSource = createRefPtrInstance<ISource>(AEECLSID_RANDOM); 103 ISOURCE_Read(randomSource.get(), reinterpret_cast<char*>(&bits), 4); 106 104 107 105 return static_cast<double>(bits) / (static_cast<double>(std::numeric_limits<uint32_t>::max()) + 1.0);
Note: See TracChangeset
for help on using the changeset viewer.