Title: [149523] trunk/Source
Revision
149523
Author
[email protected]
Date
2013-05-03 10:12:44 -0700 (Fri, 03 May 2013)

Log Message

Remove WTF::ListRefPtr class
https://bugs.webkit.org/show_bug.cgi?id=115516

Reviewed by Anders Carlsson.

ListRefPtr was used only by FontFamily class, besides it strongly depended
on FontFamily class semantics which made it non-generic and inappropriate
for being present inside WTF.

This patch removes WTF::ListRefPtr class and moves its the functionality
into FontFamily class.

Source/WebCore:

No new tests, no change in the behavior.

* page/FrameTree.h:
(FrameTree):
* platform/graphics/FontFamily.h:
(FontFamily):
(WebCore::FontFamily::~FontFamily):
(WebCore):

Source/WTF:

* GNUmakefile.list.am:
* WTF.pro:
* WTF.vcproj/WTF.vcproj:
* WTF.vcxproj/WTF.vcxproj:
* WTF.vcxproj/WTF.vcxproj.filters:
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/Forward.h:
(WTF):
* wtf/ListRefPtr.h: Removed.

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (149522 => 149523)


--- trunk/Source/WTF/ChangeLog	2013-05-03 16:58:01 UTC (rev 149522)
+++ trunk/Source/WTF/ChangeLog	2013-05-03 17:12:44 UTC (rev 149523)
@@ -1,3 +1,28 @@
+2013-05-03  Mikhail Pozdnyakov  <[email protected]>
+
+        Remove WTF::ListRefPtr class
+        https://bugs.webkit.org/show_bug.cgi?id=115516
+
+        Reviewed by Anders Carlsson.
+
+        ListRefPtr was used only by FontFamily class, besides it strongly depended
+        on FontFamily class semantics which made it non-generic and inappropriate
+        for being present inside WTF.
+
+        This patch removes WTF::ListRefPtr class and moves its the functionality
+        into FontFamily class.
+
+        * GNUmakefile.list.am:
+        * WTF.pro:
+        * WTF.vcproj/WTF.vcproj:
+        * WTF.vcxproj/WTF.vcxproj:
+        * WTF.vcxproj/WTF.vcxproj.filters:
+        * WTF.xcodeproj/project.pbxproj:
+        * wtf/CMakeLists.txt:
+        * wtf/Forward.h:
+        (WTF):
+        * wtf/ListRefPtr.h: Removed.
+
 2013-05-02  Brent Fulgham  <[email protected]>
 
         [WinCairo] Unreviewed build fix.

Modified: trunk/Source/WTF/GNUmakefile.list.am (149522 => 149523)


--- trunk/Source/WTF/GNUmakefile.list.am	2013-05-03 16:58:01 UTC (rev 149522)
+++ trunk/Source/WTF/GNUmakefile.list.am	2013-05-03 17:12:44 UTC (rev 149523)
@@ -79,7 +79,6 @@
     Source/WTF/wtf/Int8Array.h \
     Source/WTF/wtf/IntegralTypedArrayBase.h \
     Source/WTF/wtf/ListHashSet.h \
-    Source/WTF/wtf/ListRefPtr.h \
     Source/WTF/wtf/Locker.h \
     Source/WTF/wtf/MD5.cpp \
     Source/WTF/wtf/MD5.h \

Modified: trunk/Source/WTF/WTF.pro (149522 => 149523)


--- trunk/Source/WTF/WTF.pro	2013-05-03 16:58:01 UTC (rev 149522)
+++ trunk/Source/WTF/WTF.pro	2013-05-03 17:12:44 UTC (rev 149523)
@@ -84,7 +84,6 @@
     Int32Array.h \
     Int8Array.h \
     ListHashSet.h \
-    ListRefPtr.h \
     Locker.h \
     MainThread.h \
     MallocZoneSupport.h \

Modified: trunk/Source/WTF/WTF.vcproj/WTF.vcproj (149522 => 149523)


--- trunk/Source/WTF/WTF.vcproj/WTF.vcproj	2013-05-03 16:58:01 UTC (rev 149522)
+++ trunk/Source/WTF/WTF.vcproj/WTF.vcproj	2013-05-03 17:12:44 UTC (rev 149523)
@@ -895,10 +895,6 @@
 			>
 		</File>
 		<File
