Changeset 175443 in webkit


Ignore:
Timestamp:
Oct 31, 2014, 5:26:36 PM (11 years ago)
Author:
gyuyoung.kim@samsung.com
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.

Location:
trunk/Source
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r175426 r175443  
     12014-10-31  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
     2
     3        Use std::unique_ptr for TypeCountSet
     4        https://bugs.webkit.org/show_bug.cgi?id=138242
     5
     6        Reviewed by Andreas Kling.
     7
     8        * heap/Heap.cpp:
     9        (JSC::Heap::protectedObjectTypeCounts):
     10        Use std::unique_ptr<> instead of PassOwnPtr|OwnPtr.
     11        (JSC::Heap::objectTypeCounts): ditto.
     12        * heap/Heap.h:
     13
    1142014-10-31  Michael Saboff  <msaboff@apple.com>
    215
  • 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);
  • trunk/Source/JavaScriptCore/heap/Heap.h

    r174795 r175443  
    172172    JS_EXPORT_PRIVATE size_t protectedObjectCount();
    173173    JS_EXPORT_PRIVATE size_t protectedGlobalObjectCount();
    174     JS_EXPORT_PRIVATE PassOwnPtr<TypeCountSet> protectedObjectTypeCounts();
    175     JS_EXPORT_PRIVATE PassOwnPtr<TypeCountSet> objectTypeCounts();
     174    JS_EXPORT_PRIVATE std::unique_ptr<TypeCountSet> protectedObjectTypeCounts();
     175    JS_EXPORT_PRIVATE std::unique_ptr<TypeCountSet> objectTypeCounts();
    176176    void showStatistics();
    177177
  • trunk/Source/WebKit/mac/ChangeLog

    r175425 r175443  
     12014-10-31  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
     2
     3        Use std::unique_ptr for TypeCountSet
     4        https://bugs.webkit.org/show_bug.cgi?id=138242
     5
     6        Reviewed by Andreas Kling.
     7
     8        * Misc/WebCoreStatistics.mm:
     9        (+[WebCoreStatistics javaScriptProtectedObjectTypeCounts]): Use std::unique_ptr<> instead of OwnPtr.
     10        (+[WebCoreStatistics javaScriptObjectTypeCounts]): ditto.
     11
    1122014-10-31  Beth Dakin  <bdakin@apple.com>
    213
  • trunk/Source/WebKit/mac/Misc/WebCoreStatistics.mm

    r173251 r175443  
    8787    NSCountedSet *result = [NSCountedSet set];
    8888
    89     OwnPtr<TypeCountSet> counts(JSDOMWindow::commonVM().heap.protectedObjectTypeCounts());
     89    std::unique_ptr<TypeCountSet> counts(JSDOMWindow::commonVM().heap.protectedObjectTypeCounts());
    9090    HashCountedSet<const char*>::iterator end = counts->end();
    9191    for (HashCountedSet<const char*>::iterator it = counts->begin(); it != end; ++it)
     
    102102    NSCountedSet *result = [NSCountedSet set];
    103103
    104     OwnPtr<TypeCountSet> counts(JSDOMWindow::commonVM().heap.objectTypeCounts());
     104    std::unique_ptr<TypeCountSet> counts(JSDOMWindow::commonVM().heap.objectTypeCounts());
    105105    HashCountedSet<const char*>::iterator end = counts->end();
    106106    for (HashCountedSet<const char*>::iterator it = counts->begin(); it != end; ++it)
  • trunk/Source/WebKit/win/ChangeLog

    r175406 r175443  
     12014-10-31  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
     2
     3        Use std::unique_ptr for TypeCountSet
     4        https://bugs.webkit.org/show_bug.cgi?id=138242
     5
     6        Reviewed by Andreas Kling.
     7
     8        * WebCoreStatistics.cpp:
     9        (WebCoreStatistics::javaScriptProtectedObjectTypeCounts): Use std::unique_ptr<> instead of OwnPtr.
     10        (WebCoreStatistics::javaScriptObjectTypeCounts): ditto.
     11
    1122014-10-30  Darin Adler  <darin@apple.com>
    213
  • trunk/Source/WebKit/win/WebCoreStatistics.cpp

    r173988 r175443  
    146146{
    147147    JSLockHolder lock(JSDOMWindow::commonVM());
    148     OwnPtr<TypeCountSet> jsObjectTypeNames(JSDOMWindow::commonVM().heap.protectedObjectTypeCounts());
     148    std::unique_ptr<TypeCountSet> jsObjectTypeNames(JSDOMWindow::commonVM().heap.protectedObjectTypeCounts());
    149149    typedef TypeCountSet::const_iterator Iterator;
    150150    Iterator end = jsObjectTypeNames->end();
     
    164164
    165165    JSLockHolder lock(JSDOMWindow::commonVM());
    166     OwnPtr<TypeCountSet> jsObjectTypeNames(JSDOMWindow::commonVM().heap.objectTypeCounts());
     166    std::unique_ptr<TypeCountSet> jsObjectTypeNames(JSDOMWindow::commonVM().heap.objectTypeCounts());
    167167    typedef TypeCountSet::const_iterator Iterator;
    168168    Iterator end = jsObjectTypeNames->end();
  • trunk/Source/WebKit2/ChangeLog

    r175430 r175443  
     12014-10-31  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
     2
     3        Use std::unique_ptr for TypeCountSet
     4        https://bugs.webkit.org/show_bug.cgi?id=138242
     5
     6        Reviewed by Andreas Kling.
     7
     8        * WebProcess/WebProcess.cpp:
     9        (WebKit::WebProcess::getWebCoreStatistics): Use std::unique_ptr<> instead of OwnPtr.
     10
    1112014-10-30  Jer Noble  <jer.noble@apple.com>
    212
  • trunk/Source/WebKit2/WebProcess/WebProcess.cpp

    r175430 r175443  
    901901        data.statisticsNumbers.set(ASCIILiteral("JavaScriptProtectedGlobalObjectsCount"), JSDOMWindow::commonVM().heap.protectedGlobalObjectCount());
    902902       
    903         OwnPtr<TypeCountSet> protectedObjectTypeCounts(JSDOMWindow::commonVM().heap.protectedObjectTypeCounts());
     903        std::unique_ptr<TypeCountSet> protectedObjectTypeCounts(JSDOMWindow::commonVM().heap.protectedObjectTypeCounts());
    904904        fromCountedSetToHashMap(protectedObjectTypeCounts.get(), data.javaScriptProtectedObjectTypeCounts);
    905905       
    906         OwnPtr<TypeCountSet> objectTypeCounts(JSDOMWindow::commonVM().heap.objectTypeCounts());
     906        std::unique_ptr<TypeCountSet> objectTypeCounts(JSDOMWindow::commonVM().heap.objectTypeCounts());
    907907        fromCountedSetToHashMap(objectTypeCounts.get(), data.javaScriptObjectTypeCounts);
    908908       
Note: See TracChangeset for help on using the changeset viewer.