summaryrefslogtreecommitdiff
path: root/deps/v8/third_party/inspector_protocol/lib/Forward_h.template
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/third_party/inspector_protocol/lib/Forward_h.template')
-rw-r--r--deps/v8/third_party/inspector_protocol/lib/Forward_h.template50
1 files changed, 48 insertions, 2 deletions
diff --git a/deps/v8/third_party/inspector_protocol/lib/Forward_h.template b/deps/v8/third_party/inspector_protocol/lib/Forward_h.template
index ff5e685863..7cc47b4f0f 100644
--- a/deps/v8/third_party/inspector_protocol/lib/Forward_h.template
+++ b/deps/v8/third_party/inspector_protocol/lib/Forward_h.template
@@ -18,17 +18,17 @@
#include <unordered_map>
#include <unordered_set>
+#include "{{config.bindings_lib.header}}"
+
{% for namespace in config.protocol.namespace %}
namespace {{namespace}} {
{% endfor %}
-template<typename T> class Array;
class DictionaryValue;
class DispatchResponse;
class ErrorSupport;
class FundamentalValue;
class ListValue;
-template<typename T> class Maybe;
class Object;
using Response = DispatchResponse;
class SerializedValue;
@@ -36,6 +36,52 @@ class StringValue;
class UberDispatcher;
class Value;
+namespace detail {
+template <typename T>
+struct ArrayTypedef { typedef std::vector<std::unique_ptr<T>> type; };
+
+template <>
+struct ArrayTypedef<String> { typedef std::vector<String> type; };
+
+template <>
+struct ArrayTypedef<int> { typedef std::vector<int> type; };
+
+template <>
+struct ArrayTypedef<double> { typedef std::vector<double> type; };
+
+template <>
+struct ArrayTypedef<bool> { typedef std::vector<bool> type; };
+} // namespace detail
+
+template <typename T>
+using Array = typename detail::ArrayTypedef<T>::type;
+
+namespace detail {
+using {{config.bindings_lib.namespace}}::glue::detail::PtrMaybe;
+using {{config.bindings_lib.namespace}}::glue::detail::ValueMaybe;
+
+template <typename T>
+struct MaybeTypedef { typedef PtrMaybe<T> type; };
+
+template <>
+struct MaybeTypedef<bool> { typedef ValueMaybe<bool> type; };
+
+template <>
+struct MaybeTypedef<int> { typedef ValueMaybe<int> type; };
+
+template <>
+struct MaybeTypedef<double> { typedef ValueMaybe<double> type; };
+
+template <>
+struct MaybeTypedef<String> { typedef ValueMaybe<String> type; };
+
+template <>
+struct MaybeTypedef<Binary> { typedef ValueMaybe<Binary> type; };
+} // namespace detail
+
+template <typename T>
+using Maybe = typename detail::MaybeTypedef<T>::type;
+
{% for namespace in config.protocol.namespace %}
} // namespace {{namespace}}
{% endfor %}