// Copyright 2020 The PDFium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef FXJS_GC_CONTAINER_TRACE_H_ #define FXJS_GC_CONTAINER_TRACE_H_ #include #include #include #include #include "v8/include/cppgc/member.h" #include "v8/include/cppgc/visitor.h" namespace fxgc { template void ContainerTrace(V* visitor, const std::list>& container) { for (const auto& item : container) visitor->Trace(item); } template void ContainerTrace(V* visitor, const std::map, U>& container) { for (const auto& item : container) { visitor->Trace(item.first); } } template void ContainerTrace(V* visitor, const std::map>& container) { for (const auto& item : container) visitor->Trace(item.second); } template void ContainerTrace( V* visitor, const std::map, cppgc::Member>& container) { for (const auto& item : container) { visitor->Trace(item.first); visitor->Trace(item.second); } } template void ContainerTrace(V* visitor, const std::set>& container) { for (const auto& item : container) visitor->Trace(item); } template void ContainerTrace(V* visitor, const std::vector>& container) { for (const auto& item : container) visitor->Trace(item); } } // namespace fxgc using fxgc::ContainerTrace; #endif // FXJS_GC_CONTAINER_TRACE_H_