[OTLayout] Start porting sanitize() to process()
diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh
index 541927b..2372235 100644
--- a/src/hb-open-type-private.hh
+++ b/src/hb-open-type-private.hh
@@ -168,12 +168,22 @@
 
 #define TRACE_SANITIZE(this) \
 	hb_auto_trace_t<HB_DEBUG_SANITIZE, bool> trace \
-	(&c->debug_depth, "SANITIZE", this, HB_FUNC, \
+	(&c->debug_depth, c->get_name (), this, HB_FUNC, \
 	 "");
 
 
 struct hb_sanitize_context_t
 {
+  inline const char *get_name (void) { return "SANITIZE"; }
+  static const unsigned int max_debug_depth = HB_DEBUG_SANITIZE;
+  typedef bool return_t;
+  template <typename T>
+  inline return_t process (const T &obj) { return obj.sanitize (this); }
+  static return_t default_return_value (void) { return true; }
+  bool stop_sublookup_iteration (const return_t r) const { return false; }
+  return_t recurse (unsigned int lookup_index)
+  { return default_return_value (); }
+
   inline void init (hb_blob_t *b)
   {
     this->blob = hb_blob_reference (b);
diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh
index 6be9238..f47f80b 100644
--- a/src/hb-ot-layout-gsubgpos-private.hh
+++ b/src/hb-ot-layout-gsubgpos-private.hh
@@ -50,7 +50,7 @@
 
 #define TRACE_CLOSURE(this) \
 	hb_auto_trace_t<HB_DEBUG_CLOSURE, void_t> trace \
-	(&c->debug_depth, "CLOSURE", this, HB_FUNC, \
+	(&c->debug_depth, c->get_name (), this, HB_FUNC, \
 	 "");
 
 struct hb_closure_context_t
@@ -99,7 +99,7 @@
 
 #define TRACE_WOULD_APPLY(this) \
 	hb_auto_trace_t<HB_DEBUG_WOULD_APPLY, bool> trace \
-	(&c->debug_depth, "WOULD_APPLY", this, HB_FUNC, \
+	(&c->debug_depth, c->get_name (), this, HB_FUNC, \
 	 "%d glyphs", c->len);
 
 struct hb_would_apply_context_t
@@ -138,7 +138,7 @@
 
 #define TRACE_COLLECT_GLYPHS(this) \
 	hb_auto_trace_t<HB_DEBUG_COLLECT_GLYPHS, void_t> trace \
-	(&c->debug_depth, "COLLECT_GLYPHS", this, HB_FUNC, \
+	(&c->debug_depth, c->get_name (), this, HB_FUNC, \
 	 "");
 
 struct hb_collect_glyphs_context_t
@@ -206,7 +206,7 @@
 
 #define TRACE_APPLY(this) \
 	hb_auto_trace_t<HB_DEBUG_APPLY, bool> trace \
-	(&c->debug_depth, "APPLY", this, HB_FUNC, \
+	(&c->debug_depth, c->get_name (), this, HB_FUNC, \
 	 "idx %d codepoint %u", c->buffer->idx, c->buffer->cur().codepoint);
 
 struct hb_apply_context_t