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

Unified Diff: Source/bindings/v8/SerializedScriptValue.cpp

Issue 20002008: Don't use Vector<UChar> to build strings (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix unit test Created 7 years, 5 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 | Source/core/css/CSSPrimitiveValue.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/SerializedScriptValue.cpp
diff --git a/Source/bindings/v8/SerializedScriptValue.cpp b/Source/bindings/v8/SerializedScriptValue.cpp
index 1ba15580cad91f7cb77cf0e50c9bb0029e6012f5..2b5400d31e1d6485ceb7680588d85fc74007667b 100644
--- a/Source/bindings/v8/SerializedScriptValue.cpp
+++ b/Source/bindings/v8/SerializedScriptValue.cpp
@@ -76,6 +76,7 @@
#include "wtf/Uint8Array.h"
#include "wtf/Uint8ClampedArray.h"
#include "wtf/Vector.h"
+#include "wtf/text/StringBuffer.h"
#include "wtf/text/StringUTF8Adaptor.h"
// FIXME: consider crashing in debug mode on deserialization errors
@@ -2250,9 +2251,9 @@ PassRefPtr<SerializedScriptValue> SerializedScriptValue::createFromWireBytes(con
// Decode wire data from big endian to host byte order.
ASSERT(!(data.size() % sizeof(UChar)));
size_t length = data.size() / sizeof(UChar);
- Vector<UChar> buffer(length);
+ StringBuffer<UChar> buffer(length);
const UChar* src = reinterpret_cast<const UChar*>(data.data());
- UChar* dst = buffer.data();
+ UChar* dst = buffer.characters();
for (size_t i = 0; i < length; i++)
dst[i] = ntohs(src[i]);
« no previous file with comments | « no previous file | Source/core/css/CSSPrimitiveValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698