-			RelativePath="..\wtf\ListRefPtr.h"
-			>
-		</File>
-		<File
 			RelativePath="..\wtf\Locker.h"
 			>
 		</File>

Modified: trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj (149522 => 149523)


--- trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj	2013-05-03 16:58:01 UTC (rev 149522)
+++ trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj	2013-05-03 17:12:44 UTC (rev 149523)
@@ -160,7 +160,6 @@
     <ClInclude Include="..\wtf\Int32Array.h" />
     <ClInclude Include="..\wtf\Int8Array.h" />
     <ClInclude Include="..\wtf\ListHashSet.h" />
-    <ClInclude Include="..\wtf\ListRefPtr.h" />
     <ClInclude Include="..\wtf\Locker.h" />
     <ClInclude Include="..\wtf\MainThread.h" />
     <ClInclude Include="..\wtf\MallocZoneSupport.h" />

Modified: trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj.filters (149522 => 149523)


--- trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj.filters	2013-05-03 16:58:01 UTC (rev 149522)
+++ trunk/Source/WTF/WTF.vcxproj/WTF.vcxproj.filters	2013-05-03 17:12:44 UTC (rev 149523)
@@ -483,9 +483,6 @@
     <ClInclude Include="..\wtf\ListHashSet.h">
       <Filter>wtf</Filter>
     </ClInclude>
-    <ClInclude Include="..\wtf\ListRefPtr.h">
-      <Filter>wtf</Filter>
-    </ClInclude>
     <ClInclude Include="..\wtf\Locker.h">
       <Filter>wtf</Filter>
     </ClInclude>

Modified: trunk/Source/WTF/WTF.xcodeproj/project.pbxproj (149522 => 149523)


--- trunk/Source/WTF/WTF.xcodeproj/project.pbxproj	2013-05-03 16:58:01 UTC (rev 149522)
+++ trunk/Source/WTF/WTF.xcodeproj/project.pbxproj	2013-05-03 17:12:44 UTC (rev 149523)
@@ -139,7 +139,6 @@
 		A8A473DF151A825B004123FF /* Int32Array.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472BF151A825A004123FF /* Int32Array.h */; };
 		A8A473E0151A825B004123FF /* IntegralTypedArrayBase.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472C0151A825A004123FF /* IntegralTypedArrayBase.h */; };
 		A8A473E1151A825B004123FF /* ListHashSet.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472C1151A825A004123FF /* ListHashSet.h */; };
-		A8A473E2151A825B004123FF /* ListRefPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472C2151A825A004123FF /* ListRefPtr.h */; };
 		A8A473E3151A825B004123FF /* Locker.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472C3151A825A004123FF /* Locker.h */; };
 		A8A473E4151A825B004123FF /* MainThreadMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A8A472C5151A825A004123FF /* MainThreadMac.mm */; };
 		A8A473E5151A825B004123FF /* MainThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472C6151A825A004123FF /* MainThread.cpp */; };
@@ -415,7 +414,6 @@
 		A8A472BF151A825A004123FF /* Int32Array.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Int32Array.h; sourceTree = "<group>"; };
 		A8A472C0151A825A004123FF /* IntegralTypedArrayBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntegralTypedArrayBase.h; sourceTree = "<group>"; };
 		A8A472C1151A825A004123FF /* ListHashSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListHashSet.h; sourceTree = "<group>"; };
-		A8A472C2151A825A004123FF /* ListRefPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListRefPtr.h; sourceTree = "<group>"; };
 		A8A472C3151A825A004123FF /* Locker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Locker.h; sourceTree = "<group>"; };
 		A8A472C5151A825A004123FF /* MainThreadMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MainThreadMac.mm; sourceTree = "<group>"; };
 		A8A472C6151A825A004123FF /* MainThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MainThread.cpp; sourceTree = "<group>"; };
@@ -690,7 +688,6 @@
 				A8A472BD151A825A004123FF /* Int8Array.h */,
 				A8A472C0151A825A004123FF /* IntegralTypedArrayBase.h */,
 				A8A472C1151A825A004123FF /* ListHashSet.h */,
-				A8A472C2151A825A004123FF /* ListRefPtr.h */,
 				A8A472C3151A825A004123FF /* Locker.h */,
 				A8A472C6151A825A004123FF /* MainThread.cpp */,
 				A8A472C7151A825B004123FF /* MainThread.h */,
