Changeset 119943 in webkit


Ignore:
Timestamp:
Jun 10, 2012 12:19:19 PM (12 years ago)
Author:
Darin Adler
Message:

Some additional tweaks to keep TreeShared code simple/clean
https://bugs.webkit.org/show_bug.cgi?id=88738

Reviewed by Adam Barth.

  • platform/TreeShared.h: Make constructor and destructor both protected.

It's slightly dangerous to have a public non-virtual destructor, and there
is no reason it needs to be public.
(WebCore::TreeShared::~TreeShared): Make debug-only destructor non-virtual;
we were getting no value from it being virtual. Now that it's non-virtual,
there is no need to use an #if on it since it's an empty inline destructor
in non-debug builds.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r119940 r119943  
     12012-06-10  Darin Adler  <darin@apple.com>
     2
     3        Some additional tweaks to keep TreeShared code simple/clean
     4        https://bugs.webkit.org/show_bug.cgi?id=88738
     5
     6        Reviewed by Adam Barth.
     7
     8        * platform/TreeShared.h: Make constructor and destructor both protected.
     9        It's slightly dangerous to have a public non-virtual destructor, and there
     10        is no reason it needs to be public.
     11        (WebCore::TreeShared::~TreeShared): Make debug-only destructor non-virtual;
     12        we were getting no value from it being virtual. Now that it's non-virtual,
     13        there is no need to use an #if on it since it's an empty inline destructor
     14        in non-debug builds.
     15
    1162012-06-06  Jer Noble  <jer.noble@apple.com>
    217
  • trunk/Source/WebCore/platform/TreeShared.h

    r119937 r119943  
    3535template<typename NodeType, typename ParentNodeType> class TreeShared {
    3636    WTF_MAKE_NONCOPYABLE(TreeShared);
    37 public:
     37protected:
    3838    TreeShared()
    3939        : m_parent(0)
     
    5050    }
    5151
    52 #ifndef NDEBUG
    53     virtual ~TreeShared()
     52    ~TreeShared()
    5453    {
    5554        ASSERT(isMainThread());
     
    5857        ASSERT(!m_adoptionIsRequired);
    5958    }
    60 #endif
    6159
     60public:
    6261    void ref()
    6362    {
Note: See TracChangeset for help on using the changeset viewer.