Modified: trunk/Source/_javascript_Core/ChangeLog (102409 => 102410)
--- trunk/Source/_javascript_Core/ChangeLog 2011-12-09 01:54:06 UTC (rev 102409)
+++ trunk/Source/_javascript_Core/ChangeLog 2011-12-09 01:56:59 UTC (rev 102410)
@@ -1,3 +1,12 @@
+2011-12-08 Adam Klein <ad...@chromium.org>
+
+ Use HashMap<Node*, OwnPtr<...>> in ChildListMutationScope
+ https://bugs.webkit.org/show_bug.cgi?id=73964
+
+ Reviewed by Darin Adler.
+
+ * wtf/HashTraits.h: Add passOut(std::nullptr_t) to allow callers to use HashMap::take on a HashMap of OwnPtrs.
+
2011-12-08 Thouraya ANDOLSI <thouraya.ando...@st.com>
https://bugs.webkit.org/show_bug.cgi?id=74005
Modified: trunk/Source/_javascript_Core/wtf/HashTraits.h (102409 => 102410)
--- trunk/Source/_javascript_Core/wtf/HashTraits.h 2011-12-09 01:54:06 UTC (rev 102409)
+++ trunk/Source/_javascript_Core/wtf/HashTraits.h 2011-12-09 01:56:59 UTC (rev 102410)
@@ -117,6 +117,7 @@
typedef PassOwnPtr<P> PassOutType;
static PassOwnPtr<P> passOut(OwnPtr<P>& value) { return value.release(); }
+ static PassOwnPtr<P> passOut(std::nullptr_t) { return nullptr; }
typedef typename OwnPtr<P>::PtrType PeekType;
static PeekType peek(const OwnPtr<P>& value) { return value.get(); }
Modified: trunk/Source/WebCore/ChangeLog (102409 => 102410)
--- trunk/Source/WebCore/ChangeLog 2011-12-09 01:54:06 UTC (rev 102409)
+++ trunk/Source/WebCore/ChangeLog 2011-12-09 01:56:59 UTC (rev 102410)
@@ -1,3 +1,20 @@
+2011-12-08 Adam Klein <ad...@chromium.org>
+
+ Use HashMap<Node*, OwnPtr<...>> in ChildListMutationScope
+ https://bugs.webkit.org/show_bug.cgi?id=73964
+
+ Reviewed by Darin Adler.
+
+ Re-landing r102267 with a fix for the clang build.
+
+ No new tests, refactoring only.
+
+ * dom/ChildListMutationScope.cpp:
+ (WebCore::ChildListMutationAccumulator::MutationAccumulationRouter::childAdded):
+ (WebCore::ChildListMutationAccumulator::MutationAccumulationRouter::willRemoveChild):
+ (WebCore::ChildListMutationAccumulator::MutationAccumulationRouter::incrementScopingLevel):
+ (WebCore::ChildListMutationAccumulator::MutationAccumulationRouter::decrementScopingLevel):
+
2011-12-08 Anders Carlsson <ander...@apple.com>
WebScrollbarPainterDelegate should have a pointer to its Scrollbar
Modified: trunk/Source/WebCore/dom/ChildListMutationScope.cpp (102409 => 102410)
--- trunk/Source/WebCore/dom/ChildListMutationScope.cpp 2011-12-09 01:54:06 UTC (rev 102409)
+++ trunk/Source/WebCore/dom/ChildListMutationScope.cpp 2011-12-09 01:56:59 UTC (rev 102410)
@@ -40,7 +40,7 @@
#include "Node.h"
#include "StaticNodeList.h"
#include <wtf/HashMap.h>
-#include <wtf/RefCounted.h>
+#include <wtf/OwnPtr.h>
namespace WebCore {
@@ -50,7 +50,7 @@
// and precede any additions. If this is violated (i.e. because of code changes elsewhere
// in WebCore) it will likely result in both (a) ASSERTions failing, and (b) mutation records
// being enqueued for delivery before the outer-most scope closes.
-class ChildListMutationAccumulator : public RefCounted<ChildListMutationAccumulator> {
+class ChildListMutationAccumulator {
WTF_MAKE_NONCOPYABLE(ChildListMutationAccumulator);
public:
ChildListMutationAccumulator(PassRefPtr<Node>, PassOwnPtr<MutationObserverInterestGroup> observers);
@@ -95,7 +95,7 @@
typedef HashMap<Node*, unsigned> ScopingLevelMap;
ScopingLevelMap m_scopingLevels;
- HashMap<Node*, RefPtr<ChildListMutationAccumulator> > m_accumulations;
+ HashMap<Node*, OwnPtr<ChildListMutationAccumulator> > m_accumulations;
static MutationAccumulationRouter* s_instance;
};
@@ -216,7 +216,7 @@
void MutationAccumulationRouter::childAdded(Node* target, Node* child)
{
- HashMap<Node*, RefPtr<ChildListMutationAccumulator> >::iterator iter = m_accumulations.find(target);
+ HashMap<Node*, OwnPtr<ChildListMutationAccumulator> >::iterator iter = m_accumulations.find(target);
ASSERT(iter != m_accumulations.end());
if (iter->second)
@@ -225,7 +225,7 @@
void MutationAccumulationRouter::willRemoveChild(Node* target, Node* child)
{
- HashMap<Node*, RefPtr<ChildListMutationAccumulator> >::iterator iter = m_accumulations.find(target);
+ HashMap<Node*, OwnPtr<ChildListMutationAccumulator> >::iterator iter = m_accumulations.find(target);
ASSERT(iter != m_accumulations.end());
if (iter->second)
@@ -242,9 +242,9 @@
OwnPtr<MutationObserverInterestGroup> observers = MutationObserverInterestGroup::createForChildListMutation(target);
if (observers->isEmpty())
- m_accumulations.set(target, 0);
+ m_accumulations.set(target, nullptr);
else
- m_accumulations.set(target, adoptRef(new ChildListMutationAccumulator(target, observers.release())));
+ m_accumulations.set(target, adoptPtr(new ChildListMutationAccumulator(target, observers.release())));
}
void MutationAccumulationRouter::decrementScopingLevel(Node* target)
@@ -258,7 +258,7 @@
m_scopingLevels.remove(iter);
- RefPtr<ChildListMutationAccumulator> record = m_accumulations.take(target);
+ OwnPtr<ChildListMutationAccumulator> record(m_accumulations.take(target));
if (record)
record->enqueueMutationRecord();
}