Title: [119943] trunk/Source/WebCore
- Revision
- 119943
- Author
- [email protected]
- Date
- 2012-06-10 12:19:19 -0700 (Sun, 10 Jun 2012)
Log 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.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (119942 => 119943)
--- trunk/Source/WebCore/ChangeLog 2012-06-10 18:44:05 UTC (rev 119942)
+++ trunk/Source/WebCore/ChangeLog 2012-06-10 19:19:19 UTC (rev 119943)
@@ -1,3 +1,18 @@
+2012-06-10 Darin Adler <[email protected]>
+
+ 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.
+
2012-06-06 Jer Noble <[email protected]>
REGRESSION: Setting invalid media "src" does not cause "error" event
Modified: trunk/Source/WebCore/platform/TreeShared.h (119942 => 119943)
--- trunk/Source/WebCore/platform/TreeShared.h 2012-06-10 18:44:05 UTC (rev 119942)
+++ trunk/Source/WebCore/platform/TreeShared.h 2012-06-10 19:19:19 UTC (rev 119943)
@@ -34,7 +34,7 @@
template<typename NodeType, typename ParentNodeType> class TreeShared {
WTF_MAKE_NONCOPYABLE(TreeShared);
-public:
+protected:
TreeShared()
: m_parent(0)
, m_refCount(1)
@@ -49,16 +49,15 @@
#endif
}
-#ifndef NDEBUG
- virtual ~TreeShared()
+ ~TreeShared()
{
ASSERT(isMainThread());
ASSERT(!m_refCount);
ASSERT(m_deletionHasBegun);
ASSERT(!m_adoptionIsRequired);
}
-#endif
+public:
void ref()
{
ASSERT(isMainThread());
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes