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

Unified Diff: third_party/WebKit/Source/bindings/templates/interface_base.cpp

Issue 2250063002: binding: Adds a check that ActiveScriptWrappable specifies [ActiveScriptWrappable]. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/templates/interface_base.cpp
diff --git a/third_party/WebKit/Source/bindings/templates/interface_base.cpp b/third_party/WebKit/Source/bindings/templates/interface_base.cpp
index 1ea037fe52ae7869108177bcca360bbdd6bb7cd7..8a09d03aef554f20fb15b4ee27aaf12330e88ca3 100644
--- a/third_party/WebKit/Source/bindings/templates/interface_base.cpp
+++ b/third_party/WebKit/Source/bindings/templates/interface_base.cpp
@@ -28,15 +28,23 @@ namespace blink {
#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
#pragma clang diagnostic pop
#endif
+{% if not is_typed_array_type %}
// This static member must be declared by DEFINE_WRAPPERTYPEINFO in {{cpp_class}}.h.
// For details, see the comment of DEFINE_WRAPPERTYPEINFO in
// bindings/core/v8/ScriptWrappable.h.
-{% if not is_typed_array_type %}
const WrapperTypeInfo& {{cpp_class}}::s_wrapperTypeInfo = {{v8_class}}::wrapperTypeInfo;
{% endif %}
+{% if not active_scriptwrappable %}
+static_assert(
+ !std::is_base_of<ActiveScriptWrappable, {{cpp_class}}>::value,
+ "{{cpp_class}} inherits from ActiveScriptWrappable, but does not specify "
+ "[ActiveScriptWrappable] extended attribute in the IDL file. "
+ "Be consistent.");
peria 2016/08/16 07:24:43 Don't we need to care the inverted situation? I me
Yuki 2016/08/16 08:43:27 In that case, a compile error is already happening
Yuki 2016/08/16 08:44:36 Just FYI, it's the same that T* does not inherit f
{% endif %}
+
+{% endif %}{# not is_partial #}
{% if not is_array_buffer_or_view %}
namespace {{cpp_class_or_partial}}V8Internal {
{% if has_partial_interface %}

Powered by Google App Engine
This is Rietveld 408576698