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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/IDLTypesBase.h

Issue 2730183003: bindings: Add C++ versions of WebIDL types and generalize NativeValueTraits. (Closed)
Patch Set: Move specialization for SerializedScriptValue to the appropriate header Created 3 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
Index: third_party/WebKit/Source/bindings/core/v8/IDLTypesBase.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/IDLTypesBase.h b/third_party/WebKit/Source/bindings/core/v8/IDLTypesBase.h
new file mode 100644
index 0000000000000000000000000000000000000000..42819078d81efd14c5a8f2978b7a25d11a32f810
--- /dev/null
+++ b/third_party/WebKit/Source/bindings/core/v8/IDLTypesBase.h
@@ -0,0 +1,29 @@
+// Copyright (c) 2017 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 IDLTypesBase_h
+#define IDLTypesBase_h
+
+namespace blink {
+
+// This is the base type for all WebIDL types, such as the ones defined in
+// IDLTypes.h. It is defined in a separate location to avoid circular header
+// inclusions when one only needs to check if a type inherits from IDLBase.
+struct IDLBase {
+ using ImplType = void;
+};
+
+// If a child class returns a simple type known at the time it is declared, it
+// can inherit from IDLBaseHelper to avoid having to set ImplType on its own.
+//
+// Example:
+// struct MyType<double> final : public IDLBaseHelper<double> {};
+template <typename T>
+struct IDLBaseHelper : public IDLBase {
+ using ImplType = T;
+};
+
+} // namespace blink
+
+#endif // IDLTypesBase_h
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/IDLTypes.h ('k') | third_party/WebKit/Source/bindings/core/v8/IDLTypesTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698