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

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

Issue 1391153004: Make StringImpl's content immutable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: bug fix: StringBuffer::release returns m_data directly Created 5 years, 2 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/wtf/text/StringBuffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp
index 5a4771201475d190c3aee72441442f944edba109..3bd0390146d9043f971387b6fb751005509455e8 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp
@@ -360,9 +360,8 @@ String SerializedScriptValueWriter::takeWireString()
{
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));
- return data;
+ ASSERT((m_position + 1) / sizeof(BufferValueType) <= m_buffer.size());
+ return String(m_buffer.data(), (m_position + 1) / sizeof(BufferValueType));
}
void SerializedScriptValueWriter::writeReferenceCount(uint32_t numberOfReferences)
« no previous file with comments | « no previous file | third_party/WebKit/Source/wtf/text/StringBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698