Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Unified Diff: tools/clang/blink_gc_plugin/tests/trace_after_dispatch_impl.h

Issue 960873002: Update from https://crrev.com/318214 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/clang/blink_gc_plugin/tests/trace_after_dispatch_impl.h
diff --git a/tools/clang/blink_gc_plugin/tests/trace_after_dispatch_impl.h b/tools/clang/blink_gc_plugin/tests/trace_after_dispatch_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..e55c06eee51c3cc5f816cae972aaf0c4292502dc
--- /dev/null
+++ b/tools/clang/blink_gc_plugin/tests/trace_after_dispatch_impl.h
@@ -0,0 +1,88 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef TRACE_AFTER_DISPATCH_IMPL_H_
+#define TRACE_AFTER_DISPATCH_IMPL_H_
+
+#include "heap/stubs.h"
+
+namespace blink {
+
+class X : public GarbageCollected<X> {
+ public:
+ void trace(Visitor*) {}
+};
+
+enum ClassTag {
+ BASE, DERIVED
+};
+
+class TraceAfterDispatchInlinedBase
+ : public GarbageCollected<TraceAfterDispatchInlinedBase> {
+ public:
+ explicit TraceAfterDispatchInlinedBase(ClassTag tag) : tag_(tag) {}
+
+ void trace(Visitor* visitor);
+
+ void traceAfterDispatch(Visitor* visitor) { traceAfterDispatchImpl(visitor); }
+
+ private:
+ template <typename VisitorDispatcher>
+ void traceAfterDispatchImpl(VisitorDispatcher visitor) {
+ visitor->trace(x_base_);
+ }
+
+ ClassTag tag_;
+ Member<X> x_base_;
+};
+
+class TraceAfterDispatchInlinedDerived : public TraceAfterDispatchInlinedBase {
+ public:
+ TraceAfterDispatchInlinedDerived() : TraceAfterDispatchInlinedBase(DERIVED) {}
+
+ void traceAfterDispatch(Visitor* visitor) { traceAfterDispatchImpl(visitor); }
+
+ private:
+ template <typename VisitorDispatcher>
+ void traceAfterDispatchImpl(VisitorDispatcher visitor) {
+ visitor->trace(x_derived_);
+ TraceAfterDispatchInlinedBase::traceAfterDispatch(visitor);
+ }
+
+ Member<X> x_derived_;
+};
+
+class TraceAfterDispatchExternBase
+ : public GarbageCollected<TraceAfterDispatchExternBase> {
+ public:
+ explicit TraceAfterDispatchExternBase(ClassTag tag) : tag_(tag) {}
+
+ void trace(Visitor* visitor);
+
+ void traceAfterDispatch(Visitor* visitor);
+
+ private:
+ template <typename VisitorDispatcher>
+ void traceAfterDispatchImpl(VisitorDispatcher visitor);
+
+ ClassTag tag_;
+ Member<X> x_base_;
+};
+
+class TraceAfterDispatchExternDerived : public TraceAfterDispatchExternBase {
+ public:
+ TraceAfterDispatchExternDerived() : TraceAfterDispatchExternBase(DERIVED) {}
+
+ void traceAfterDispatch(Visitor* visitor);
+
+ private:
+ template <typename VisitorDispatcher>
+ void traceAfterDispatchImpl(VisitorDispatcher visitor);
+
+ Member<X> x_derived_;
+};
+
+}
+
+#endif // TRACE_AFTER_DISPATCH_IMPL_H_
« no previous file with comments | « tools/clang/blink_gc_plugin/tests/heap/stubs.h ('k') | tools/clang/blink_gc_plugin/tests/trace_after_dispatch_impl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698