@@ -1004,7 +1001,6 @@
 				26147B0A15DDCCDC00DDB907 /* IntegerToStringConversion.h in Headers */,
 				A8A473E0151A825B004123FF /* IntegralTypedArrayBase.h in Headers */,
 				A8A473E1151A825B004123FF /* ListHashSet.h in Headers */,
-				A8A473E2151A825B004123FF /* ListRefPtr.h in Headers */,
 				A8A473E3151A825B004123FF /* Locker.h in Headers */,
 				A8A473E6151A825B004123FF /* MainThread.h in Headers */,
 				A8A473E7151A825B004123FF /* MallocZoneSupport.h in Headers */,

Modified: trunk/Source/WTF/wtf/CMakeLists.txt (149522 => 149523)


--- trunk/Source/WTF/wtf/CMakeLists.txt	2013-05-03 16:58:01 UTC (rev 149522)
+++ trunk/Source/WTF/wtf/CMakeLists.txt	2013-05-03 17:12:44 UTC (rev 149523)
@@ -43,7 +43,6 @@
     HashTraits.h
     HexNumber.h
     ListHashSet.h
-    ListRefPtr.h
     Locker.h
     MD5.h
     MainThread.h

Modified: trunk/Source/WTF/wtf/Forward.h (149522 => 149523)


--- trunk/Source/WTF/wtf/Forward.h	2013-05-03 16:58:01 UTC (rev 149522)
+++ trunk/Source/WTF/wtf/Forward.h	2013-05-03 17:12:44 UTC (rev 149523)
@@ -26,7 +26,6 @@
 namespace WTF {
 
     template<typename T> class Function;
-    template<typename T> class ListRefPtr;
     template<typename T> class OwnArrayPtr;
     template<typename T> class OwnPtr;
     template<typename T> class PassOwnArrayPtr;
@@ -60,7 +59,6 @@
 }
 
 using WTF::Function;
-using WTF::ListRefPtr;
 using WTF::OwnArrayPtr;
 using WTF::OwnPtr;
 using WTF::PassOwnArrayPtr;

Deleted: trunk/Source/WTF/wtf/ListRefPtr.h (149522 => 149523)


