summaryrefslogtreecommitdiffstats
path: root/dom/bindings/BindingUtils.h
diff options
context:
space:
mode:
authorJustOff <Off.Just.Off@gmail.com>2019-03-13 18:46:01 +0200
committerJustOff <Off.Just.Off@gmail.com>2019-03-13 18:46:01 +0200
commit5a10462a92197769cc7af04287c6315fa8961dcd (patch)
tree429506826bc8fe39a46f9622ed5bda491f4d3c9a /dom/bindings/BindingUtils.h
parentbcdacfe2dfb9c9e36de462182562ebf4eec94f36 (diff)
downloadUXP-5a10462a92197769cc7af04287c6315fa8961dcd.tar
UXP-5a10462a92197769cc7af04287c6315fa8961dcd.tar.gz
UXP-5a10462a92197769cc7af04287c6315fa8961dcd.tar.lz
UXP-5a10462a92197769cc7af04287c6315fa8961dcd.tar.xz
UXP-5a10462a92197769cc7af04287c6315fa8961dcd.zip
Change the MozMap API and data storage to more what we want record<> to look like
Diffstat (limited to 'dom/bindings/BindingUtils.h')
-rw-r--r--dom/bindings/BindingUtils.h16
1 files changed, 5 insertions, 11 deletions
diff --git a/dom/bindings/BindingUtils.h b/dom/bindings/BindingUtils.h
index 24b47a545..23bbbea5a 100644
--- a/dom/bindings/BindingUtils.h
+++ b/dom/bindings/BindingUtils.h
@@ -2294,18 +2294,12 @@ public:
};
template<typename T>
-static void
-TraceMozMapValue(T* aValue, void* aClosure)
-{
- JSTracer* trc = static_cast<JSTracer*>(aClosure);
- // Act like it's a one-element sequence to leverage all that infrastructure.
- SequenceTracer<T>::TraceSequence(trc, aValue, aValue + 1);
-}
-
-template<typename T>
void TraceMozMap(JSTracer* trc, MozMap<T>& map)
{
- map.EnumerateValues(TraceMozMapValue<T>, trc);
+ for (auto& entry : map.Entries()) {
+ // Act like it's a one-element sequence to leverage all that infrastructure.
+ SequenceTracer<T>::TraceSequence(trc, &entry.mValue, &entry.mValue + 1);
+ }
}
// sequence<MozMap>
@@ -2317,7 +2311,7 @@ class SequenceTracer<MozMap<T>, false, false, false>
public:
static void TraceSequence(JSTracer* trc, MozMap<T>* seqp, MozMap<T>* end) {
for (; seqp != end; ++seqp) {
- seqp->EnumerateValues(TraceMozMapValue<T>, trc);
+ TraceMozMap(trc, *seqp);
}
}
};