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

Unified Diff: mojo/public/tools/bindings/generators/cpp_templates/struct_macros.tmpl

Issue 488123003: Mojo cpp bindings: remove IsNonNullableValidationEnabled() check (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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: mojo/public/tools/bindings/generators/cpp_templates/struct_macros.tmpl
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/struct_macros.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/struct_macros.tmpl
index 12e2dbba45b5128fd0bdaefd1eda4088fe1b640b..5ce9268e5f02abe14adde9915b57ea99b83b474a 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/struct_macros.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/struct_macros.tmpl
@@ -17,8 +17,7 @@
{%- if kind|is_object_kind %}
{%- set wrapper_type = kind|cpp_wrapper_type %}
{%- if not kind|is_nullable_kind %}
- if (mojo::internal::IsNonNullableValidationEnabled() &&
- !object->{{name}}.offset) {
+ if (!object->{{name}}.offset) {
ReportValidationError(
mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER);
return false;
@@ -42,8 +41,7 @@
}
{%- elif kind|is_any_handle_kind %}
{%- if not kind|is_nullable_kind %}
- if (mojo::internal::IsNonNullableValidationEnabled() &&
- object->{{name}}.value() == mojo::internal::kEncodedInvalidHandleValue) {
+ if (object->{{name}}.value() == mojo::internal::kEncodedInvalidHandleValue) {
ReportValidationError(
mojo::internal::VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE);
return false;

Powered by Google App Engine
This is Rietveld 408576698