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

Unified Diff: Source/bindings/core/v8/ScriptWrappable.h

Issue 1017183003: Make DOMTypedArray exported. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « no previous file | Source/bindings/templates/interface_base.cpp » ('j') | Source/core/dom/DOMTypedArray.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/ScriptWrappable.h
diff --git a/Source/bindings/core/v8/ScriptWrappable.h b/Source/bindings/core/v8/ScriptWrappable.h
index 1a7c26eb20fae7275f7ef4e1d137d4fe9fc388a9..28e6513d18ddbdaba8bcde08ec5c177e1f4ecb41 100644
--- a/Source/bindings/core/v8/ScriptWrappable.h
+++ b/Source/bindings/core/v8/ScriptWrappable.h
@@ -216,6 +216,21 @@ public: \
private: \
typedef void end_of_define_wrappertypeinfo_not_reached_t
+
+// Declares only 'wrapperTypeInfo' not defines.
Yuki 2015/03/24 11:12:56 nit: Declares 'wrapperTypeInfo' method without def
tasak 2015/03/25 09:01:58 Done.
+//
+// This macro is used for template classes. e.g. DOMTypedArray<>.
+// To export such a template class X, we need to instantiate X with EXPORT_API,
+// i.e. "extern template class EXPORT_API X;"
+// However, once we instantiate X, we cannot specialize X after
+// the instantiation. i.e. we will see "error: explicit specialization of ...
+// after instantiation". So we cannot define X's s_wrapperTypeInfo in generated
+// code by using specialization. Instead, we need to implement wrapperTypeInfo
+// in X's cpp code, and instantiate X, i.e. "template class X;".
+#define DECLARE_WRAPPERTYPEINFO_ONLY() \
Yuki 2015/03/24 11:12:56 nit: DECLARE_WRAPPERTYPEINFO() "declare A only" s
tasak 2015/03/25 09:01:58 Done.
+public: \
+ virtual const WrapperTypeInfo* wrapperTypeInfo() const override
Yuki 2015/03/24 11:12:56 We need a trick of "private: typedef end_of_declar
tasak 2015/03/25 09:01:58 Done.
+
} // namespace blink
#endif // ScriptWrappable_h
« no previous file with comments | « no previous file | Source/bindings/templates/interface_base.cpp » ('j') | Source/core/dom/DOMTypedArray.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698