summaryrefslogtreecommitdiff
path: root/js/public/GCVector.h
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2022-06-07 20:20:19 -0500
committerMatt A. Tobin <email@mattatobin.com>2022-06-07 20:20:19 -0500
commit878ab758d5d4c1ef7badf2bc20ebc7c67dc2165b (patch)
tree3683d6df35e3618c0e7b456de7c749ca4c8c21a6 /js/public/GCVector.h
parenta621951327b0c19c0c24dfd9fd973f7bd13ae68f (diff)
parentcfb9884423faf741de03c5fcc72bf9ac8c6ada4d (diff)
downloadaura-central-878ab758d5d4c1ef7badf2bc20ebc7c67dc2165b.tar.gz
Merge branch 'TRUNK' into ARE-5.0
Diffstat (limited to 'js/public/GCVector.h')
-rw-r--r--js/public/GCVector.h36
1 files changed, 8 insertions, 28 deletions
diff --git a/js/public/GCVector.h b/js/public/GCVector.h
index 1c9925261..4acf0d1fc 100644
--- a/js/public/GCVector.h
+++ b/js/public/GCVector.h
@@ -134,11 +134,11 @@ class GCVector
namespace js {
-template <typename Outer, typename T, size_t Capacity, typename AllocPolicy>
-class GCVectorOperations
+template <typename Wrapper, typename T, size_t Capacity, typename AllocPolicy>
+class WrappedPtrOperations<JS::GCVector<T, Capacity, AllocPolicy>, Wrapper>
{
using Vec = JS::GCVector<T, Capacity, AllocPolicy>;
- const Vec& vec() const { return static_cast<const Outer*>(this)->get(); }
+ const Vec& vec() const { return static_cast<const Wrapper*>(this)->get(); }
public:
const AllocPolicy& allocPolicy() const { return vec().allocPolicy(); }
@@ -154,13 +154,13 @@ class GCVectorOperations
}
};
-template <typename Outer, typename T, size_t Capacity, typename AllocPolicy>
-class MutableGCVectorOperations
- : public GCVectorOperations<Outer, T, Capacity, AllocPolicy>
+template <typename Wrapper, typename T, size_t Capacity, typename AllocPolicy>
+class MutableWrappedPtrOperations<JS::GCVector<T, Capacity, AllocPolicy>, Wrapper>
+ : public WrappedPtrOperations<JS::GCVector<T, Capacity, AllocPolicy>, Wrapper>
{
using Vec = JS::GCVector<T, Capacity, AllocPolicy>;
- const Vec& vec() const { return static_cast<const Outer*>(this)->get(); }
- Vec& vec() { return static_cast<Outer*>(this)->get(); }
+ const Vec& vec() const { return static_cast<const Wrapper*>(this)->get(); }
+ Vec& vec() { return static_cast<Wrapper*>(this)->get(); }
public:
const AllocPolicy& allocPolicy() const { return vec().allocPolicy(); }
@@ -223,26 +223,6 @@ class MutableGCVectorOperations
void erase(T* aBegin, T* aEnd) { vec().erase(aBegin, aEnd); }
};
-template <typename T, size_t N, typename AP>
-class RootedBase<JS::GCVector<T,N,AP>>
- : public MutableGCVectorOperations<JS::Rooted<JS::GCVector<T,N,AP>>, T,N,AP>
-{};
-
-template <typename T, size_t N, typename AP>
-class MutableHandleBase<JS::GCVector<T,N,AP>>
- : public MutableGCVectorOperations<JS::MutableHandle<JS::GCVector<T,N,AP>>, T,N,AP>
-{};
-
-template <typename T, size_t N, typename AP>
-class HandleBase<JS::GCVector<T,N,AP>>
- : public GCVectorOperations<JS::Handle<JS::GCVector<T,N,AP>>, T,N,AP>
-{};
-
-template <typename T, size_t N, typename AP>
-class PersistentRootedBase<JS::GCVector<T,N,AP>>
- : public MutableGCVectorOperations<JS::PersistentRooted<JS::GCVector<T,N,AP>>, T,N,AP>
-{};
-
} // namespace js
#endif // js_GCVector_h