diff options
author | JustOff <Off.Just.Off@gmail.com> | 2019-03-13 18:46:01 +0200 |
---|---|---|
committer | JustOff <Off.Just.Off@gmail.com> | 2019-03-13 18:46:01 +0200 |
commit | 5a10462a92197769cc7af04287c6315fa8961dcd (patch) | |
tree | 429506826bc8fe39a46f9622ed5bda491f4d3c9a /dom/bindings/BindingUtils.h | |
parent | bcdacfe2dfb9c9e36de462182562ebf4eec94f36 (diff) | |
download | UXP-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.h | 16 |
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); } } }; |