--- trunk/Source/WTF/wtf/ListRefPtr.h	2013-05-03 16:58:01 UTC (rev 149522)
+++ trunk/Source/WTF/wtf/ListRefPtr.h	2013-05-03 17:12:44 UTC (rev 149523)
@@ -1,61 +0,0 @@
-/*
- *  Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved.
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Library General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Library General Public License for more details.
- *
- *  You should have received a copy of the GNU Library General Public License
- *  along with this library; see the file COPYING.LIB.  If not, write to
- *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- *  Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef WTF_ListRefPtr_h
-#define WTF_ListRefPtr_h
-
-#include <wtf/RefPtr.h>
-
-namespace WTF {
-
-    // Specialized version of RefPtr desgined for use in singly-linked lists. 
-    // Derefs the list iteratively to avoid recursive derefing that can overflow the stack.
-    template <typename T> class ListRefPtr : public RefPtr<T> {
-    public:
-        ListRefPtr() : RefPtr<T>() {}
-        ListRefPtr(T* ptr) : RefPtr<T>(ptr) {}
-        ListRefPtr(const RefPtr<T>& o) : RefPtr<T>(o) {}
-        // see comment in PassRefPtr.h for why this takes const reference
-        template <typename U> ListRefPtr(const PassRefPtr<U>& o) : RefPtr<T>(o) {}
-        
-        ~ListRefPtr()
-        {
-            RefPtr<T> reaper = this->release();
-            while (reaper && reaper->hasOneRef())
-                reaper = reaper->releaseNext(); // implicitly protects reaper->next, then derefs reaper
-        }
-        
-        ListRefPtr& operator=(T* optr) { RefPtr<T>::operator=(optr); return *this; }
-        ListRefPtr& operator=(const RefPtr<T>& o) { RefPtr<T>::operator=(o); return *this; }
-        ListRefPtr& operator=(const PassRefPtr<T>& o) { RefPtr<T>::operator=(o); return *this; }
-        template <typename U> ListRefPtr& operator=(const RefPtr<U>& o) { RefPtr<T>::operator=(o); return *this; }
-        template <typename U> ListRefPtr& operator=(const PassRefPtr<U>& o) { RefPtr<T>::operator=(o); return *this; }
-    };
-
-    template <typename T> inline T* getPtr(const ListRefPtr<T>& p)
-    {
-        return p.get();
-    }
-
-} // namespace WTF
-
-using WTF::ListRefPtr;
-
-#endif // WTF_ListRefPtr_h

Modified: trunk/Source/WebCore/ChangeLog (149522 => 149523)


--- trunk/Source/WebCore/ChangeLog	2013-05-03 16:58:01 UTC (rev 149522)
+++ trunk/Source/WebCore/ChangeLog	2013-05-03 17:12:44 UTC (rev 149523)
@@ -1,3 +1,26 @@
+2013-05-03  Mikhail Pozdnyakov  <[email protected]>
+
+        Remove WTF::ListRefPtr class
+        https://bugs.webkit.org/show_bug.cgi?id=115516
+
+        Reviewed by Anders Carlsson.
+
+        ListRefPtr was used only by FontFamily class, besides it strongly depended
+        on FontFamily class semantics which made it non-generic and inappropriate
+        for being present inside WTF.
+
+        This patch removes WTF::ListRefPtr class and moves its the functionality
+        into FontFamily class.
+
+        No new tests, no change in the behavior.
+
+        * page/FrameTree.h:
+        (FrameTree):
+        * platform/graphics/FontFamily.h:
+        (FontFamily):
+        (WebCore::FontFamily::~FontFamily):
+        (WebCore):
+
 2013-05-03  Allan Sandfeld Jensen  <[email protected]>
 
         Crash when calling QWebFrame::evaluateJavaScript

Modified: trunk/Source/WebCore/page/FrameTree.h (149522 => 149523)


--- trunk/Source/WebCore/page/FrameTree.h	2013-05-03 16:58:01 UTC (rev 149522)
+++ trunk/Source/WebCore/page/FrameTree.h	2013-05-03 17:12:44 UTC (rev 149523)
@@ -93,7 +93,6 @@
         AtomicString m_name; // The actual frame name (may be empty).
         AtomicString m_uniqueName;
 
-        // FIXME: use ListRefPtr?
         RefPtr<Frame> m_nextSibling;
         Frame* m_previousSibling;
         RefPtr<Frame> m_firstChild;

Modified: trunk/Source/WebCore/platform/graphics/FontFamily.h (149522 => 149523)


--- trunk/Source/WebCore/platform/graphics/FontFamily.h	2013-05-03 16:58:01 UTC (rev 149522)
+++ trunk/Source/WebCore/platform/graphics/FontFamily.h	2013-05-03 17:12:44 UTC (rev 149523)
@@ -27,7 +27,7 @@
 #define FontFamily_h
 
 #include <wtf/RefCounted.h>
-#include <wtf/ListRefPtr.h>
+#include <wtf/RefPtr.h>
 #include <wtf/text/AtomicString.h>
 
 namespace WebCore {
@@ -37,6 +37,7 @@
 class FontFamily {
 public:
     FontFamily() { }
+    ~FontFamily();
 
     void setFamily(const AtomicString& family) { m_family = family; }
     const AtomicString& family() const { return m_family; }
@@ -49,7 +50,7 @@
 
 private:
     AtomicString m_family;
-    ListRefPtr<SharedFontFamily> m_next;
+    RefPtr<SharedFontFamily> m_next;
 };
 
 class SharedFontFamily : public FontFamily, public RefCounted<SharedFontFamily> {
@@ -66,6 +67,15 @@
 bool operator==(const FontFamily&, const FontFamily&);
 inline bool operator!=(const FontFamily& a, const FontFamily& b) { return !(a == b); }
 
+inline FontFamily::~FontFamily()
+{
+    // This code came from removed ListRefPtr to avoid possible overflowing the stack.
+    // FIXME: Do we really need it?
+    RefPtr<SharedFontFamily> reaper = m_next.release();
+    while (reaper && reaper->hasOneRef())
+        reaper = reaper->releaseNext(); // implicitly protects reaper->next, then derefs reaper
+}
+
 inline const FontFamily* FontFamily::next() const
 {
     return m_next.get();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to