Changeset 69124 in webkit


Ignore:
Timestamp:
Oct 5, 2010 10:34:25 AM (14 years ago)
Author:
commit-queue@webkit.org
Message:

2010-10-05 Kwang Yul Seo <skyul@company100.net>

Reviewed by Kent Tamura.

[BREWMP] Use PlatformRefPtr in randomNumber
https://bugs.webkit.org/show_bug.cgi?id=46989

Use PlatformRefPtr to free memory automatically.

  • wtf/RandomNumber.cpp: (WTF::randomNumber):
Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r69096 r69124  
     12010-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
    1132010-10-05  Oliver Hunt  <oliver@apple.com>
    214
  • trunk/JavaScriptCore/wtf/RandomNumber.cpp

    r60945 r69124  
    4545#include <AEESource.h>
    4646#include <AEEStdLib.h>
     47#include <wtf/brew/RefPtrBrew.h>
     48#include <wtf/brew/ShellBrew.h>
    4749#endif
    4850
     
    98100#elif PLATFORM(BREWMP)
    99101    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);
    106104
    107105    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.