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

Unified Diff: chrome/browser/extensions/api/messaging/native_message_process_host.cc

Issue 815363002: replace COMPILE_ASSERT with static_assert in chrome/browser/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixup 2 Created 6 years 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: chrome/browser/extensions/api/messaging/native_message_process_host.cc
diff --git a/chrome/browser/extensions/api/messaging/native_message_process_host.cc b/chrome/browser/extensions/api/messaging/native_message_process_host.cc
index c28b233dea7333b39a2e885cab378926a1657e05..7f455c93e50aa88bc1c3b7dac9bc23c9944ae4a0 100644
--- a/chrome/browser/extensions/api/messaging/native_message_process_host.cc
+++ b/chrome/browser/extensions/api/messaging/native_message_process_host.cc
@@ -153,7 +153,8 @@ void NativeMessageProcessHost::OnMessage(const std::string& json) {
new net::IOBufferWithSize(json.size() + kMessageHeaderSize);
// Copy size and content of the message to the buffer.
- COMPILE_ASSERT(sizeof(uint32) == kMessageHeaderSize, incorrect_header_size);
+ static_assert(sizeof(uint32) == kMessageHeaderSize,
+ "kMessageHeaderSize must be 32 bits");
Nico 2014/12/23 01:32:12 I'd just say "…is incorrect", as is it repeats the
Mostyn Bramley-Moore 2014/12/23 08:16:37 Done.
*reinterpret_cast<uint32*>(buffer->data()) = json.size();
memcpy(buffer->data() + kMessageHeaderSize, json.data(), json.size());

Powered by Google App Engine
This is Rietveld 408576698