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

Unified Diff: components/html_viewer/blink_text_input_type_converters.cc

Issue 1468803002: Switch to static_assert. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@assert1
Patch Set: message cleanup Created 5 years, 1 month 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: components/html_viewer/blink_text_input_type_converters.cc
diff --git a/components/html_viewer/blink_text_input_type_converters.cc b/components/html_viewer/blink_text_input_type_converters.cc
index 2cb72a0f3118830bce11e45a2cf8e5260b937b6e..100e4f7d893f20a1519496a04c5dde17d0b4f7e7 100644
--- a/components/html_viewer/blink_text_input_type_converters.cc
+++ b/components/html_viewer/blink_text_input_type_converters.cc
@@ -9,10 +9,10 @@
namespace mojo {
-#define TEXT_INPUT_TYPE_ASSERT(NAME, Name) \
- COMPILE_ASSERT(static_cast<int32>(TEXT_INPUT_TYPE_##NAME) == \
- static_cast<int32>(blink::WebTextInputType##Name), \
- text_input_type_should_match)
+#define TEXT_INPUT_TYPE_ASSERT(NAME, Name) \
+ static_assert(static_cast<int32>(TEXT_INPUT_TYPE_##NAME) == \
+ static_cast<int32>(blink::WebTextInputType##Name), \
+ "text_input_type should match")
TEXT_INPUT_TYPE_ASSERT(NONE, None);
TEXT_INPUT_TYPE_ASSERT(TEXT, Text);
TEXT_INPUT_TYPE_ASSERT(PASSWORD, Password);
@@ -29,10 +29,10 @@ TEXT_INPUT_TYPE_ASSERT(TIME, Time);
TEXT_INPUT_TYPE_ASSERT(WEEK, Week);
TEXT_INPUT_TYPE_ASSERT(TEXT_AREA, TextArea);
-#define TEXT_INPUT_FLAG_ASSERT(NAME, Name) \
- COMPILE_ASSERT(static_cast<int32>(TEXT_INPUT_FLAG_##NAME) == \
- static_cast<int32>(blink::WebTextInputFlag##Name), \
- text_input_flag_should_match)
+#define TEXT_INPUT_FLAG_ASSERT(NAME, Name) \
+ static_assert(static_cast<int32>(TEXT_INPUT_FLAG_##NAME) == \
+ static_cast<int32>(blink::WebTextInputFlag##Name), \
+ "text_input_flag should match")
TEXT_INPUT_FLAG_ASSERT(NONE, None);
TEXT_INPUT_FLAG_ASSERT(AUTOCOMPLETE_ON, AutocompleteOn);
TEXT_INPUT_FLAG_ASSERT(AUTOCOMPLETE_OFF, AutocompleteOff);
« no previous file with comments | « components/html_viewer/blink_basic_type_converters.cc ('k') | components/html_viewer/html_frame_properties.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698