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

Unified Diff: Source/bindings/core/v8/ScriptValueSerializer.cpp

Issue 797283005: replace COMPILE_ASSERT with static_assert in bindings/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
« no previous file with comments | « Source/bindings/core/v8/ScriptDebugServer.cpp ('k') | Source/bindings/core/v8/ScriptWrappable.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/ScriptValueSerializer.cpp
diff --git a/Source/bindings/core/v8/ScriptValueSerializer.cpp b/Source/bindings/core/v8/ScriptValueSerializer.cpp
index 568e13da2085b9319f1411c5698629ade998a5cd..f070c230c7abf6160994b516f10dfc2781ed623f 100644
--- a/Source/bindings/core/v8/ScriptValueSerializer.cpp
+++ b/Source/bindings/core/v8/ScriptValueSerializer.cpp
@@ -338,7 +338,7 @@ void SerializedScriptValueWriter::writeDenseArray(uint32_t numProperties, uint32
String SerializedScriptValueWriter::takeWireString()
{
- COMPILE_ASSERT(sizeof(BufferValueType) == 2, BufferValueTypeIsTwoBytes);
+ static_assert(sizeof(BufferValueType) == 2, "BufferValueType should be 2 bytes");
fillHole();
String data = String(m_buffer.data(), m_buffer.size());
data.impl()->truncateAssumingIsolated((m_position + 1) / sizeof(BufferValueType));
@@ -459,13 +459,13 @@ void SerializedScriptValueWriter::append(const uint8_t* data, int length)
void SerializedScriptValueWriter::ensureSpace(unsigned extra)
{
- COMPILE_ASSERT(sizeof(BufferValueType) == 2, BufferValueTypeIsTwoBytes);
+ static_assert(sizeof(BufferValueType) == 2, "BufferValueType should be 2 bytes");
m_buffer.resize((m_position + extra + 1) / sizeof(BufferValueType)); // "+ 1" to round up.
}
void SerializedScriptValueWriter::fillHole()
{
- COMPILE_ASSERT(sizeof(BufferValueType) == 2, BufferValueTypeIsTwoBytes);
+ static_assert(sizeof(BufferValueType) == 2, "BufferValueType should be 2 bytes");
// If the writer is at odd position in the buffer, then one of
// the bytes in the last UChar is not initialized.
if (m_position % 2)
« no previous file with comments | « Source/bindings/core/v8/ScriptDebugServer.cpp ('k') | Source/bindings/core/v8/ScriptWrappable.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698