Changeset 183186 in webkit
- Timestamp:
- Apr 23, 2015 8:52:20 AM (9 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r183185 r183186 1 2015-04-23 Joonghun Park <jh718.park@samsung.com> 2 3 Use std::unique_ptr instead of OwnPtr in ThreadGlobalData 4 https://bugs.webkit.org/show_bug.cgi?id=141950 5 6 Reviewed by Darin Adler. 7 8 No new tests, no behavior changes. 9 10 * dom/EventNames.h: 11 (WebCore::EventNames::create): 12 * loader/cache/CachedResourceRequestInitiators.h: 13 * platform/ThreadGlobalData.cpp: 14 (WebCore::ThreadGlobalData::ThreadGlobalData): 15 (WebCore::ThreadGlobalData::destroy): 16 * platform/ThreadGlobalData.h: 17 1 18 2015-04-23 Eric Carlson <eric.carlson@apple.com> 2 19 -
trunk/Source/WebCore/dom/EventNames.h
r183021 r183186 268 268 #undef DOM_EVENT_NAMES_DECLARE 269 269 270 // FIXME: The friend declaration to std::make_unique below does not work in windows port. 271 // 272 // template<class T, class... Args> 273 // friend typename std::_Unique_if<T>::_Single_object std::make_unique(Args&&...); 274 // 275 // This create function should be deleted later and is only for keeping EventNames as private. 276 // std::make_unique should be used instead. 277 // 278 template<class... Args> 279 static std::unique_ptr<EventNames> create(Args&&... args) 280 { 281 return std::unique_ptr<EventNames>(new EventNames(std::forward<Args>(args)...)); 282 } 283 270 284 // FIXME: Inelegant to call these both event names and event types. 271 285 // We should choose one term and stick to it. -
trunk/Source/WebCore/loader/cache/CachedResourceRequestInitiators.h
r165676 r183186 33 33 34 34 struct CachedResourceRequestInitiators { 35 CachedResourceRequestInitiators(); 36 35 37 const AtomicString css; 36 38 const AtomicString icon; … … 38 40 WTF_MAKE_NONCOPYABLE(CachedResourceRequestInitiators); WTF_MAKE_FAST_ALLOCATED; 39 41 private: 40 CachedResourceRequestInitiators();41 42 friend class ThreadGlobalData; 42 43 }; -
trunk/Source/WebCore/platform/ThreadGlobalData.cpp
r174113 r183186 50 50 51 51 ThreadGlobalData::ThreadGlobalData() 52 : m_cachedResourceRequestInitiators( adoptPtr(new CachedResourceRequestInitiators))53 , m_eventNames( adoptPtr(new EventNames))54 , m_threadTimers( adoptPtr(new ThreadTimers))52 : m_cachedResourceRequestInitiators(std::make_unique<CachedResourceRequestInitiators>()) 53 , m_eventNames(EventNames::create()) 54 , m_threadTimers(std::make_unique<ThreadTimers>()) 55 55 #ifndef NDEBUG 56 56 , m_isMainThread(isMainThread()) 57 57 #endif 58 , m_cachedConverterICU( adoptPtr(new ICUConverterWrapper))58 , m_cachedConverterICU(std::make_unique<ICUConverterWrapper>()) 59 59 #if PLATFORM(MAC) 60 , m_cachedConverterTEC( adoptPtr(new TECConverterWrapper))60 , m_cachedConverterTEC(std::make_unique<TECConverterWrapper>()) 61 61 #endif 62 62 { … … 76 76 { 77 77 #if PLATFORM(MAC) 78 m_cachedConverterTEC .clear();78 m_cachedConverterTEC = nullptr; 79 79 #endif 80 80 81 m_cachedConverterICU .clear();81 m_cachedConverterICU = nullptr; 82 82 83 m_eventNames .clear();84 m_threadTimers .clear();83 m_eventNames = nullptr; 84 m_threadTimers = nullptr; 85 85 } 86 86 -
trunk/Source/WebCore/platform/ThreadGlobalData.h
r181212 r183186 69 69 70 70 private: 71 OwnPtr<CachedResourceRequestInitiators> m_cachedResourceRequestInitiators;72 OwnPtr<EventNames> m_eventNames;73 OwnPtr<ThreadTimers> m_threadTimers;71 std::unique_ptr<CachedResourceRequestInitiators> m_cachedResourceRequestInitiators; 72 std::unique_ptr<EventNames> m_eventNames; 73 std::unique_ptr<ThreadTimers> m_threadTimers; 74 74 75 75 #ifndef NDEBUG … … 77 77 #endif 78 78 79 OwnPtr<ICUConverterWrapper> m_cachedConverterICU;79 std::unique_ptr<ICUConverterWrapper> m_cachedConverterICU; 80 80 81 81 #if PLATFORM(MAC) 82 OwnPtr<TECConverterWrapper> m_cachedConverterTEC;82 std::unique_ptr<TECConverterWrapper> m_cachedConverterTEC; 83 83 #endif 84 84
Note: See TracChangeset
for help on using the changeset viewer.