Ignore:
Timestamp:
Oct 31, 2014, 5:26:36 PM (11 years ago)
Author:
[email protected]
Message:

Use std::unique_ptr for TypeCountSet
https://bugs.webkit.org/show_bug.cgi?id=138242

Reviewed by Andreas Kling.

Source/JavaScriptCore:

  • heap/Heap.cpp:

(JSC::Heap::protectedObjectTypeCounts):
Use std::unique_ptr<> instead of PassOwnPtr|OwnPtr.
(JSC::Heap::objectTypeCounts): ditto.

  • heap/Heap.h:

Source/WebKit/mac:

  • Misc/WebCoreStatistics.mm:

(+[WebCoreStatistics javaScriptProtectedObjectTypeCounts]): Use std::unique_ptr<> instead of OwnPtr.
(+[WebCoreStatistics javaScriptObjectTypeCounts]): ditto.

Source/WebKit/win:

  • WebCoreStatistics.cpp:

(WebCoreStatistics::javaScriptProtectedObjectTypeCounts): Use std::unique_ptr<> instead of OwnPtr.
(WebCoreStatistics::javaScriptObjectTypeCounts): ditto.

Source/WebKit2:

  • WebProcess/WebProcess.cpp:

(WebKit::WebProcess::getWebCoreStatistics): Use std::unique_ptr<> instead of OwnPtr.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/heap/Heap.cpp

    r174789 r175443  
    255255class RecordType {
    256256public:
    257     typedef PassOwnPtr<TypeCountSet> ReturnType;
     257    typedef std::unique_ptr<TypeCountSet> ReturnType;
    258258
    259259    RecordType();
     
    263263private:
    264264    const char* typeName(JSCell*);
    265     OwnPtr<TypeCountSet> m_typeCountSet;
     265    std::unique_ptr<TypeCountSet> m_typeCountSet;
    266266};
    267267
    268268inline RecordType::RecordType()
    269     : m_typeCountSet(adoptPtr(new TypeCountSet))
     269    : m_typeCountSet(std::make_unique<TypeCountSet>())
    270270{
    271271}
     
    284284}
    285285
    286 inline PassOwnPtr<TypeCountSet> RecordType::returnValue()
    287 {
    288     return m_typeCountSet.release();
     286inline std::unique_ptr<TypeCountSet> RecordType::returnValue()
     287{
     288    return WTF::move(m_typeCountSet);
    289289}
    290290
     
    862862}
    863863
    864 PassOwnPtr<TypeCountSet> Heap::protectedObjectTypeCounts()
     864std::unique_ptr<TypeCountSet> Heap::protectedObjectTypeCounts()
    865865{
    866866    return forEachProtectedCell<RecordType>();
    867867}
    868868
    869 PassOwnPtr<TypeCountSet> Heap::objectTypeCounts()
     869std::unique_ptr<TypeCountSet> Heap::objectTypeCounts()
    870870{
    871871    HeapIterationScope iterationScope(*this);
Note: See TracChangeset for help on using the changeset viewer.