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

Unified Diff: components/html_viewer/blink_basic_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_basic_type_converters.cc
diff --git a/components/html_viewer/blink_basic_type_converters.cc b/components/html_viewer/blink_basic_type_converters.cc
index bcdbd26375d2bdbb3d0618900ac9bd13461bd934..b72946d98fde544c38fb0ee06dd5ef19d814505a 100644
--- a/components/html_viewer/blink_basic_type_converters.cc
+++ b/components/html_viewer/blink_basic_type_converters.cc
@@ -26,8 +26,8 @@ WebString TypeConverter<WebString, String>::Convert(const String& str) {
// static
WebString TypeConverter<WebString, Array<uint8_t>>::Convert(
const Array<uint8_t>& input) {
- COMPILE_ASSERT(sizeof(uint8_t) == sizeof(char),
- uint8_t_same_size_as_unsigned_char);
+ static_assert(sizeof(uint8_t) == sizeof(char),
+ "uint8_t must be the same size as a char");
return input.is_null()
? WebString()
: WebString::fromUTF8(
@@ -51,8 +51,8 @@ Array<uint8_t> TypeConverter<Array<uint8_t>, WebString>::Convert(
return Array<uint8_t>();
const std::string utf8 = input.utf8();
Array<uint8_t> result(utf8.size());
- COMPILE_ASSERT(sizeof(uint8_t) == sizeof(char),
- uint8_t_same_size_as_unsigned_char);
+ static_assert(sizeof(uint8_t) == sizeof(char),
+ "uint8_t must be the same size as an unsigned char");
memcpy(&result.front(), utf8.data(), utf8.size());
return result.Pass();
}
« no previous file with comments | « components/font_service/font_service_app.cc ('k') | components/html_viewer/blink_text_input_type_converters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698